class AMRSolver

Class which manages grid hierarchy and composite elliptic solution

Inheritance:

AMRSolver


public members:

AMRSolver()
AMRSolver(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 LevelOp * const a_opin, int ncomp = 1)
AMRSolver(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 LevelOp * const a_opin, int ncomp = 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 LevelOp * const a_opin, int 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 LevelOp * const a_opin, int ncomp=1)
~AMRSolver()
bool isDefined() const
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 <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel)
Solves on hierarchy to tolerance m_tolerance
void AMRVCycleMG( Vector <LevelData< FArrayBox > *>& a_corrLevel, const Vector <LevelData< FArrayBox > *>& a_residLevel)
Vector <Real> computeResidualNorm( Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, int normNtype)
Vector <Real> computeResidualNorm( Vector <LevelData< FArrayBox > *>& a_residLevel, Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, int normNtype)
void computeAMRResidual( Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, LevelData< FArrayBox > & res, int ilev)
void applyAMROperator( Vector <LevelData< FArrayBox > *>& a_phiLevel, LevelData< FArrayBox >& a_LofPhi, int a_ilev)
void applyAMROperatorHphys( Vector <LevelData< FArrayBox > *>& a_phiLevel, LevelData< FArrayBox >& a_LofPhi, int a_ilev)
void setVerbose(bool a_verbose)

Documentation

AMRSolver 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.
AMRSolver ()
Creates a AMRSolver whose internal state is undefined. Need to call define(...) function to use any of the functionality of the class

AMRSolver (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 LevelOp * const a_opin, int ncomp = 1)
Creates a fully-defined AMRSolver. Calls define function with identical arguments

AMRSolver (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 LevelOp * const a_opin, int ncomp = 1)
Creates a fully-defined AMRSolver. Calls define function with identical arguments

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 LevelOp * const a_opin, int ncomp=1)
Defines AMRSolvers' internal state
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.
ref_ratio--- The refinement ratio between all levels. ref_ratio[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 LevelSolver.
opin_a The levelop to use in the solution.

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 LevelOp * const a_opin, int ncomp=1)
Defines AMRSolvers' internal state
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.
ref_ratio--- The refinement ratio between all levels. ref_ratio[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 LevelSolver.
opin_a The levelop to use in the solution.

bool isDefined () const
Returns true if full define function has been called.

void setNumSmoothUp (int a_numSmoothUp)
Set number of multigrid smoothings on way up v-cycle. Default is 4

void setNumSmoothDown (int a_numSmoothDown)
Set number of multigrid smoothings on way down v-cycle; Default is 4.

void setTolerance (Real a_tolerance)
Set tolerance of iterative solution. Default is 1.0e-10. *

void 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 setMaxIter (int a_maxIter)
Set max number of iterations. Default is 42. *

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

void solveAMR ( Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel)
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.
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.
Outputs:
phiLevel - LevelData<FArrayBox>s pointed to for levels lMin,...,lMax are updated in place.

void AMRVCycleMG ( Vector <LevelData< FArrayBox > *>& a_corrLevel, const Vector <LevelData< FArrayBox > *>& a_residLevel)
Does one relaxation V-cycle using a MG solver. Problem is assumed to already be in residual-correction form.
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.
Outputs:
corrLevel - LevelData<FArrayBox>s pointed to for levels lMin,...,lMax are updated in place.

Vector <Real> computeResidualNorm ( Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, int normNtype)
Calculate norm of multilevel residual on levels lBase to lmax. Does not include data covered by finer levels.

Vector <Real> computeResidualNorm ( Vector <LevelData< FArrayBox > *>& a_residLevel, Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, int normNtype)
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.

void computeAMRResidual ( Vector <LevelData< FArrayBox > *>& a_phiLevel, const Vector <LevelData< FArrayBox > *>& a_rhsLevel, LevelData< FArrayBox > & res, int ilev)
Calculate multilevel residual on level ilev.

void applyAMROperator ( Vector <LevelData< FArrayBox > *>& a_phiLevel, LevelData< FArrayBox >& a_LofPhi, int a_ilev)
Calculate multilevel L(phi). includes refluxing and all that This is the three-level operator.

void applyAMROperatorHphys ( Vector <LevelData< FArrayBox > *>& a_phiLevel, LevelData< FArrayBox >& 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.

void setVerbose (bool a_verbose)
set whether the solver does i/o while solving. default is true


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.

It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.

This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.