OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
FMGPoissonSolver Class Reference

#include <FMGPoissonSolver.h>

Inheritance diagram for FMGPoissonSolver:
Inheritance graph
[legend]
Collaboration diagram for FMGPoissonSolver:
Collaboration graph
[legend]

Public Member Functions

 FMGPoissonSolver (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
 
- Public Member Functions inherited from AmrPoissonSolver< AmrBoxLib >
 AmrPoissonSolver (AmrBoxLib *itsAmrObject_p)
 
virtual ~AmrPoissonSolver ()
 
void computePotential (Field_t &rho, Vector_t hr)
 
void computePotential (Field_t &rho, Vector_t hr, double zshift)
 
void test (PartBunchBase< double, 3 > *bunch)
 
void hasToRegrid ()
 
- Public Member Functions inherited from PoissonSolver
virtual ~PoissonSolver ()
 

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 ()
 
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)
 

Private Attributes

int bc_m [2 *AMREX_SPACEDIM]
 Boundary conditions. More...
 
double reltol_m
 Relative tolearance for solver. More...
 
double abstol_m
 Absolute tolerance for solver. More...
 

Additional Inherited Members

- Protected Attributes inherited from AmrPoissonSolver< AmrBoxLib >
AmrBoxLibitsAmrObject_mp
 
bool regrid_m
 is set to true by itsAmrObject_mp and reset to false by solver More...
 

Detailed Description

Definition at line 11 of file FMGPoissonSolver.h.

Member Typedef Documentation

Definition at line 15 of file FMGPoissonSolver.h.

Definition at line 16 of file FMGPoissonSolver.h.

Definition at line 17 of file FMGPoissonSolver.h.

Definition at line 18 of file FMGPoissonSolver.h.

Definition at line 19 of file FMGPoissonSolver.h.

Definition at line 20 of file FMGPoissonSolver.h.

Definition at line 14 of file FMGPoissonSolver.h.

Constructor & Destructor Documentation

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).

Parameters
itsAmrObject_phas information about refinemen ratios, etc.

Definition at line 10 of file FMGPoissonSolver.cpp.

References bc_m, and initParameters_m().

Here is the call graph for this function:

Member Function Documentation

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

Implements PoissonSolver.

Definition at line 108 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

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

Implements PoissonSolver.

Definition at line 103 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

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

Implements PoissonSolver.

Definition at line 118 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

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

Implements PoissonSolver.

Definition at line 113 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

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

Implements PoissonSolver.

Definition at line 128 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

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

Implements PoissonSolver.

Definition at line 123 of file FMGPoissonSolver.cpp.

References AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp.

void FMGPoissonSolver::initParameters_m ( )
private

Initialize additional parameters for the multigrid solver that are given by ParmParse. The function is called in the constructory only.

Definition at line 142 of file FMGPoissonSolver.cpp.

Referenced by FMGPoissonSolver().

Inform & FMGPoissonSolver::print ( Inform os) const

Print information abour tolerances.

Parameters
osoutput stream where to write to

Definition at line 133 of file FMGPoissonSolver.cpp.

References abstol_m, endl(), and reltol_m.

Referenced by operator<<().

Here is the call graph for this function:

void FMGPoissonSolver::solve ( AmrScalarFieldContainer_t rho,
AmrScalarFieldContainer_t phi,
AmrVectorFieldContainer_t efield,
unsigned short  baseLevel,
unsigned short  finestLevel,
bool  prevAsGuess = true 
)
virtual

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

Reimplemented from PoissonSolver.

Definition at line 24 of file FMGPoissonSolver.cpp.

References abstol_m, bc_m, AmrPoissonSolver< AmrBoxLib >::itsAmrObject_mp, Hypervolume::n, and solveWithF90_m().

Here is the call graph for this function:

double FMGPoissonSolver::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 
)
private

Does the actual solve. It calls the FMultiGrid solver of AMReX. It uses an approximation order of 3 at Dirichlet boundaries.

Parameters
rhocharge density on grids [C / m]
phielectrostatic potential on grid [V]
grad_phi_edgegradient of the potential (values at faces)
geomgeometry of the problem, i.e. physical domain boundaries
baseLevelfor solve
finestLevelfor solve
Returns
the residuum norm

Definition at line 242 of file FMGPoissonSolver.cpp.

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

Referenced by solve().

Member Data Documentation

double FMGPoissonSolver::abstol_m
private

Absolute tolerance for solver.

Definition at line 106 of file FMGPoissonSolver.h.

Referenced by print(), solve(), and solveWithF90_m().

int FMGPoissonSolver::bc_m[2 *AMREX_SPACEDIM]
private

Boundary conditions.

In case of reusing the previous solution the grids might have changed, thus, we interpolate from the coarse grids to the fine grids

Definition at line 104 of file FMGPoissonSolver.h.

Referenced by FMGPoissonSolver(), solve(), and solveWithF90_m().

double FMGPoissonSolver::reltol_m
private

Relative tolearance for solver.

Definition at line 105 of file FMGPoissonSolver.h.

Referenced by print(), and solveWithF90_m().


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