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

LevelSolver Class Reference

Solves elliptic equations on a level. More...

#include <LevelSolver.H>

Inheritance diagram for LevelSolver:

Inheritance graph
[legend]
Collaboration diagram for LevelSolver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LevelSolver ()
 Null constructor, leaves LevelSolver undefined.

virtual ~LevelSolver ()
 Destructor.

 LevelSolver (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_baseGrids, const ProblemDomain &a_domain, Real a_dxLevel, int a_nRefCrse, const LevelOp *const a_opin, int a_ncomp, bool a_limitCoarsening=false)
 Full constructor. Calls full define function.

 LevelSolver (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_baseGrids, const Box &a_domain, Real a_dxLevel, int a_nRefCrse, const LevelOp *const a_opin, int a_ncomp=1, bool a_limitCoarsening=false)
 Full constructor (Deprecated -- use ProblemDomain instead).

virtual void define (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_baseGrids, const ProblemDomain &a_domain, Real a_dxLevel, int a_nRefCrse, const LevelOp *const a_opin, int a_ncomp=1, bool a_limitCoarsening=false)
 Full define function.

virtual void define (const DisjointBoxLayout &a_grids, const DisjointBoxLayout *a_baseGrids, const Box &a_domain, Real a_dxLevel, int a_nRefCrse, const LevelOp *const a_opin, int a_ncomp=1, bool a_limitCoarsening=false)
 Full define function. (Deprecated -- use ProblemDomain version instead).

bool isDefined () const
 Has this object been defined already?

void clearMemory ()
 Clears storage.

void setDefaultValues ()
 Internal use function to set default values for solver parameters.

void levelSolveH (LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_initializePhiToZero=true)
 Do a level solve with homogeneous BCs on this level using multigrid.

void levelSolve (LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > *a_phic, const LevelData< FArrayBox > &a_rhs, bool a_initializePhiToZero=true)
 Do a level solve with inhomogeneous BCs on this level using multigrid.

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 solution tolerance.

void setOperatorTolerance (Real a_operatorTolerance)
 Set "operator tolerance" of iterative solution.

void setVerbose (bool a_verbose)
 Set how much info is printed out during solve.

void setMaxIter (int a_maxIter)
 Set max number multigrid vcycles to use in solution.

void setMinIter (int a_minIter)
 Set min number of iterations.

virtual void setConvergenceMetric (Real a_metric, int a_comp)
 set the convergence metrics (if appropriate) for this problem

virtual void resetConvergenceMetrics ()
 rest the convergence metrics to an undefined state (for solver re-use)


Protected Attributes

LevelMG m_levelMG
LevelOpm_levelOpPtr
bool m_isDefined
DisjointBoxLayout m_grids
ProblemDomain m_domain
LevelData< FArrayBoxm_resid
LevelData< FArrayBoxm_scratch
LevelData< FArrayBoxm_corr
int m_nRefCrse
Real m_dxLevel
int m_maxIter
int m_minIter
int m_numSmoothUp
int m_numSmoothDown
Real m_tolerance
Vector< Realm_convergenceMetrics
Real m_operatorTolerance
bool m_verbose

Detailed Description

Solves elliptic equations on a level.

LevelSolver Solves elliptic equations on a level using multigrid.


Constructor & Destructor Documentation

LevelSolver::LevelSolver  ) 
 

Null constructor, leaves LevelSolver undefined.

virtual LevelSolver::~LevelSolver  )  [virtual]
 

Destructor.

LevelSolver::LevelSolver const DisjointBoxLayout a_grids,
const DisjointBoxLayout a_baseGrids,
const ProblemDomain a_domain,
Real  a_dxLevel,
int  a_nRefCrse,
const LevelOp *const  a_opin,
int  a_ncomp,
bool  a_limitCoarsening = false
 

Full constructor. Calls full define function.

Calls corresponding full define function.

Inputs:

  • a_grids: Grid on which solution will be computed.
  • a_baseGrids: pointer to next coarser grids. Should be == NULL if there is no coarser level.
  • a_domain: domain of solution level
  • a_dxLevel: grid spacing at solution level
  • a_nRefCrse: refinement ratio between two levels. Not used if there is no finer level
  • a_opin: operator L used in solution of Lphi = rho
  • a_limitCoarsening: if true, only do multigrid coarsening down to next coarser AMR level (only coarsen by a_nRefCrse). If false, coarsen as far as possible.

LevelSolver::LevelSolver const DisjointBoxLayout a_grids,
const DisjointBoxLayout a_baseGrids,
const Box a_domain,
Real  a_dxLevel,
int  a_nRefCrse,
const LevelOp *const  a_opin,
int  a_ncomp = 1,
bool  a_limitCoarsening = false
 

Full constructor (Deprecated -- use ProblemDomain instead).

Calls corresponding full define function.

Inputs:

  • a_grids: Grid on which solution will be computed.
  • a_baseGrids: pointer to next coarser grids. Should be == NULL if there is no coarser level.
  • a_domain: domain of solution level
  • a_dxLevel: grid spacing at solution level
  • a_nRefCrse: refinement ratio between two levels. Not used if there is no finer level
  • a_opin: operator L used in solution of Lphi = rho
  • a_limitCoarsening: if true, only do multigrid coarsening down to next coarser AMR level (only coarsen by a_nRefCrse). If false, coarsen as far as possible.


Member Function Documentation

void LevelSolver::clearMemory  ) 
 

Clears storage.

virtual void LevelSolver::define const DisjointBoxLayout a_grids,
const DisjointBoxLayout a_baseGrids,
const Box a_domain,
Real  a_dxLevel,
int  a_nRefCrse,
const LevelOp *const  a_opin,
int  a_ncomp = 1,
bool  a_limitCoarsening = false
[virtual]
 

