MGLevelOp< T > Class Template Reference

#include <MultiGrid.H>

Inheritance diagram for MGLevelOp< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<typename T>
class MGLevelOp< T >

This class handles the additional tasks of coordinating operations between this level and the level one coarser than this 'level'. This class is also an MGLevelOpObserver, so objects of this type can observe other MGLevelOp objects.

Public Member Functions

 MGLevelOp ()
 Constructor.
virtual ~MGLevelOp ()
 Destructor.
virtual void createCoarser (T &a_coarse, const T &a_fine, bool ghosted)=0
virtual void relax (T &a_correction, const T &a_residual, int a_iterations)=0
virtual void relaxNF (T &a_phi, const T *a_phiCoarse, const T &a_rhs, int a_iterations)
 specialized no-fine relax function, useful for full-multigrid schemes, defaults to regular relax
virtual void restrictResidual (T &a_resCoarse, T &a_phiFine, const T &a_rhsFine)=0
virtual void restrictResidual (T &a_resCoarse, T &a_phiFine, const T *a_phiCoarse, const T &a_rhsFine, bool homogeneous)
 full-multigrid version of restrictResidual, useful for FAS-type schemes. Defaults to standard restriction
virtual void restrictR (T &a_phiCoarse, const T &a_phiFine)
 simple restriction function
virtual void prolongIncrement (T &a_phiThisLevel, const T &a_correctCoarse)=0
void addObserver (MGLevelOpObserver< T > *a_observer)
virtual void applyOpMg (T &a_lhs, T &a_phi, T *a_phiCoarse, bool a_homogeneous)
 Apply an operator.
virtual void residualNF (T &a_lhs, T &a_phi, const T *a_phiCoarse, const T &a_rhs, bool a_homogeneous=false)
void removeObserver (MGLevelOpObserver< T > *a_observer)
void addCoarserObserver (MGLevelOp< T > *a_operator, int a_coarseningFactor)
void notifyObserversOfChange ()
 This should be called whenever the operator's data is updated.
virtual void finerOperatorChanged (const MGLevelOp< T > &a_operator, int a_coarseningFactor)
int numObservers () const
 Returns the number of objects observing this operator.

Private Member Functions

 MGLevelOp (const MGLevelOp &)
MGLevelOpoperator= (const MGLevelOp &)

Private Attributes

std::vector< MGLevelOpObserver
< T > * > 
m_observers
 List of observers for the operator.
std::vector< int > m_coarseningFactors
 Multigrid coarsening factors.

Constructor & Destructor Documentation

template<typename T>
MGLevelOp< T >::MGLevelOp (  )  [inline]

Constructor.

template<typename T>
virtual MGLevelOp< T >::~MGLevelOp (  )  [inline, virtual]

Destructor.

template<typename T>
MGLevelOp< T >::MGLevelOp ( const MGLevelOp< T > &   )  [private]


Member Function Documentation

template<typename T>
virtual void MGLevelOp< T >::createCoarser ( T &  a_coarse,
const T &  a_fine,
bool  ghosted 
) [pure virtual]

Create a coarsened (by two) version of the input data. This does not include averaging the data. So if a_fine is over a Box of (0, 0, 0) (63, 63, 63), a_fine should be over a Box (0, 0, 0) (31, 31, 31).

Implemented in AMRNodeOp, AMRPoissonOp, NewPoissonOp, NewPoissonOp4, ViscousTensorOp, NWOViscousTensorOp, PoissonOp4, ResistivityOp, ViscousTensorOp, EBAMRPoissonOp, EBConductivityOp, EBPoissonOp, EBViscousTensorOp, NWOEBConductivityOp, NWOEBViscousTensorOp, and slowEBCO.

template<typename T>
virtual void MGLevelOp< T >::relax ( T &  a_correction,
const T &  a_residual,
int  a_iterations 
) [pure virtual]

Use your relaxation operator to remove the high frequency wave numbers from the correction so that it may be averaged to a coarser refinement. A point relaxtion scheme, for example takes the form a_correction -= lambda*(L(a_correction) - a_residual).

Implemented in AMRNodeOp, AMRPoissonOp, NewPoissonOp, NewPoissonOp4, ViscousTensorOp, NWOViscousTensorOp, PoissonOp4, ResistivityOp, ViscousTensorOp, EBAMRPoissonOp, EBConductivityOp, EBPoissonOp, EBViscousTensorOp, NWOEBConductivityOp, NWOEBViscousTensorOp, and slowEBCO.

Referenced by MGLevelOp< LevelData< NodeFArrayBox > >::relaxNF().

template<typename T>
virtual void MGLevelOp< T >::relaxNF ( T &  a_phi,
const T *  a_phiCoarse,
const T &  a_rhs,
int  a_iterations 
) [inline, virtual]

specialized no-fine relax function, useful for full-multigrid schemes, defaults to regular relax

