|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <FMGPoissonSolver.h>


Public Member Functions | |
| FMGPoissonSolver (AmrBoxLib *itsAmrObject_p) | |
| This solver only works with AmrBoxLib. More... | |
| void | solve (AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, unsigned short baseLevel, unsigned short finestLevel, bool prevAsGuess=true) |
| Multigrid solve based on AMReX FMultiGrid solver. More... | |
| double | getXRangeMin (unsigned short level=0) |
| double | getXRangeMax (unsigned short level=0) |
| double | getYRangeMin (unsigned short level=0) |
| double | getYRangeMax (unsigned short level=0) |
| double | getZRangeMin (unsigned short level=0) |
| double | getZRangeMax (unsigned short level=0) |
| Inform & | print (Inform &os) const |
| Print information abour tolerances. More... | |
| void | computePotential (Field_t &, Vector_t) |
| void | computePotential (Field_t &, Vector_t, double) |
| void | test (PartBunchBase< double, 3 > *) |
| void | hasToRegrid () |
| Tell solver to regrid. More... | |
| virtual void | resizeMesh (Vector_t &, Vector_t &, const Vector_t &, const Vector_t &, double) |
| virtual double | getinteractionRadius () const |
| virtual void | calculatePairForces (PartBunchBase< double, 3 > *, double) |
Protected Types | |
| typedef Field< int, 3, Mesh_t, Center_t > | IField_t |
| typedef Field< std::complex< double >, 3, Mesh_t, Center_t > | CxField_t |
Protected Attributes | |
| AmrBoxLib * | itsAmrObject_mp |
| bool | regrid_m |
| is set to true by itsAmrObject_mp and reset to false by solver More... | |
Private Types | |
| typedef AmrBoxLib::AmrGeomContainer_t | GeomContainer_t |
| typedef amrex::Vector< AmrBoxLib::AmrField_t * > | AmrFieldContainer_pt |
| typedef AmrBoxLib::AmrGeometry_t | AmrGeometry_t |
| typedef AmrBoxLib::AmrGrid_t | AmrGrid_t |
| typedef AmrBoxLib::AmrProcMap_t | AmrProcMap_t |
| typedef AmrBoxLib::AmrScalarFieldContainer_t | AmrScalarFieldContainer_t |
| typedef AmrBoxLib::AmrVectorFieldContainer_t | AmrVectorFieldContainer_t |
Private Member Functions | |
| void | initParameters_m () |
| Initialize additional parameters for the multigrid solver that are given by ParmParse. More... | |
| double | solveWithF90_m (const AmrFieldContainer_pt &rho, const AmrFieldContainer_pt &phi, const amrex::Vector< AmrFieldContainer_pt > &grad_phi_edge, const GeomContainer_t &geom, int baseLevel, int finestLevel) |
| Does the actual solve. More... | |
Private Attributes | |
| int | bc_m [2 *AMREX_SPACEDIM] |
| In case of reusing the previous solution the grids might have changed, thus, we interpolate from the coarse grids to the fine grids. More... | |
| double | reltol_m |
| Relative tolearance for solver. More... | |
| double | abstol_m |
| Absolute tolerance for solver. More... | |
Definition at line 33 of file FMGPoissonSolver.h.
|
private |
Definition at line 37 of file FMGPoissonSolver.h.
|
private |
Definition at line 38 of file FMGPoissonSolver.h.
|
private |
Definition at line 39 of file FMGPoissonSolver.h.
|
private |
Definition at line 40 of file FMGPoissonSolver.h.
Definition at line 41 of file FMGPoissonSolver.h.
Definition at line 42 of file FMGPoissonSolver.h.
|
protectedinherited |
Definition at line 20 of file PoissonSolver.h.
|
private |
Definition at line 36 of file FMGPoissonSolver.h.
|
protectedinherited |
Definition at line 19 of file PoissonSolver.h.
| FMGPoissonSolver::FMGPoissonSolver | ( | AmrBoxLib * | itsAmrObject_p | ) |
This solver only works with AmrBoxLib.
In order the solver to work the cells need to be of cubic shape. Otherwise the solver stops with the error message that it did not converge (AMReX internal).
| itsAmrObject_p | has information about refinemen ratios, etc. |
Definition at line 32 of file FMGPoissonSolver.cpp.
References bc_m, and initParameters_m().

