Skip to content

Conversation

@dpgrote
Copy link
Member

@dpgrote dpgrote commented Nov 26, 2025

This cleans up the variable names used in the PEC_Insulator class to increase clarity and readability. It also adds accessors allowing checks of whether there are E or B fields being set by the boundary condition.

@dpgrote dpgrote added cleaning Clean code, improve readability component: boundary PML, embedded boundaries, et al. labels Nov 26, 2025
Comment on lines 87 to 92
* \param[in] set_Fx_lo the flags for the field along x at the lower boundary
* \param[in] set_Fy_lo the flags for the field along y at the lower boundary
* \param[in] set_Fz_lo the flags for the field along z at the lower boundary
* \param[in] set_Fx_hi the flags for the field along x at the upper boundary
* \param[in] set_Fy_hi the flags for the field along y at the upper boundary
* \param[in] set_Fz_hi the flags for the field along z at the upper boundary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the description consistent with changes from your previous PR?

e.g., the flags for the x-field at the lower boundaries

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed with a merge of development

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? Looks like it is still the old way.

@JustinRayAngus
Copy link
Contributor

Hi Dave,

Do think that you could use this new functionality in the ImplicitSolver::convertFieldBCToLinOpBC() routine in /FieldSolver/ImplicitSolvers/ImplicitSolver.cpp ?

The idea is to modify the below lines to use LinOpBCType::Dirichlet when setE is true for FieldBoundaryType::PECInsulator

else if (a_fbc[i] == FieldBoundaryType::PECInsulator) {
            ablastr::warn_manager::WMRecordWarning("Implicit solver",
                "With PECInsulator, in the Curl-Curl preconditioner Neumann boundary will be used since the full boundary is not yet implemented.",
                ablastr::warn_manager::WarnPriority::medium);
            lbc[i] = LinOpBCType::symmetry;
        }

@JustinRayAngus
Copy link
Contributor

Hi Dave,

Do think that you could use this new functionality in the ImplicitSolver::convertFieldBCToLinOpBC() routine in /FieldSolver/ImplicitSolvers/ImplicitSolver.cpp ?

The idea is to modify the below lines to use LinOpBCType::Dirichlet when setE is true for FieldBoundaryType::PECInsulator

else if (a_fbc[i] == FieldBoundaryType::PECInsulator) {
            ablastr::warn_manager::WMRecordWarning("Implicit solver",
                "With PECInsulator, in the Curl-Curl preconditioner Neumann boundary will be used since the full boundary is not yet implemented.",
                ablastr::warn_manager::WarnPriority::medium);
            lbc[i] = LinOpBCType::symmetry;
        }

On second thought, this can be implemented in a future PR.

Copy link
Contributor

@JustinRayAngus JustinRayAngus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dave!

Only one minor thing left. I think the comments in header file still need to be adjusted to match those in the cpp file.

@JustinRayAngus JustinRayAngus enabled auto-merge (squash) December 1, 2025 20:38
@JustinRayAngus JustinRayAngus merged commit aa5ccf7 into BLAST-WarpX:development Dec 1, 2025
50 checks passed
@dpgrote dpgrote deleted the PEC_insulator_cleanup branch December 1, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleaning Clean code, improve readability component: boundary PML, embedded boundaries, et al.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants