#include <NodeLevelMG.H>
Multigrid solver on a level. This class is to be considered internal to LevelNodeSolver and not a part of the Chombo API.
Public Member Functions | |
NodeLevelOp * | levelOpPtr () |
NodeLevelMG * | lCoarsePtr () |
Constructors, destructor and defines | |
NodeLevelMG () | |
NodeLevelMG (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_gridsCoarsePtr, const ProblemDomain &a_domain, Real a_dx, int a_refToCoarse, const NodeLevelOp *const a_opin, int a_nCoarserLevels) | |
NodeLevelMG (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_gridsCoarsePtr, const Box &a_domain, Real a_dx, int a_refToCoarse, const NodeLevelOp *const a_opin, int a_nCoarserLevels) | |
~NodeLevelMG () | |
NodeLevelMG (NodeLevelMG &a_L, int a_refToCoarse, const NodeLevelOp *a_opin) | |
void | define (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_gridsCoarsePtr, const ProblemDomain &a_domain, Real a_dx, int a_refToCoarse, const NodeLevelOp *const a_opin, int a_nCoarserLevels) |
void | define (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_gridsCoarsePtr, const Box &a_domain, Real a_dx, int a_refToCoarse, const NodeLevelOp *const a_opin, int a_nCoarserLevels) |
void | define (const NodeLevelMG &a_L, int a_refToCoarse, const NodeLevelOp *a_opin) |
Access functions | |
bool | isDefined () const |
Parameter-setting functions | |
void | setnumSmoothUp (int a_numSmoothUp) |
void | setnumSmoothDown (int a_numSmoothDown) |
void | setVerbose (bool a_verbose) |
Data modification functions | |
void | mgRelax (LevelData< NodeFArrayBox > &a_phi, const LevelData< NodeFArrayBox > &a_rhs, bool a_bottomsolveflag) |
Protected Member Functions | |
void | setDefaultValues () |
void | clearMemory () |
Protected Attributes | |
bool | m_isDefined |
bool | m_verbose |
LevelData< NodeFArrayBox > | m_resid |
LevelData< NodeFArrayBox > | m_crseResid |
LevelData< NodeFArrayBox > | m_crseCorr |
DisjointBoxLayout | m_grids |
DisjointBoxLayout | m_coarsenedGrids |
const DisjointBoxLayout * | m_gridsCoarsePtr |
Real | m_dx |
ProblemDomain | m_domain |
int | m_nCoarserLevels |
NodeLevelMG * | m_lCoarsePtr |
NodeLevelOp * | m_levelopPtr |
int | m_numBottomPoints |
int | m_numSmoothUp |
int | m_numSmoothDown |
int | m_refToCoarsened |
NodeCoarseAverage | m_averageOp |
Box | m_boxRef |
FArrayBox | m_weights |
Private Member Functions | |
void | crseCorrect (LevelData< NodeFArrayBox > &a_phi) |
void | operator= (const NodeLevelMG &a_levmgin) |
NodeLevelMG (const NodeLevelMG &a_levmgin) |
NodeLevelMG::NodeLevelMG | ( | ) |
Default constructor. User must subsequently call define().
NodeLevelMG::NodeLevelMG | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
const ProblemDomain & | a_domain, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const NodeLevelOp *const | a_opin, | |||
int | a_nCoarserLevels | |||
) |
Constructor to define NodeLevelMG from the inputs. Calls full define() function with identical arguments.
NodeLevelMG::NodeLevelMG | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
const Box & | a_domain, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const NodeLevelOp *const | a_opin, | |||
int | a_nCoarserLevels | |||
) |
Constructor to define NodeLevelMG from the inputs. Calls full define() function with identical arguments.
NodeLevelMG::~NodeLevelMG | ( | ) |
Destructor.
NodeLevelMG::NodeLevelMG | ( | NodeLevelMG & | a_L, | |
int | a_refToCoarse, | |||
const NodeLevelOp * | a_opin | |||
) |
Constructor for coarsened version of object. Calls define() function with identical arguments.
NodeLevelMG::NodeLevelMG | ( | const NodeLevelMG & | a_levmgin | ) | [inline, private] |
void NodeLevelMG::define | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
const ProblemDomain & | a_domain, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const NodeLevelOp *const | a_opin, | |||
int | a_nCoarserLevels | |||
) |
Full define function.
a_grids | CELL-centered grids on which solution will be computed |
a_gridsCoarsePtr | pointer to next coarser AMR level's CELL-centered grids, or NULL if there is no coarser AMR level |
a_domain | CELL-centered physical domain at this level |
a_dx | mesh spacing |
a_opin | operator L used in solution of L(phi) = rho |
a_nCoarserLevels | number of coarser multigrid levels |
void NodeLevelMG::define | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
const Box & | a_domain, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const NodeLevelOp *const | a_opin, | |||
int | a_nCoarserLevels | |||
) |
Full define function.
a_grids | CELL-centered grids on which solution will be computed |
a_gridsCoarsePtr | pointer to next coarser AMR level's CELL-centered grids, or NULL if there is no coarser AMR level |
a_domain | CELL-centered physical domain at this level |
a_dx | mesh spacing |
a_opin | operator L used in solution of L(phi) = rho |
a_nCoarserLevels | number of coarser multigrid levels |
void NodeLevelMG::define | ( | const NodeLevelMG & | a_L, | |
int | a_refToCoarse, | |||
const NodeLevelOp * | a_opin | |||
) |
Function to define coarsened version of this NodeLevelMG.
a_L | original object |
a_refToCoarse | refinement ratio between a_L and this object |
a_opin | operator L used in solution of L(phi) = rho at same level as a_L |
bool NodeLevelMG::isDefined | ( | ) | const |
Returns true if this object was created with the defining constructor or if define() has been called.
void NodeLevelMG::setnumSmoothUp | ( | int | a_numSmoothUp | ) |
Set number of smoothings on way up V-cycle; Default is 4.
void NodeLevelMG::setnumSmoothDown | ( | int | a_numSmoothDown | ) |
Set number of smoothings on way down V-cycle; Default is 4.
void NodeLevelMG::setVerbose | ( | bool | a_verbose | ) |
Set whether the solver gives output while solving. Default is true
.
void NodeLevelMG::mgRelax | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_rhs, | |||
bool | a_bottomsolveflag | |||
) |
Invoke relaxation step. Default is pure multigrid V-cycle, suitable for use in multilevel solver application; otherwise, use approximate solver such as CG at bottom level. It is assumed that the problem has already been put in residual-correction form. In particular, only the homogeneous form of the physical and coarse/fine boundary conditions need be invoked.
Modified are m_resid, m_crseResid, and m_crseCorr.
a_phi | solution on this level |
a_rhs | right-hand side on this level |
a_bottomsolveflag | whether to use bottom solver at coarsest level |
NodeLevelOp* NodeLevelMG::levelOpPtr | ( | ) |
this is a dangerous access function that should not generally be used.
NodeLevelMG* NodeLevelMG::lCoarsePtr | ( | ) |
this is another access function that is kinda bad
void NodeLevelMG::setDefaultValues | ( | ) | [protected] |
Set default values. Does not deal with memory.
void NodeLevelMG::clearMemory | ( | ) | [protected] |
Delete internal memory and set pointers to NULL.
void NodeLevelMG::crseCorrect | ( | LevelData< NodeFArrayBox > & | a_phi | ) | [private] |
Correct a_phi on intersection with m_crseCorr. Should only be called internally because this is not written for general LevelData<NodeFArrayBox>es
void NodeLevelMG::operator= | ( | const NodeLevelMG & | a_levmgin | ) | [inline, private] |
bool NodeLevelMG::m_isDefined [protected] |
has this NodeLevelMG been defined yet?
bool NodeLevelMG::m_verbose [protected] |
flag for verbose output
LevelData<NodeFArrayBox> NodeLevelMG::m_resid [protected] |
residual at this level
LevelData<NodeFArrayBox> NodeLevelMG::m_crseResid [protected] |
residual at next coarser level
LevelData<NodeFArrayBox> NodeLevelMG::m_crseCorr [protected] |
correction at next coarser level
DisjointBoxLayout NodeLevelMG::m_grids [protected] |
grids at this level
DisjointBoxLayout NodeLevelMG::m_coarsenedGrids [protected] |
coarsened version of CELL-centered grids at this level
const DisjointBoxLayout* NodeLevelMG::m_gridsCoarsePtr [protected] |
pointer to CELL-centered grids at next coarser AMR level, or NULL if no coarser level
Real NodeLevelMG::m_dx [protected] |
mesh spacing at this level
ProblemDomain NodeLevelMG::m_domain [protected] |
CELL-centered physical domain at this level
int NodeLevelMG::m_nCoarserLevels [protected] |
number of coarser multigrid levels
NodeLevelMG* NodeLevelMG::m_lCoarsePtr [protected] |
pointer to coarser level
NodeLevelOp* NodeLevelMG::m_levelopPtr [protected] |
the operator
int NodeLevelMG::m_numBottomPoints [protected] |
number of CELLs in physical domain
int NodeLevelMG::m_numSmoothUp [protected] |
number of smoother iterations on sweep up
int NodeLevelMG::m_numSmoothDown [protected] |
number of smoother iterations on sweep down
int NodeLevelMG::m_refToCoarsened [protected] |
refinement ratio to next coarser multigrid level
NodeCoarseAverage NodeLevelMG::m_averageOp [protected] |
operator for averaging from this level to next coarser multigrid level
Box NodeLevelMG::m_boxRef [protected] |
reference box used in interpolation from next coarser multigrid level
FArrayBox NodeLevelMG::m_weights [protected] |
weights of corners in interpolation from next coarser multigrid level