OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
MLPoissonSolver Class Referenceabstract

#include <MLPoissonSolver.h>

Inheritance diagram for MLPoissonSolver:
Collaboration diagram for MLPoissonSolver:

Public Member Functions

 MLPoissonSolver (AmrBoxLib *itsAmrObject_p)
void solve (AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, unsigned short baseLevel, unsigned short finestLevel, bool prevAsGuess=true)
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)
Informprint (Inform &os) const
void computePotential (Field_t &, Vector_t)
virtual void computePotential (Field_t &rho, Vector_t hr, double zshift)=0
void test (PartBunchBase< double, 3 > *)
void hasToRegrid ()
virtual void solve (AmrScalarFieldContainer_t &, AmrScalarFieldContainer_t &, AmrVectorFieldContainer_t &, unsigned short, unsigned short, bool=true)
virtual void solve (AmrScalarFieldContainer_t &, AmrScalarFieldContainer_t &, AmrVectorFieldContainer_t &, unsigned short, unsigned short, bool=true)
virtual void resizeMesh (Vector_t &, Vector_t &, const Vector_t &, const Vector_t &, double)
virtual void resizeMesh (Vector_t &, Vector_t &, const Vector_t &, const Vector_t &, double)
virtual double getinteractionRadius () const
virtual double getinteractionRadius () const
virtual void calculatePairForces (PartBunchBase< double, 3 > *, double)
virtual void calculatePairForces (PartBunchBase< double, 3 > *, double)

Protected Types

typedef Field< int, 3, Mesh_t, Center_tIField_t
typedef Field< int, 3, Mesh_t, Center_tIField_t
typedef Field< std::complex< double >, 3, Mesh_t, Center_tCxField_t
typedef Field< std::complex< double >, 3, Mesh_t, Center_tCxField_t

Protected Attributes

AmrBoxLibitsAmrObject_mp
bool regrid_m
 is set to true by itsAmrObject_mp and reset to false by solver

Private Types

typedef AmrBoxLib::AmrGeomContainer_t GeomContainer_t
typedef amrex::Vector< AmrBoxLib::AmrField_t * > AmrFieldContainer_pt
typedef amrex::Vector< const AmrBoxLib::AmrField_t * > const_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
typedef AmrBoxLib::AmrGridContainer_t AmrGridContainer_t
typedef AmrBoxLib::AmrProcMapContainer_t AmrProcMapContainer_t

Private Member Functions

void mlmg_m (AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, int baseLevel, int finestLevel)

Private Attributes

double reltol_m
 Relative tolearance for solver.
double abstol_m
 Absolute tolerance for solver.

Detailed Description

Definition at line 27 of file MLPoissonSolver.h.

Member Typedef Documentation

◆ AmrFieldContainer_pt

Definition at line 31 of file MLPoissonSolver.h.

◆ AmrGeometry_t

Definition at line 33 of file MLPoissonSolver.h.

◆ AmrGrid_t

Definition at line 34 of file MLPoissonSolver.h.

◆ AmrGridContainer_t

◆ AmrProcMap_t

Definition at line 35 of file MLPoissonSolver.h.

◆ AmrProcMapContainer_t

◆ AmrScalarFieldContainer_t

◆ AmrVectorFieldContainer_t

◆ const_AmrFieldContainer_pt

Definition at line 32 of file MLPoissonSolver.h.

◆ CxField_t [1/2]

typedef Field<std::complex<double>, 3, Mesh_t, Center_t> PoissonSolver::CxField_t
protectedinherited

Definition at line 20 of file PoissonSolver.h.

◆ CxField_t [2/2]

typedef Field<std::complex<double>, 3, Mesh_t, Center_t> PoissonSolver::CxField_t
protectedinherited

Definition at line 20 of file PoissonSolver.h.

◆ GeomContainer_t

◆ IField_t [1/2]

typedef Field<int, 3, Mesh_t, Center_t> PoissonSolver::IField_t
protectedinherited

Definition at line 19 of file PoissonSolver.h.

◆ IField_t [2/2]

typedef Field<int, 3, Mesh_t, Center_t> PoissonSolver::IField_t
protectedinherited

Definition at line 19 of file PoissonSolver.h.

Constructor & Destructor Documentation

◆ MLPoissonSolver()

MLPoissonSolver::MLPoissonSolver ( 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).

Parameters
itsAmrObject_phas information about refinemen ratios, etc.

Definition at line 31 of file MLPoissonSolver.cpp.

References abstol_m, AmrPoissonSolver< AmrBoxLib >::AmrPoissonSolver(), and reltol_m.

Here is the call graph for this function:

Member Function Documentation

◆ calculatePairForces() [1/2]

virtual void PoissonSolver::calculatePairForces ( PartBunchBase< double, 3 > * ,
double  )
inlinevirtualinherited

Definition at line 74 of file PoissonSolver.h.

◆ calculatePairForces() [2/2]

virtual void PoissonSolver::calculatePairForces ( PartBunchBase< double, 3 > * ,
double  )
inlinevirtualinherited

Reimplemented in P3MPoissonSolver.

Definition at line 74 of file PoissonSolver.h.

◆ computePotential() [1/2]

void AmrPoissonSolver< AmrBoxLib >::computePotential ( Field_t & ,
Vector_t  )
inlinevirtualinherited

Implements PoissonSolver.

Definition at line 42 of file AmrPoissonSolver.h.

◆ computePotential() [2/2]

virtual void PoissonSolver::computePotential ( Field_t & rho,
Vector_t hr,
double zshift )
pure virtualinherited

◆ getinteractionRadius() [1/2]