Full define function. (Deprecated -- use ProblemDomain version instead).

Inputs:

  • a_grids: Grid on which solution will be computed.
  • a_baseGrids: pointer to next coarser grids. Should be == NULL if there is no coarser level.
  • a_domain: domain of solution level
  • a_dxLevel: grid spacing at solution level
  • a_nRefCrse: refinement ratio between two levels. Not used if there is no finer level
  • a_opin: operator L used in solution of Lphi = rho
  • a_limitCoarsening: if true, only do multigrid coarsening down to next coarser AMR level (only coarsen by a_nRefCrse). If false, coarsen as far as possible.

Reimplemented in LevelHelmholtzSolver.

virtual void LevelSolver::define const DisjointBoxLayout a_grids,
const DisjointBoxLayout a_baseGrids,
const ProblemDomain a_domain,
Real  a_dxLevel,
int  a_nRefCrse,
const LevelOp *const  a_opin,
int  a_ncomp = 1,
bool  a_limitCoarsening = false
[virtual]
 

Full define function.

Inputs:

  • a_grids: Grid on which solution will be computed.
  • a_baseGrids: pointer to next coarser grids. Should be == NULL if there is no coarser level.
  • a_domain: domain of solution level
  • a_dxLevel: grid spacing at solution level
  • a_nRefCrse: refinement ratio between two levels. Not used if there is no finer level
  • a_opin: operator L used in solution of Lphi = rho
  • a_limitCoarsening: if true, only do multigrid coarsening down to next coarser AMR level (only coarsen by a_nRefCrse). If false, coarsen as far as possible.

Reimplemented in LevelHelmholtzSolver.

bool LevelSolver::isDefined  )  const
 

Has this object been defined already?

void LevelSolver::levelSolve LevelData< FArrayBox > &  a_phi,
const LevelData< FArrayBox > *  a_phic,
const LevelData< FArrayBox > &  a_rhs,
bool  a_initializePhiToZero = true
 

Do a level solve with inhomogeneous BCs on this level using multigrid.

Uses inhomogeneous bcs at interfaces. phic should be set to NULL if there is no coarser level.

Parameters:
a_phi  initial guess at solution, returns solution
a_phic  solution at next coarser level
a_rhs  right-hand side
a_initializePhiToZero  if true, set phi to 0 at start (o/w use initial guess)

void LevelSolver::levelSolveH LevelData< FArrayBox > &  a_phi,
const LevelData< FArrayBox > &  a_rhs,
bool  a_initializePhiToZero = true
 

Do a level solve with homogeneous BCs on this level using multigrid.

Uses homogeneous bcs at coarse/fine interfaces

Parameters:
a_phi  initial guess at solution, returns solution
a_rhs  right-hand side
a_initializePhiToZero  if true, set phi to 0 at start (o/w use initial guess)

virtual void LevelSolver::resetConvergenceMetrics  )  [virtual]
 

rest the convergence metrics to an undefined state (for solver re-use)

virtual void LevelSolver::setConvergenceMetric Real  a_metric,
int  a_comp
[virtual]
 

set the convergence metrics (if appropriate) for this problem

sets metric against which we define convergence (for example, the norm of the RHS). Also passes a_metric through to the LevelMG (and eventually to a bottom solver.)

void LevelSolver::setDefaultValues  ) 
 

Internal use function to set default values for solver parameters.

void LevelSolver::setMaxIter int  a_maxIter  ) 
 

Set max number multigrid vcycles to use in solution.

void LevelSolver::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 LevelSolver::setNumSmoothDown int  a_numSmoothDown  ) 
 

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

void LevelSolver::setNumSmoothUp int  a_numSmoothUp  ) 
 

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

void LevelSolver::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 LevelSolver::setTolerance Real  a_tolerance  ) 
 

Set solution tolerance.

void LevelSolver::setVerbose bool  a_verbose  ) 
 

Set how much info is printed out during solve.


Member Data Documentation

Vector<Real> LevelSolver::m_convergenceMetrics [protected]
 

metrics used to judge convergence

LevelData<FArrayBox> LevelSolver::m_corr [protected]
 

Correction

ProblemDomain LevelSolver::m_domain [protected]
 

Problem domain at this level

Real LevelSolver::m_dxLevel [protected]
 

Cell spacing on this level

DisjointBoxLayout LevelSolver::m_grids [protected]
 

Grids at this level

bool LevelSolver::m_isDefined [protected]
 

Has this LevelSolver been defined yet?

LevelMG LevelSolver::m_levelMG [protected]
 

LevelMG level solver object to relax on this level

LevelOp* LevelSolver::m_levelOpPtr [protected]
 

LevelMG level solver object to relax on this level

int LevelSolver::m_maxIter [protected]
 

Maximum number of solver iterations

int LevelSolver::m_minIter [protected]
 

Minimum number of iterations

int LevelSolver::m_nRefCrse [protected]
 

Refinement ratio to coarser level

int LevelSolver::m_numSmoothDown [protected]
 

Number of smoother iterations on down cycle

int LevelSolver::m_numSmoothUp [protected]
 

Number of smoother iterations on up cycle

Real LevelSolver::m_operatorTolerance [protected]
 

Tolerance used to stop solver iteration if convergence hangs.

LevelData<FArrayBox> LevelSolver::m_resid [protected]
 

Residual

LevelData<FArrayBox> LevelSolver::m_scratch [protected]
 

Useful scratch space.

Real LevelSolver::m_tolerance [protected]
 

Solver tolerance

bool LevelSolver::m_verbose [protected]
 

How verbose shold the solve be?


The documentation for this class was generated from the following file:
Generated on Wed Jun 2 13:58:45 2004 for Chombo&INSwithParticles by doxygen 1.3.2