Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to propose to refactor the
ReadBCParams
function (now defined inWarpXUtil
), with the aim of:Specifically, the changes are:
/FieldBoundaries.H/cpp
file inBoundaryConditions
, that for the moment contains only one pure function to parse the field boundary types from the inputfile (the idea is to extend this file later):move the part of
ReadBCParams
that setspp_geometry.addarr("is_periodic", geom_periodicity);
according to boundary conditions toset_periodicity_according_to_boundary_types
inInitialization/WarpXAMReXInit.cpp
(we usually place here methods that change AMReX default parameters during the initialization).move the part of
ReadBCParams
that parses the particle boundary conditions to a new pure functionparse_particle_boundaries
inParticles/ParticleBoundaries.H/cpp
(note that field boundary conditions are passed as arguments for consistency checks and for assigning default values):initialize
field_boundary_lo
,field_boundary_hi
,particle_boundary_lo
,particle_boundary_hi
insideWarpX::MakeWarpX
Move consistency checks involving field solver to
WarpX::ReadParameters
(a further improvement would be to breakReadParameters
into smaller pieces, but this will require several dedicated PRs).remove
void ReadBCParams ()
fromWarpXUtil.H/cpp