Necessary to implement FAS correctly

Reimplemented in AMRPoissonOp.

template<typename T>
virtual void MGLevelOp< T >::restrictResidual ( T &  a_resCoarse,
T &  a_phiFine,
const T &  a_rhsFine 
) [pure virtual]

template<typename T>
virtual void MGLevelOp< T >::restrictResidual ( T &  a_resCoarse,
T &  a_phiFine,
const T *  a_phiCoarse,
const T &  a_rhsFine,
bool  homogeneous 
) [inline, virtual]

full-multigrid version of restrictResidual, useful for FAS-type schemes. Defaults to standard restriction

template<typename T>
virtual void MGLevelOp< T >::restrictR ( T &  a_phiCoarse,
const T &  a_phiFine 
) [inline, virtual]

simple restriction function

template<typename T>
virtual void MGLevelOp< T >::prolongIncrement ( T &  a_phiThisLevel,
const T &  a_correctCoarse 
) [pure virtual]

correct the fine solution based on coarse correction a_phiThisLevel += I[2h->h](a_correctCoarse)

Implemented in AMRNodeOp, AMRPoissonOp, NewPoissonOp, NewPoissonOp4, ViscousTensorOp, NWOViscousTensorOp, PoissonOp4, ResistivityOp, ViscousTensorOp, EBAMRPoissonOp, EBConductivityOp, EBPoissonOp, EBViscousTensorOp, NWOEBConductivityOp, NWOEBViscousTensorOp, and slowEBCO.

template<typename T>
void MGLevelOp< T >::addObserver ( MGLevelOpObserver< T > *  a_observer  )  [inline]

This adds a new observer to this operator. Note that this operator does not own the resources for the observer, so you must be careful to ensure that the observer does not go out of scope while the operator lives. If the observer is already observing the operator, this operation has no effect.

Parameters:
a_observer An observer to be notified when the operator changes.

Referenced by MGLevelOp< LevelData< NodeFArrayBox > >::addCoarserObserver().

template<typename T>
virtual void MGLevelOp< T >::applyOpMg ( T &  a_lhs,
T &  a_phi,
T *  a_phiCoarse,
bool  a_homogeneous 
) [inline, virtual]

Apply an operator.

useful for full-multigrid/FAS types of algorithms

template<typename T>
virtual void MGLevelOp< T >::residualNF ( T &  a_lhs,
T &  a_phi,
const T *  a_phiCoarse,
const T &  a_rhs,
bool  a_homogeneous = false 
) [inline, virtual]

Reimplemented in AMRPoissonOp.

template<typename T>
void MGLevelOp< T >::removeObserver ( MGLevelOpObserver< T > *  a_observer  )  [inline]

Removes the given observer from the operator's list of observers. This method has no effect if the observer is not found in the list.

Parameters:
a_observer An observer to be removed from the operator's observer list.

template<typename T>
void MGLevelOp< T >::addCoarserObserver ( MGLevelOp< T > *  a_operator,
int  a_coarseningFactor 
) [inline]

Adds a MGLevelOp observer to this operator that is notified when the operator changes so that it can coarsen its corresponding data. This is used to implement dependencies between multigrid operators at different grid levels.

Parameters:
a_operator The multigrid operator that will observe this operator. No operator may observe itself. If a_operator is already observing this operator, this method has no effect.
a_coarseningFactor The refinement factor between the grid level for a_operator and that for this one.

template<typename T>
void MGLevelOp< T >::notifyObserversOfChange (  )  [inline]

This should be called whenever the operator's data is updated.

Notify our observers that the operator's data has changed, taking special care to pass multigrid operators their level.

template<typename T>
virtual void MGLevelOp< T >::finerOperatorChanged ( const MGLevelOp< T > &  a_operator,
int  a_coarseningFactor 
) [inline, virtual]

Overload this method to implement the response of a multigrid operator to a change in a finer operator that it is observing. This allows the coarser observer to coarsen any data that has been changed in the finer operator.

Parameters:
a_operator The operator whose state has changed.
a_coarseningFactor The factor by which this operator's data is coarsened with respect to that of a_operator.

Reimplemented in VCAMRPoissonOp2, EBConductivityOp, and EBViscousTensorOp.

Referenced by MGLevelOp< LevelData< NodeFArrayBox > >::notifyObserversOfChange().

template<typename T>
int MGLevelOp< T >::numObservers (  )  const [inline]

Returns the number of objects observing this operator.

template<typename T>
MGLevelOp& MGLevelOp< T >::operator= ( const MGLevelOp< T > &   )  [private]


Member Data Documentation

template<typename T>
std::vector<MGLevelOpObserver<T>*> MGLevelOp< T >::m_observers [private]

template<typename T>
std::vector<int> MGLevelOp< T >::m_coarseningFactors [private]


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

Generated on Fri Apr 5 04:25:10 2019 for Chombo + EB by  doxygen 1.5.5