|
inlinevirtualinherited |
Reimplemented in P3MPoissonSolver.
Definition at line 74 of file PoissonSolver.h.
Referenced by PartBunch::computeSelfFields().
|
inlinevirtualinherited |
Implements PoissonSolver.
Definition at line 42 of file AmrPoissonSolver.h.
|
inlinevirtualinherited |
Implements PoissonSolver.
Definition at line 47 of file AmrPoissonSolver.h.
|
inlinevirtualinherited |
Reimplemented in P3MPoissonSolver.
Definition at line 72 of file PoissonSolver.h.
|
virtual |
Implements PoissonSolver.
Definition at line 130 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
virtual |
Implements PoissonSolver.
Definition at line 125 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
virtual |
Implements PoissonSolver.
Definition at line 140 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
virtual |
Implements PoissonSolver.
Definition at line 135 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
virtual |
Implements PoissonSolver.
Definition at line 150 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
virtual |
Implements PoissonSolver.
Definition at line 145 of file FMGPoissonSolver.cpp.
References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.
|
inlinevirtualinherited |
Tell solver to regrid.
Reimplemented from PoissonSolver.
Definition at line 56 of file AmrPoissonSolver.h.
|
private |
Initialize additional parameters for the multigrid solver that are given by ParmParse.
The function is called in the constructory only.
Definition at line 164 of file FMGPoissonSolver.cpp.
Referenced by FMGPoissonSolver().
Print information abour tolerances.
| os | output stream where to write to |
Definition at line 155 of file FMGPoissonSolver.cpp.
References abstol_m, endl(), and reltol_m.

|
inlinevirtualinherited |
Reimplemented in MGPoissonSolver.
Definition at line 68 of file PoissonSolver.h.
Referenced by PartBunch::resizeMesh().
|
virtual |
Multigrid solve based on AMReX FMultiGrid solver.
The relative tolerance is set to 1.0e-9 and the absolute tolerance to 0.0.
| rho | right-hand side charge density on grid [C / m] |
| phi | electrostatic potential (unknown) [V] |
| efield | electric field [V / m] |
| baseLevel | for solve |
| finestLevel | for solve |
| prevAsGuess | use of previous solution as initial guess |
Reimplemented from PoissonSolver.
Definition at line 46 of file FMGPoissonSolver.cpp.
References abstol_m, bc_m, GlobalFunctions::get(), AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp, Hypervolume::n, PAssert, and solveWithF90_m().

|
private |
Does the actual solve.
It calls the FMultiGrid solver of AMReX. It uses an approximation order of 3 at Dirichlet boundaries.
| rho | charge density on grids [C / m] |
| phi | electrostatic potential on grid [V] |
| grad_phi_edge | gradient of the potential (values at faces) |
| geom | geometry of the problem, i.e. physical domain boundaries |
| baseLevel | for solve |
| finestLevel | for solve |
Definition at line 264 of file FMGPoissonSolver.cpp.
References abstol_m, bc_m, AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp, and reltol_m.
Referenced by solve().
|
inlinevirtualinherited |
Implements PoissonSolver.
Definition at line 52 of file AmrPoissonSolver.h.
|
private |
Absolute tolerance for solver.
Definition at line 128 of file FMGPoissonSolver.h.
Referenced by print(), solve(), and solveWithF90_m().
|
private |
In case of reusing the previous solution the grids might have changed, thus, we interpolate from the coarse grids to the fine grids.
Boundary conditions
Definition at line 126 of file FMGPoissonSolver.h.
Referenced by FMGPoissonSolver(), solve(), and solveWithF90_m().
|
protectedinherited |
Definition at line 61 of file AmrPoissonSolver.h.
|
protectedinherited |
is set to true by itsAmrObject_mp and reset to false by solver
Definition at line 64 of file AmrPoissonSolver.h.
|
private |
Relative tolearance for solver.
Definition at line 127 of file FMGPoissonSolver.h.
Referenced by print(), and solveWithF90_m().