#include <AMRNodeSolver.H>
Collaboration diagram for AMRNodeSolver:

Public Methods | |
| AMRNodeSolver () | |
| {\bf constructors, destructor and defines} | |
| AMRNodeSolver (const Vector< DisjointBoxLayout > &a_gridsLevel, const Vector< ProblemDomain > &a_domainLevel, const Vector< Real > &a_dxLevel, const Vector< int > &a_refRatio, int a_numLevels, int a_lBase, const NodeMaskLevelOp *const a_opin, int a_minLength=1) | |
| AMRNodeSolver (const Vector< DisjointBoxLayout > &a_gridsLevel, const Vector< Box > &a_domainLevel, const Vector< Real > &a_dxLevel, const Vector< int > &a_refRatio, int a_numLevels, int a_lBase, const NodeMaskLevelOp *const a_opin, int a_minLength=1) | |
| ~AMRNodeSolver () | |
| void | define (const Vector< DisjointBoxLayout > &a_gridsLevel, const Vector< ProblemDomain > &a_domainLevel, const Vector< Real > &a_dxLevel, const Vector< int > &a_refRatio, int a_numLevels, int a_lBase, const NodeMaskLevelOp *const a_opin, int a_minLength=1) |
| void | define (const Vector< DisjointBoxLayout > &a_gridsLevel, const Vector< Box > &a_domainLevel, const Vector< Real > &a_dxLevel, const Vector< int > &a_refRatio, int a_numLevels, int a_lBase, const NodeMaskLevelOp *const a_opin, int a_minLength=1) |
| bool | isDefined () const |
| {\bf access functions} | |
| void | setNumSmoothUp (int a_numSmoothUp) |
| {\bf parameter-setting functions} | |
| void | setNumSmoothDown (int a_numSmoothDown) |
| void | setNumBottomGSRB (int a_numBottomGSRB) |
| void | setTolerance (Real a_tolerance) |
| void | setBottomSmoothing (bool a_doBottomSmooth) |
| void | setBottomTolerance (Real a_tolerance) |
| void | setOperatorTolerance (Real a_operatorTolerance) |
| void | setMaxIter (int a_maxIter) |
| void | setMinIter (int a_minIter) |
| void | setBottomMaxIter (int a_maxIter) |
| void | setVerbose (bool a_verbose) |
| void | solveAMR (Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel) |
| {\bf data modification functions} | |
| void | AMRVCycleMG (Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel) |
| Real | computeResidualNorm (int a_normType) |
| void | computeAMRResidual (LevelData< NodeFArrayBox > &a_res, Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel, int a_ilev) |
| void | applyAMROperator (LevelData< NodeFArrayBox > &a_lofPhi, Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, int a_ilev) |
Protected Methods | |
| void | setDefaultValues () |
| void | clear () |
Protected Attributes | |
| Real | m_tolerance |
| Real | m_operatorTolerance |
| int | m_lBase |
| int | m_numLevels |
| int | m_finestLevel |
| Vector< int > | m_refRatio |
| Vector< Real > | m_dxLevel |
| Vector< DisjointBoxLayout > | m_gridsLevel |
| Vector< ProblemDomain > | m_domainLevel |
| int | m_maxIter |
| int | m_minIter |
| int | m_numSmoothUp |
| int | m_numSmoothDown |
| int | m_numBottomGSRB |
| Vector< AMRNodeLevelMG * > | m_amrmgLevel |
| bool | m_isDefined |
| LevelNodeSolver | m_levelSolver |
| bool | m_verbose |
Friends | |
| class | AMRNodeLevelMG |
AMRNodeSolver manages the AMR/multigrid solution to the elliptic equation on a multiple level grid that satisfies certain proper nesting conditions. It can be used either as a solver, or to apply the AMR / multigrid V-cycle as a preconditioner for some other iterative method, such as a Krylov method.
|
|
{\bf constructors, destructor and defines} Creates a AMRNodeSolver whose internal state is undefined. Need to call define(...) function to use any of the functionality of the class. |
|
||||||||||||||||||||||||||||||||||||
|
Creates a fully-defined AMRNodeSolver. Calls {\bf define} function with identical arguments. |
|
||||||||||||||||||||||||||||||||||||
|
|
|
|
Destructor. |
|
||||||||||||
|
Does one relaxation V-cycle using a multigrid solver. {\bf Arguments:}\ a_phiLevel (modified): pointers to current guess at the solution values for levels lMin = max(m_lBase-1,0) ... m_finestLevel. Vector index corresponds to level number. These values are updated in place.\ a_rhsLevel (not modified): pointers to right-hand side for levels lMin ... m_finestLevel. |
|
||||||||||||||||
|
Calculate multilevel L(phi) at level a_ilev. This is the three-level operator. {\bf Arguments:}\ a_lofPhi (modified): L(phi) result of evaluation at level a_ilev.\ a_phiLevel (modified): Vector of pointers to phi, indexed by level. We modify a_phiLevel[a_ilev] by (a) projecting down from interior coarse nodes of a_phiLevel[a_ilev+1], if this finer level exists; (b) interpolating from a_phiLevel[a_ilev-1] at the coarse/fine boundary, if this coarser level exists; (c) applying the physical boundary conditions.\ a_ilev (not modified): the level at which the operator is evaluated.\ |
|
|
|
|
||||||||||||||||||||
|
Calculate residual on level a_ilev using the multilevel operator. {\bf Arguments:}\ a_res (modified): residual, rhs - L(phi), at level a_ilev.\ a_phiLevel (modified): Vector of pointers to phi, indexed by level. We modify a_phiLevel[a_ilev] by (a) projecting down from interior coarse nodes of a_phiLevel[a_ilev+1], if this finer level exists; (b) interpolating from a_phiLevel[a_ilev-1] at the coarse/fine boundary, if this coarser level exists; (c) applying the physical boundary conditions.\ a_rhsLevel (not modified): pointers to right-hand side for levels lMin ... m_finestLevel. \ a_ilev (not modified): the level at which the operator is evaluated.\ {\bf This:}\ Residual at level a_ilev is also put into m_amrmgLevel[a_ilev]->m_resid. |
|
|
Calculate norm of multilevel residual on levels m_lBase to m_finestLevel. Does not include data covered by finer levels (not valid data). Assumes that the residual has already been computed. a_normType (not modified): the type of norm.\ |
|
||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||
|
Defines AMRNodeSolver's internal state. {\bf Arguments:}\ a_gridsLevel: the grids (cell-centered) at all levels; each element in the Vector is a level's worth of grids. Vector index corresponds to level number. \ a_domainLevel: the physical domains at all levels. \ a_dxLevel: the grid spacing at all levels.\ a_refRatio: the refinement ratios between adjacent levels. a_refRatio[0] is the refinement ratio between level 0 and level 1. \ a_numlevels: the number of AMR levels in the calculation. The length of the Vectors must be at least numlevels. \ a_lBase: index of coarsest level on which solution is to be computed. This needs to be set at the time of definition, in order to build the bottom LevelNodeSolver. \ a_opin: pointer to the NodeMaskLevelOp to use in the solution.\ a_minLength: minimum length of maximally coarsened box in LevelNodeSolver. \ |
|
|
{\bf access functions} Returns true if full define function has been called. |
|
|
Set max number of iterations for bottom solver (m_levelSolver). Default is set in LevelNodeSolver. |
|
|
Set whether bottom solver does smoothing at bottom level. Default is set in LevelNodeSolver. |
|
|
Set tolerance of bottom solver. Default is set in LevelNodeSolver. |
|
|
|
|
|
Set max number of iterations. Default is 42. |
|
|
Set min number of iterations. Only relevant when residual is not decreasing fast enough to satisfy the "operator tolerance". Default is 4. |
|
|
Set number of multigrid smoothings at bottom of V-cycle; Default == 16. |
|
|
Set number of multigrid smoothings on way down V-cycle; Default == 4. |
|
|
{\bf parameter-setting functions} Set number of multigrid smoothings on way up V-cycle; Default == 4. |
|
|
Set "operator tolerance" of iterative solution. Iteration will stop if (new_residual/old_residual) > 1-operatorTolerance (and at least minIter iterations have been performed). Default is 1.0e-5. |
|
|
Set tolerance of iterative solution. Default is 1.0e-10. |
|
|
Set whether the solver gives output while solving. Default is true. |
|
||||||||||||
|
{\bf data modification functions} Solves the elliptic equation over the hierarchy of levels m_lBase ... m_finestLevel where m_finestLevel = m_numLevels-1. \ If m_lBase > 0, then the data at level m_lBase - 1 is used to interpolate boundary conditions at boundary cells that are not adjacent to the domain boundary. \ Solves to tolerance m_tolerance. {\bf Arguments:}\ a_phiLevel (modified): pointers to current guess at the solution values for levels (lMin = max(m_lBase-1,0)) ... m_finestLevel. Vector index corresponds to level number. These values are updated in place.\ a_rhsLevel (not modified): pointers to right-hand side for levels lMin ... m_finestLevel.\ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.16