WarpX icon indicating copy to clipboard operation
WarpX copied to clipboard

Generalization of WarpXSolverVec class used by implicit solvers

Open JustinRayAngus opened this issue 6 months ago • 2 comments

The WarpXSovlerVec class is a wrapper around a Vector of pointers to MutliFabs that contains basic math operators and functionality needed to interact with nonlinear solvers in WarpX and linear solvers in AMReX, such as GMRES. The size of the Vector is the number of amr levels. The original implementation of this class was hard-wired to only work for the electric field. The PR generalizes this class to work for any arbitrary FieldType as listed in Fields.H. In addition to vector fields (array size 3), this class can now also be used for scalar fields, such as the electrostatic potential phi. In general, a WarpXSolver vector can consist of one array size 3 of Multifabs (for vector fields such as E, B, and A) and one scalar field. For example, the array size 3 field can be used for the vector potential A and the scalar field can be used for the scalar potential phi, which is the full state of unknowns for a Darwin electromagnetic model.

This PR does add some bloat to the main WarpX class. A logical next step to this PR would be to create a WarpXFields class and to transfer much of what is in the WarpX class related to the fields to the WarpXFields class.

JustinRayAngus avatar Aug 26 '24 16:08 JustinRayAngus