#include <AMRNodeLevelMG.H>
AMRNodeLevelMG manages the operations on a level for AMRNodeSolver. AMRNodeSolver contains a vector of AMRNodeLevelMG's (one for each level). This class should be considered internal to AMRNodeSolver and should not be considered part of the Chombo API.
AMRNodeLevelMG::AMRNodeLevelMG | ( | ) |
Default constructor. User must subsequently call define().
AMRNodeLevelMG::AMRNodeLevelMG | ( | const AMRNodeSolver *const | a_parent, | |
int | a_level, | |||
const NodeLevelOp *const | a_opin | |||
) |
Constructor to define AMRNodeLevelMG from the inputs. Calls define() function with identical arguments.
AMRNodeLevelMG::~AMRNodeLevelMG | ( | ) |
Destructor.
AMRNodeLevelMG::AMRNodeLevelMG | ( | const AMRNodeLevelMG & | ) | [private] |
void AMRNodeLevelMG::define | ( | const AMRNodeSolver *const | a_parent, | |
int | a_level, | |||
const NodeLevelOp *const | a_opin | |||
) |
Define AMRNodeLevelMG from the inputs.
The AMRNodeLevelMG will only work for the input AMRNodeSolver. A NodeLevelMG is created.
a_parent | parent AMRNodeSolver |
a_level | level in the AMR hierarchy |
a_opin | pointer to operator |
bool AMRNodeLevelMG::isDefined | ( | ) | const |
Returns true
if this object was created with the defining constructor or if define() has been called.
Real AMRNodeLevelMG::computeResidualNorm | ( | int | a_normType | ) | const |
Compute and return norm of internal data m_resid.
a_normType | which norm to take, or 0 for max norm |
void AMRNodeLevelMG::setnumSmoothUp | ( | int | a_numSmoothUp | ) |
Set number of multigrid smoothings on way up V-cycle; Default is 4.
void AMRNodeLevelMG::setnumSmoothDown | ( | int | a_numSmoothDown | ) |
Set number of multigrid smoothings on way down V-cycle; Default is 4.
void AMRNodeLevelMG::setVerbose | ( | bool | a_verbose | ) |
Set whether the solver gives output while solving. Default is true
.
void AMRNodeLevelMG::applyAMROperator | ( | LevelData< NodeFArrayBox > & | a_Lofphi, | |
Vector< LevelData< NodeFArrayBox > * > & | a_phiLevel | |||
) |
Complete, 3-level operator. Applies operator with inhomogeneous coarse-fine boundary conditions and inhomogeneous domain boundary conditions.
As a side effect, this function modifies a_phiLevel[m_level] by:
a_Lofphi | L(phi) result of evaluation at level m_level |
a_phiLevel | pointers to solution, indexed by level; max Vector index must be at least m_level |
void AMRNodeLevelMG::applyAMRGradient | ( | LevelData< NodeFArrayBox > & | a_gradPhi, | |
Vector< LevelData< NodeFArrayBox > * > & | a_phiLevel | |||
) |
Complete, 3-level gradient. Finds gradient with inhomogeneous coarse-fine boundary conditions and inhomogeneous domain boundary conditions.
As a side effect, this function modifies a_phiLevel[m_level] by:
a_gradPhi | gradient of phi at level m_level |
a_phiLevel | pointers to solution, indexed by level; max Vector index must be at least m_level |
void AMRNodeLevelMG::computeAMRResidual | ( | Vector< LevelData< NodeFArrayBox > * > & | a_phiLevel, | |
const Vector< LevelData< NodeFArrayBox > * > & | a_rhsLevel | |||
) |
Compute complete, 3-level residual (rhs - operator(phi)) and put it into local data m_resid.
m_resid is zeroed out and its interior nodes filled with the residual.
void AMRNodeLevelMG::upSweep | ( | Vector< LevelData< NodeFArrayBox > * > & | a_phiLevel, | |
const Vector< LevelData< NodeFArrayBox > * > & | a_rhsLevel | |||
) |
Sweep up multigrid V-cycle.
We modify a_phiLevel[m_level] by replacing it with m_phiSave plus a correction.
In succession:
void AMRNodeLevelMG::downSweep | ( | Vector< LevelData< NodeFArrayBox > * > & | a_phiLevel, | |
const Vector< LevelData< NodeFArrayBox > * > & | a_rhsLevel | |||
) |
Sweep down multigrid V-cycle.
We modify a_phiLevel[m_level] by incrementing it by a correction. In succession:
As a side effect, if there is a coarser level, we modify a_phiLevel[m_level-1] by:
Real AMRNodeLevelMG::computeNorm | ( | const LevelData< NodeFArrayBox > & | a_mfinput, | |
int | a_normType | |||
) | const [protected] |
Returns norm of input.
a_mfinput | input variable |
a_normType | type of norm, or 0 for max norm |
void AMRNodeLevelMG::smooth | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [protected] |
Use short V-cycle or NodeLevelMG's smoother to reduce high wave numbers of residual.
a_phi | solution at this level |
a_rhs | right-hand side at this level |
void AMRNodeLevelMG::projectFineInterior | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_phiFine | |||
) | [protected] |
Project a_phiFine at coarse interior nodes to a_phi.
void AMRNodeLevelMG::clearMemory | ( | ) | [protected] |
Delete internal memory and set pointers to NULL.
void AMRNodeLevelMG::setDefaultValues | ( | ) | [protected] |
Set default values. Does not deal with memory.
AMRNodeLevelMG& AMRNodeLevelMG::operator= | ( | const AMRNodeLevelMG & | ) | [private] |
friend class AMRNodeSolver [friend] |
const AMRNodeSolver* AMRNodeLevelMG::m_parent [protected] |
the boss
NodeLevelMG AMRNodeLevelMG::m_levelMG [protected] |
NodeLevelMG level solver object to relax on this level
NodeMGInterp AMRNodeLevelMG::m_mginterp [protected] |
for interpolation
bool AMRNodeLevelMG::m_isDefined [protected] |
has this AMRNodeLevelMG been defined yet?
bool AMRNodeLevelMG::m_verbose [protected] |
flag for verbose output
DisjointBoxLayout AMRNodeLevelMG::m_coarsenedGrids [protected] |
the grids at this level, coarsened
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_resid [protected] |
residual
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_corr [protected] |
correction
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_dcorr [protected] |
the infamous correction to the correction
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_LofPhi [protected] |
L(phi) on this level
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_phiSave [protected] |
extra copy of solution
LevelData<NodeFArrayBox> AMRNodeLevelMG::m_residCoarsened [protected] |
coarsened residual, on m_coarsenedGrids
int AMRNodeLevelMG::m_level [protected] |
index of this level
Real AMRNodeLevelMG::m_dx [protected] |
mesh spacing at this level
NodeLevelOp* AMRNodeLevelMG::m_levelOpPtr [protected] |
pointer to operator
NodeCoarseAverage AMRNodeLevelMG::m_averageOp [protected] |
pointer to coarsening operator
ProblemDomain AMRNodeLevelMG::m_domain [protected] |
CELL-centered physical domain at this level
DisjointBoxLayout AMRNodeLevelMG::m_finerGrids [protected] |
the grids at the next finer level
the grids at the next finer level, coarsened
LayoutData< Vector<IntVectSet> > AMRNodeLevelMG::m_IVSV [protected] |
interior boundary nodes of grids at this level
LayoutData< Vector<IntVectSet> > AMRNodeLevelMG::m_IVSVext [protected] |
exterior boundary nodes of grids at this level
LayoutData< Vector<IntVectSet> > AMRNodeLevelMG::m_IVSVcoarsened [protected] |
interior boundary nodes of the coarsened grids at this level
LayoutData< Vector<IntVectSet> > AMRNodeLevelMG::m_IVSVcoarsenedFine [protected] |
interior boundary nodes of the coarsened grids at next finer level