Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AMRNodeSolver Class Reference

Class which manages grid hierarchy and composite elliptic solution. More...

#include <AMRNodeSolver.H>

Collaboration diagram for AMRNodeSolver:

Collaboration graph
[legend]
List of all members.

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 NodeLevelOp *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 NodeLevelOp *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 NodeLevelOp *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 NodeLevelOp *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

Detailed Description

Class which manages grid hierarchy and composite elliptic solution.

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.


Constructor & Destructor Documentation

AMRNodeSolver::AMRNodeSolver  
 

{\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.

AMRNodeSolver::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 NodeLevelOp *const    a_opin,
int    a_minLength = 1
 

Creates a fully-defined AMRNodeSolver. Calls {\bf define} function with identical arguments.

AMRNodeSolver::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 NodeLevelOp *const    a_opin,
int    a_minLength = 1
 

AMRNodeSolver::~AMRNodeSolver  
 

Destructor.


Member Function Documentation

void AMRNodeSolver::AMRVCycleMG Vector< LevelData< NodeFArrayBox > * > &    a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &    a_rhsLevel
 

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.

void AMRNodeSolver::applyAMROperator LevelData< NodeFArrayBox > &    a_lofPhi,
Vector< LevelData< NodeFArrayBox > * > &    a_phiLevel,
int    a_ilev
 

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

void AMRNodeSolver::clear   [protected]
 

void AMRNodeSolver::computeAMRResidual LevelData< NodeFArrayBox > &    a_res,
Vector< LevelData< NodeFArrayBox > * > &    a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &    a_rhsLevel,
int    a_ilev
 

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.

Real AMRNodeSolver::computeResidualNorm int    a_normType
 

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

void AMRNodeSolver::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 NodeLevelOp *const    a_opin,
int    a_minLength = 1
 

void AMRNodeSolver::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 NodeLevelOp *const    a_opin,
int    a_minLength = 1
 

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 NodeLevelOp to use in the solution.\ a_minLength: minimum length of maximally coarsened box in LevelNodeSolver. \

bool AMRNodeSolver::isDefined   const
 

{\bf access functions}

Returns true if full define function has been called.

void AMRNodeSolver::setBottomMaxIter int    a_maxIter
 

Set max number of iterations for bottom solver (m_levelSolver). Default is set in LevelNodeSolver.

void AMRNodeSolver::setBottomSmoothing bool    a_doBottomSmooth
 

Set whether bottom solver does smoothing at bottom level. Default is set in LevelNodeSolver.

void AMRNodeSolver::setBottomTolerance Real    a_tolerance
 

Set tolerance of bottom solver. Default is set in LevelNodeSolver.

void AMRNodeSolver::setDefaultValues   [protected]
 

void AMRNodeSolver::setMaxIter int    a_maxIter
 

Set max number of iterations. Default is 42.

void AMRNodeSolver::setMinIter int    a_minIter
 

Set min number of iterations. Only relevant when residual is not decreasing fast enough to satisfy the "operator tolerance". Default is 4.

void AMRNodeSolver::setNumBottomGSRB int    a_numBottomGSRB
 

Set number of multigrid smoothings at bottom of V-cycle; Default == 16.

void AMRNodeSolver::setNumSmoothDown int    a_numSmoothDown
 

Set number of multigrid smoothings on way down V-cycle; Default == 4.

void AMRNodeSolver::setNumSmoothUp int    a_numSmoothUp
 

{\bf parameter-setting functions}

Set number of multigrid smoothings on way up V-cycle; Default == 4.

void AMRNodeSolver::setOperatorTolerance Real    a_operatorTolerance
 

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.

void AMRNodeSolver::setTolerance Real    a_tolerance
 

Set tolerance of iterative solution. Default is 1.0e-10.

void AMRNodeSolver::setVerbose bool    a_verbose
 

Set whether the solver gives output while solving. Default is true.

void AMRNodeSolver::solveAMR Vector< LevelData< NodeFArrayBox > * > &    a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &    a_rhsLevel
 

{\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.\


Friends And Related Function Documentation

friend class AMRNodeLevelMG [friend]
 


Member Data Documentation

Vector<AMRNodeLevelMG*> AMRNodeSolver::m_amrmgLevel [protected]
 

Vector<ProblemDomain> AMRNodeSolver::m_domainLevel [protected]
 

Vector<Real> AMRNodeSolver::m_dxLevel [protected]
 

int AMRNodeSolver::m_finestLevel [protected]
 

Vector<DisjointBoxLayout> AMRNodeSolver::m_gridsLevel [protected]
 

bool AMRNodeSolver::m_isDefined [protected]
 

int AMRNodeSolver::m_lBase [protected]
 

LevelNodeSolver AMRNodeSolver::m_levelSolver [protected]
 

int AMRNodeSolver::m_maxIter [protected]
 

int AMRNodeSolver::m_minIter [protected]
 

int AMRNodeSolver::m_numBottomGSRB [protected]
 

int AMRNodeSolver::m_numLevels [protected]
 

int AMRNodeSolver::m_numSmoothDown [protected]
 

int AMRNodeSolver::m_numSmoothUp [protected]
 

Real AMRNodeSolver::m_operatorTolerance [protected]
 

Vector<int> AMRNodeSolver::m_refRatio [protected]
 

Real AMRNodeSolver::m_tolerance [protected]
 

bool AMRNodeSolver::m_verbose [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue Apr 15 18:34:54 2003 for AMRNodeElliptic by doxygen1.2.16