virtual double PoissonSolver::getinteractionRadius ( ) const
inlinevirtualinherited

Definition at line 72 of file PoissonSolver.h.

◆ getinteractionRadius() [2/2]

virtual double PoissonSolver::getinteractionRadius ( ) const
inlinevirtualinherited

Reimplemented in P3MPoissonSolver.

Definition at line 72 of file PoissonSolver.h.

◆ getXRangeMax()

double MLPoissonSolver::getXRangeMax ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 60 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ getXRangeMin()

double MLPoissonSolver::getXRangeMin ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 55 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ getYRangeMax()

double MLPoissonSolver::getYRangeMax ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 70 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ getYRangeMin()

double MLPoissonSolver::getYRangeMin ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 65 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ getZRangeMax()

double MLPoissonSolver::getZRangeMax ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 80 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ getZRangeMin()

double MLPoissonSolver::getZRangeMin ( unsigned short level = 0)
virtual

Implements PoissonSolver.

Definition at line 75 of file MLPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

◆ hasToRegrid()

void AmrPoissonSolver< AmrBoxLib >::hasToRegrid ( )
inlinevirtualinherited

Tell solver to regrid

Reimplemented from PoissonSolver.

Definition at line 56 of file AmrPoissonSolver.h.

◆ mlmg_m()

void MLPoissonSolver::mlmg_m ( AmrScalarFieldContainer_t & rho,
AmrScalarFieldContainer_t & phi,
AmrVectorFieldContainer_t & efield,
int baseLevel,
int finestLevel )
private

Does the actual solve.

Parameters
rhocharge density on grids [C / m]
phielectrostatic potential on grid [V]
baseLevelfor solve
finestLevelfor solve

Definition at line 94 of file MLPoissonSolver.cpp.

References abstol_m, AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp, and reltol_m.

Referenced by solve().

◆ print()

Inform & MLPoissonSolver::print ( Inform & os) const

Print information abour tolerances.

Parameters
osoutput stream where to write to

Definition at line 85 of file MLPoissonSolver.cpp.

References abstol_m, endl(), and reltol_m.

Here is the call graph for this function:

◆ resizeMesh() [1/2]

virtual void PoissonSolver::resizeMesh ( Vector_t & ,
Vector_t & ,
const Vector_t & ,
const Vector_t & ,
double  )
inlinevirtualinherited

Definition at line 68 of file PoissonSolver.h.

◆ resizeMesh() [2/2]

virtual void PoissonSolver::resizeMesh ( Vector_t & ,
Vector_t & ,
const Vector_t & ,
const Vector_t & ,
double  )
inlinevirtualinherited

Definition at line 68 of file PoissonSolver.h.

◆ solve() [1/3]

virtual void PoissonSolver::solve ( AmrScalarFieldContainer_t & ,
AmrScalarFieldContainer_t & ,
AmrVectorFieldContainer_t & ,
unsigned short ,
unsigned short ,
bool = true )
inlinevirtualinherited

AMR solver calls

Parameters
rhoright-hand side charge density on grid [C / m]
phielectrostatic potential (unknown) [V]
efieldelectric field [V / m]
baseLevelfor solve
finestLevelfor solve
prevAsGuessuse of previous solution as initial guess

Definition at line 39 of file PoissonSolver.h.

◆ solve() [2/3]

void MLPoissonSolver::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. The relative tolerance is set to 1.0e-9 and the absolute tolerance to 0.0.

Parameters
rhoright-hand side charge density on grid [C / m]
phielectrostatic potential (unknown) [V]
efieldelectric field [V / m]
baseLevelfor solve
finestLevelfor solve
prevAsGuessuse of previous solution as initial guess

Definition at line 37 of file MLPoissonSolver.cpp.

References mlmg_m().

Here is the call graph for this function:

◆ solve() [3/3]

virtual void PoissonSolver::solve ( AmrScalarFieldContainer_t & ,
AmrScalarFieldContainer_t & ,
AmrVectorFieldContainer_t & ,
unsigned short ,
unsigned short ,
bool = true )
inlinevirtualinherited

AMR solver calls

Parameters
rhoright-hand side charge density on grid [C / m]
phielectrostatic potential (unknown) [V]
efieldelectric field [V / m]
baseLevelfor solve
finestLevelfor solve
prevAsGuessuse of previous solution as initial guess

Reimplemented in AmrMultiGrid.

Definition at line 39 of file PoissonSolver.h.

Referenced by AmrBoxLib::computeSelfFields_cycl(), and AmrBoxLib::solvePoisson_m().

◆ test()

void AmrPoissonSolver< AmrBoxLib >::test ( PartBunchBase< double, 3 > * )
inlinevirtualinherited

Implements PoissonSolver.

Definition at line 52 of file AmrPoissonSolver.h.

Member Data Documentation

◆ abstol_m

double MLPoissonSolver::abstol_m
private

Absolute tolerance for solver.

Definition at line 103 of file MLPoissonSolver.h.

Referenced by mlmg_m(), MLPoissonSolver(), and print().

◆ itsAmrObject_mp

◆ regrid_m

bool AmrPoissonSolver< AmrBoxLib >::regrid_m
protectedinherited

is set to true by itsAmrObject_mp and reset to false by solver

Definition at line 64 of file AmrPoissonSolver.h.

Referenced by AmrMultiGrid::solve(), and AmrMultiGrid::writeSDDSData_m().

◆ reltol_m

double MLPoissonSolver::reltol_m
private

Relative tolearance for solver.

Definition at line 102 of file MLPoissonSolver.h.

Referenced by mlmg_m(), MLPoissonSolver(), and print().


The documentation for this class was generated from the following files: