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

GenAMRSolver< T > Class Template Reference

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

#include <GenAMRSolver.H>

Collaboration diagram for GenAMRSolver< T >:

Collaboration graph
[legend]
List of all members.

Public Methods

 GenAMRSolver ()
 GenAMRSolver (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 GenAMRLevelMGOp< T > *const a_opin, int a_ncomp=1)
 GenAMRSolver (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 GenAMRLevelMGOp< T > *const a_opin, int a_ncomp=1)
 ~GenAMRSolver ()
bool isDefined () const
 has full define function been called?

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 GenAMRLevelMGOp< T > *const a_opin, int a_ncomp=1)
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 GenAMRLevelMGOp< T > *const a_opin, int a_ncomp=1)
void setNumSmoothUp (int a_numSmoothUp)
void setNumSmoothDown (int a_numSmoothDown)
void setTolerance (Real a_tolerance)
void setOperatorTolerance (Real a_operatorTolerance)
void setMaxIter (int a_maxIter)
void setMinIter (int a_minIter)
void setNumVCyclesBottom (int a_numVCycleBottom)
void solveAMR (Vector< T * > &a_phiLevel, const Vector< T * > &a_rhsLevel)
 Solves on hierarchy to tolerance m_tolerance.

void AMRVCycleMG (Vector< T * > &a_corrLevel, const Vector< T * > &a_residLevel)
Vector< RealcomputeResidualNorm (Vector< T * > &a_phiLevel, const Vector< T * > &a_rhsLevel, int a_normType)
Vector< RealcomputeResidualNorm (Vector< T * > &a_residLevel, Vector< T * > &a_phiLevel, const Vector< T * > &a_rhsLevel, int a_normType)
void computeAMRResidual (Vector< T * > &a_phiLevel, const Vector< T * > &a_rhsLevel, T &a_res, int a_ilev)
void applyAMROperator (Vector< T * > &a_phiLevel, T &a_LOfPhi, int a_ilev)
void applyAMROperatorHphys (Vector< T * > &a_phiLevel, T &a_LOfPhi, int a_ilev)
void setVerbose (bool a_verbose)

Protected Methods

void setDefaultValues ()
void clear ()

Protected Attributes

Real m_errorTolerance
Real m_tolerance
Real m_operatorTolerance
int m_numLevels
int m_finestLevel
Vector< int > m_refRatio
Vector< Realm_dxLevel
Vector< DisjointBoxLayoutm_gridsLevel
Vector< ProblemDomainm_domainLevel
int m_maxIter
int m_minIter
int m_numSmoothUp
int m_numVCyclesBottom
int m_numSmoothDown
Vector< GenAMRLevelMG< T > * > m_amrmgLevel
bool m_isDefined
GenLevelSolver< T > m_levelSolver
int m_lBase
int m_ncomp
bool m_verbose

Private Methods

 GenAMRSolver (const GenAMRSolver< T > &)
void operator= (const GenAMRSolver< T > &)

Friends

class GenAMRLevelMG< T >

Detailed Description

template<class T>
class GenAMRSolver< T >

Class which manages grid hierarchy and composite elliptic solution.

GenAMRSolver 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

template<class T>
GenAMRSolver< T >::GenAMRSolver  
 

Creates a GenAMRSolver whose internal state is undefined. Need to call define(...) function to use any of the functionality of the class

template<class T>
GenAMRSolver< T >::GenAMRSolver 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 GenAMRLevelMGOp< T > *const    a_opin,
int    a_ncomp = 1
 

Creates a fully-defined GenAMRSolver. Calls define function with identical arguments

template<class T>
GenAMRSolver< T >::GenAMRSolver 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 GenAMRLevelMGOp< T > *const    a_opin,
int    a_ncomp = 1
 

Creates a fully-defined GenAMRSolver. Calls define function with identical arguments

template<class T>
GenAMRSolver< T >::~GenAMRSolver  
 

template<class T>
GenAMRSolver< T >::GenAMRSolver const GenAMRSolver< T > &    [inline, private]
 


Member Function Documentation

template<class T>
void GenAMRSolver< T >::AMRVCycleMG Vector< T * > &    a_corrLevel,
const Vector< T * > &    a_residLevel
 

Does one relaxation V-cycle using a MG solver. Problem is assumed to already be in residual-correction form. \ {\bf Inputs:} \ corrLevel - pointers to current guess at the correction values for levels lMin = max(lBase-1,0) ... lMax. Vector index corresponds to level number. \ residLevel - pointers to AMR residual for levels lMin ... lMax. Vector index corresponds to level number. \{\bf Outputs:} \ corrLevel - Ts pointed to for levels lMin,...,lMax are updated in place.

template<class T>
void GenAMRSolver< T >::applyAMROperator Vector< T * > &    a_phiLevel,
T &    a_LOfPhi,
int    a_ilev
 

Calculate multilevel L(phi). includes refluxing and all that This is the three-level operator.

template<class T>
void GenAMRSolver< T >::applyAMROperatorHphys Vector< T * > &    a_phiLevel,
T &    a_LOfPhi,
int    a_ilev
 

Calculate multilevel L(phi) with homogeneous physical BCs (but with inhomogeneous C/F BCs). includes refluxing and all that This is the three-level operator.

template<class T>
void GenAMRSolver< T >::clear   [protected]
 

template<class T>
void GenAMRSolver< T >::computeAMRResidual Vector< T * > &    a_phiLevel,
const Vector< T * > &    a_rhsLevel,
T &    a_res,
int    a_ilev
 

Calculate multilevel residual on level ilev.

template<class T>
Vector< Real > GenAMRSolver< T >::computeResidualNorm Vector< T * > &    a_residLevel,
Vector< T * > &    a_phiLevel,
const Vector< T * > &    a_rhsLevel,
int    a_normType
 

Calculate norm of multilevel residual on levels lBase to lmax. Does not include data covered by finer levels. Also returns residual in argument a_residLevel.

template<class T>
Vector< Real > GenAMRSolver< T >::computeResidualNorm Vector< T * > &    a_phiLevel,
const Vector< T * > &    a_rhsLevel,
int    a_normType
 

Calculate norm of multilevel residual on levels lBase to lmax. Does not include data covered by finer levels.

template<class T>
void GenAMRSolver< T >::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 GenAMRLevelMGOp< T > *const    a_opin,
int    a_ncomp = 1
 

Defines GenAMRSolvers' internal state \ {\bf Inputs:} \ gridsLevel --- The grids at all levels. Each element in the vector is a level's worth of grids. gridsLevel[0] are grids for level 0 and so forth. Vector index corresponds to level number. \ domainLevel --- The domains at all levels. Each element in the vector is a level's domain. domainLevel[0] is the domain for level 0 and so forth. Vector index corresponds to level number. \ dxLevel --- The grid spacing at all levels. Each element in the vector is a level's $\dx$. dxLevel[0]--- is $\dx$ for level 0 and so forth. Vector index corresponds to level number. \ refRatio--- The refinement ratio between all levels. refRatio[0] is the refinement ratio between level 0 and level 1; Vector index corresponds to level number. \ numlevels The number of AMR levels in the calculation. The length of the Vector~s has to be at least numlevels. \ lBase - 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 GenLevelSolver. \ a_opin The levelop to use in the solution.

template<class T>
void GenAMRSolver< T >::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 GenAMRLevelMGOp< T > *const    a_opin,
int    a_ncomp = 1
 

Defines GenAMRSolvers' internal state \ {\bf Inputs:} \ gridsLevel --- The grids at all levels. Each element in the vector is a level's worth of grids. gridsLevel[0] are grids for level 0 and so forth. Vector index corresponds to level number. \ domainLevel --- The domains at all levels. Each element in the vector is a level's domain. domainLevel[0] is the domain for level 0 and so forth. Vector index corresponds to level number. \ dxLevel --- The grid spacing at all levels. Each element in the vector is a level's $\dx$. dxLevel[0]--- is $\dx$ for level 0 and so forth. Vector index corresponds to level number. \ refRatio--- The refinement ratio between all levels. refRatio[0] is the refinement ratio between level 0 and level 1; Vector index corresponds to level number. \ numlevels The number of AMR levels in the calculation. The length of the Vector~s has to be at least numlevels. \ lBase - 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 GenLevelSolver. \ a_opin The levelop to use in the solution.

template<class T>
bool GenAMRSolver< T >::isDefined   const
 

