AMRNodeLevelMG Class Reference

#include <AMRNodeLevelMG.H>

Collaboration diagram for AMRNodeLevelMG:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class which manages data and operations on a level for AMRNodeSolver.

AMRNodeLevelMG manages the operations on a level for AMRNodeSolver. AMRNodeSolver contains a vector of AMRNodeLevelMG's (one for each level). This class should be considered internal to AMRNodeSolver and should not be considered part of the Chombo API.

Public Member Functions

Constructors, destructor and defines
 AMRNodeLevelMG ()
 AMRNodeLevelMG (const AMRNodeSolver *const a_parent, int a_level, const NodeLevelOp *const a_opin)
 ~AMRNodeLevelMG ()
void define (const AMRNodeSolver *const a_parent, int a_level, const NodeLevelOp *const a_opin)
Access functions
bool isDefined () const
Real computeResidualNorm (int a_normType) const
Parameter-setting functions
void setnumSmoothUp (int a_numSmoothUp)
void setnumSmoothDown (int a_numSmoothDown)
void setVerbose (bool a_verbose)
Data modification functions
void applyAMROperator (LevelData< NodeFArrayBox > &a_Lofphi, Vector< LevelData< NodeFArrayBox > * > &a_phiLevel)
void applyAMRGradient (LevelData< NodeFArrayBox > &a_gradPhi, Vector< LevelData< NodeFArrayBox > * > &a_phiLevel)
void computeAMRResidual (Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel)
void upSweep (Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel)
void downSweep (Vector< LevelData< NodeFArrayBox > * > &a_phiLevel, const Vector< LevelData< NodeFArrayBox > * > &a_rhsLevel)

Protected Member Functions

Real computeNorm (const LevelData< NodeFArrayBox > &a_mfinput, int a_normType) const
void smooth (LevelData< NodeFArrayBox > &a_phi, const LevelData< NodeFArrayBox > &a_rhs)
void projectFineInterior (LevelData< NodeFArrayBox > &a_phi, const LevelData< NodeFArrayBox > &a_phiFine)
void clearMemory ()
void setDefaultValues ()

Protected Attributes

const AMRNodeSolverm_parent
NodeLevelMG m_levelMG
NodeMGInterp m_mginterp
bool m_isDefined
bool m_verbose
DisjointBoxLayout m_coarsenedGrids
LevelData< NodeFArrayBoxm_resid
LevelData< NodeFArrayBoxm_corr
LevelData< NodeFArrayBoxm_dcorr
LevelData< NodeFArrayBoxm_LofPhi
LevelData< NodeFArrayBoxm_phiSave
LevelData< NodeFArrayBoxm_residCoarsened
int m_level
Real m_dx
NodeLevelOpm_levelOpPtr
NodeCoarseAverage m_averageOp
ProblemDomain m_domain
DisjointBoxLayout m_finerGrids
DisjointBoxLayout m_coarsenedFineGrids
LayoutData< Vector< IntVectSet > > m_IVSV
LayoutData< Vector< IntVectSet > > m_IVSVext
LayoutData< Vector< IntVectSet > > m_IVSVcoarsened
LayoutData< Vector< IntVectSet > > m_IVSVcoarsenedFine

Private Member Functions

AMRNodeLevelMGoperator= (const AMRNodeLevelMG &)
 AMRNodeLevelMG (const AMRNodeLevelMG &)

Friends

class AMRNodeSolver


Constructor & Destructor Documentation

AMRNodeLevelMG::AMRNodeLevelMG (  ) 

Default constructor. User must subsequently call define().

AMRNodeLevelMG::AMRNodeLevelMG ( const AMRNodeSolver *const   a_parent,
int  a_level,
const NodeLevelOp *const   a_opin 
)

Constructor to define AMRNodeLevelMG from the inputs. Calls define() function with identical arguments.

AMRNodeLevelMG::~AMRNodeLevelMG (  ) 

Destructor.

AMRNodeLevelMG::AMRNodeLevelMG ( const AMRNodeLevelMG  )  [private]


Member Function Documentation

void AMRNodeLevelMG::define ( const AMRNodeSolver *const   a_parent,
int  a_level,
const NodeLevelOp *const   a_opin 
)

Define AMRNodeLevelMG from the inputs.

The AMRNodeLevelMG will only work for the input AMRNodeSolver. A NodeLevelMG is created.

Parameters:
a_parent  parent AMRNodeSolver
a_level  level in the AMR hierarchy
a_opin  pointer to operator

bool AMRNodeLevelMG::isDefined (  )  const

Returns true if this object was created with the defining constructor or if define() has been called.

Real AMRNodeLevelMG::computeResidualNorm ( int  a_normType  )  const

Compute and return norm of internal data m_resid.

Parameters:
a_normType  which norm to take, or 0 for max norm

void AMRNodeLevelMG::setnumSmoothUp ( int  a_numSmoothUp  ) 

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

void AMRNodeLevelMG::setnumSmoothDown ( int  a_numSmoothDown  ) 

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

void AMRNodeLevelMG::setVerbose ( bool  a_verbose  ) 

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

void AMRNodeLevelMG::applyAMROperator ( LevelData< NodeFArrayBox > &  a_Lofphi,
Vector< LevelData< NodeFArrayBox > * > &  a_phiLevel 
)

Complete, 3-level operator. Applies operator with inhomogeneous coarse-fine boundary conditions and inhomogeneous domain boundary conditions.

As a side effect, this function modifies a_phiLevel[m_level] by:

  • projecting down from interior coarse nodes of a_phiLevel[m_level+1], if this finer level exists;
  • interpolating from a_phiLevel[m_level-1] at the coarse/fine boundary, if this coarser level exists;
  • applying the physical boundary conditions.