has full define function been called?

Returns true if full define function has been called.

template<class T>
void GenAMRSolver< T >::operator= const GenAMRSolver< T > &    [inline, private]
 

template<class T>
void GenAMRSolver< T >::setDefaultValues   [protected]
 

template<class T>
void GenAMRSolver< T >::setMaxIter int    a_maxIter
 

Set max number of iterations. Default is 42.

template<class T>
void GenAMRSolver< T >::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.

template<class T>
void GenAMRSolver< T >::setNumSmoothDown int    a_numSmoothDown
 

Set number of multigrid smoothings on way down v-cycle; Default is 4.

template<class T>
void GenAMRSolver< T >::setNumSmoothUp int    a_numSmoothUp
 

Set number of multigrid smoothings on way up v-cycle. Default is 4

template<class T>
void GenAMRSolver< T >::setNumVCyclesBottom int    a_numVCycleBottom
 

Set the number of v-cycles performed from the base level to the maximum coarsening of the base level during one overall v-cycle on the AMR hierarchy. Default is 1.

template<class T>
void GenAMRSolver< T >::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.

template<class T>
void GenAMRSolver< T >::setTolerance Real    a_tolerance
 

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

template<class T>
void GenAMRSolver< T >::setVerbose bool    a_verbose
 

set whether the solver does i/o while solving. default is true

template<class T>
void GenAMRSolver< T >::solveAMR Vector< T * > &    a_phiLevel,
const Vector< T * > &    a_rhsLevel
 

Solves on hierarchy to tolerance m_tolerance.

Solves the elliptic equation over the hierarchy of levels lBase ... lMax where $lMax = numlevels-1$. If lBase > 0, then the data at level lBase - 1 is used to interpolate boundary conditions at boundary cells that are not adjacent to the domain boundary. \{\bf Inputs:} \ phiLevel - pointers to current guess at the solution values for levels (lMin = max(lBase-1,0)) ... lMax. Vector index corresponds to level number. \ rhsLevel - pointers to right-hand side for levels lmin ... lMax. Vector index corresponds to level number. \{\bf Outputs:} \ phiLevel - Ts pointed to for levels lMin,...,lMax are updated in place.


Friends And Related Function Documentation

template<class T>
friend class GenAMRLevelMG< T > [friend]
 


Member Data Documentation

template<class T>
Vector<GenAMRLevelMG<T> *> GenAMRSolver< T >::m_amrmgLevel [protected]
 

template<class T>
Vector<ProblemDomain> GenAMRSolver< T >::m_domainLevel [protected]
 

template<class T>
Vector<Real> GenAMRSolver< T >::m_dxLevel [protected]
 

template<class T>
Real GenAMRSolver< T >::m_errorTolerance [protected]
 

template<class T>
int GenAMRSolver< T >::m_finestLevel [protected]
 

template<class T>
Vector<DisjointBoxLayout> GenAMRSolver< T >::m_gridsLevel [protected]
 

template<class T>
bool GenAMRSolver< T >::m_isDefined [protected]
 

template<class T>
int GenAMRSolver< T >::m_lBase [protected]
 

template<class T>
GenLevelSolver<T> GenAMRSolver< T >::m_levelSolver [protected]
 

template<class T>
int GenAMRSolver< T >::m_maxIter [protected]
 

template<class T>
int GenAMRSolver< T >::m_minIter [protected]
 

template<class T>
int GenAMRSolver< T >::m_ncomp [protected]
 

template<class T>
int GenAMRSolver< T >::m_numLevels [protected]
 

template<class T>
int GenAMRSolver< T >::m_numSmoothDown [protected]
 

template<class T>
int GenAMRSolver< T >::m_numSmoothUp [protected]
 

template<class T>
int GenAMRSolver< T >::m_numVCyclesBottom [protected]
 

template<class T>
Real GenAMRSolver< T >::m_operatorTolerance [protected]
 

template<class T>
Vector<int> GenAMRSolver< T >::m_refRatio [protected]
 

template<class T>
Real GenAMRSolver< T >::m_tolerance [protected]
 

template<class T>
bool GenAMRSolver< T >::m_verbose [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Apr 16 14:35:18 2003 for EBChombo by doxygen1.2.16