Parameters:
a_Lofphi  L(phi) result of evaluation at level m_level
a_phiLevel  pointers to solution, indexed by level; max Vector index must be at least m_level

void AMRNodeLevelMG::applyAMRGradient ( LevelData< NodeFArrayBox > &  a_gradPhi,
Vector< LevelData< NodeFArrayBox > * > &  a_phiLevel 
)

Complete, 3-level gradient. Finds gradient with inhomogeneous coarse-fine boundary conditions and inhomogeneous domain boundary conditions.

As a side effect, this function modifies a_phiLevel[m_level] by:

  • projecting down from interior coarse nodes of a_phiLevel[m_level+1], if this finer level exists;
  • interpolating from a_phiLevel[m_level-1] at the coarse/fine boundary, if this coarser level exists;
  • applying the physical boundary conditions.
Parameters:
a_gradPhi  gradient of phi at level m_level
a_phiLevel  pointers to solution, indexed by level; max Vector index must be at least m_level

void AMRNodeLevelMG::computeAMRResidual ( Vector< LevelData< NodeFArrayBox > * > &  a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &  a_rhsLevel 
)

Compute complete, 3-level residual (rhs - operator(phi)) and put it into local data m_resid.

m_resid is zeroed out and its interior nodes filled with the residual.

Parameters:
a_phiLevel  pointers to solution, indexed by level; max Vector index must be at least m_level
a_rhsLevel  pointers to right-hand side, indexed by level; max Vector index must be at least m_level

void AMRNodeLevelMG::upSweep ( Vector< LevelData< NodeFArrayBox > * > &  a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &  a_rhsLevel 
)

Sweep up multigrid V-cycle.

We modify a_phiLevel[m_level] by replacing it with m_phiSave plus a correction.

In succession:

  • m_corr is interpolated from next coarser level's m_corr;
  • m_resid is decremented by operator on m_corr;
  • m_dcorr is set to zero and smoothed with m_resid as right-hand side;
  • m_corr is incremented by m_dcorr;
  • m_phiSave is incremented by m_corr.
Parameters:
a_phiLevel  pointers to solution, indexed by level; max Vector index must be at least m_level
a_rhsLevel  pointers to right-hand side, indexed by level; max Vector index must be at least m_level

void AMRNodeLevelMG::downSweep ( Vector< LevelData< NodeFArrayBox > * > &  a_phiLevel,
const Vector< LevelData< NodeFArrayBox > * > &  a_rhsLevel 
)

Sweep down multigrid V-cycle.

We modify a_phiLevel[m_level] by incrementing it by a correction. In succession:

  • m_phiSave is set to the original input a_phiLevel[m_level];
  • m_corr is set to zero and smoothed with m_resid as right-hand side;
  • a_phiLevel[m_level] is incrementing by m_corr;
  • next coarser level's m_corr is initialized to zero;
  • next coarser level's m_resid is set to the residual at the coarser level, and then at the coarse interior nodes is overwritten with average of this level's m_resid - operator(m_corr).

As a side effect, if there is a coarser level, we modify a_phiLevel[m_level-1] by:

  • projecting down from interior coarse nodes of a_phiLevel[m_level];
  • interpolating from a_phiLevel[m_level-2] at the coarse/fine boundary, if this coarser level exists;
  • applying the physical boundary conditions.
Parameters:
a_phiLevel  pointers to solution, indexed by level; max Vector index must be at least m_level
a_rhsLevel  pointers to right-hand side, indexed by level; max Vector index must be at least m_level

Real AMRNodeLevelMG::computeNorm ( const LevelData< NodeFArrayBox > &  a_mfinput,
int  a_normType 
) const [protected]

Returns norm of input.

Parameters:
a_mfinput  input variable
a_normType  type of norm, or 0 for max norm

void AMRNodeLevelMG::smooth ( LevelData< NodeFArrayBox > &  a_phi,
const LevelData< NodeFArrayBox > &  a_rhs 
) [protected]

Use short V-cycle or NodeLevelMG's smoother to reduce high wave numbers of residual.

Parameters:
a_phi  solution at this level
a_rhs  right-hand side at this level

void AMRNodeLevelMG::projectFineInterior ( LevelData< NodeFArrayBox > &  a_phi,
const LevelData< NodeFArrayBox > &  a_phiFine 
) [protected]

Project a_phiFine at coarse interior nodes to a_phi.

void AMRNodeLevelMG::clearMemory (  )  [protected]

Delete internal memory and set pointers to NULL.

void AMRNodeLevelMG::setDefaultValues (  )  [protected]

Set default values. Does not deal with memory.

AMRNodeLevelMG& AMRNodeLevelMG::operator= ( const AMRNodeLevelMG  )  [private]


Friends And Related Function Documentation

friend class AMRNodeSolver [friend]


Member Data Documentation

the boss

NodeLevelMG level solver object to relax on this level

for interpolation

bool AMRNodeLevelMG::m_isDefined [protected]

has this AMRNodeLevelMG been defined yet?

bool AMRNodeLevelMG::m_verbose [protected]

flag for verbose output

the grids at this level, coarsened

residual

correction

the infamous correction to the correction

L(phi) on this level

extra copy of solution

coarsened residual, on m_coarsenedGrids

int AMRNodeLevelMG::m_level [protected]

index of this level

mesh spacing at this level

pointer to operator

pointer to coarsening operator

CELL-centered physical domain at this level

the grids at the next finer level

the grids at the next finer level, coarsened

interior boundary nodes of grids at this level

exterior boundary nodes of grids at this level

interior boundary nodes of the coarsened grids at this level

interior boundary nodes of the coarsened grids at next finer level


The documentation for this class was generated from the following file:

Generated on Tue Apr 14 14:22:48 2009 for Chombo + EB by  doxygen 1.5.5