Chombo + EB + MF  3.2
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PoissonOp4 Class Reference

#include <PoissonOp4.H>

Inheritance diagram for PoissonOp4:
Inheritance graph
[legend]

Public Member Functions

 PoissonOp4 ()
 
virtual ~PoissonOp4 ()
 
LinearOp functions
void define (const RealVect &a_dx, const ProblemDomain &a_domain, BCFunc a_bc)
 
virtual void createCoarsened (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs, const int &a_refRat)
 
virtual void residual (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
 
virtual void preCond (LevelData< FArrayBox > &a_correction, const LevelData< FArrayBox > &a_residual)
 
virtual void applyOp (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_phi, bool a_homogeneous=false)
 
virtual void create (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
 
virtual void assign (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
 
virtual Real dotProduct (const LevelData< FArrayBox > &a_1, const LevelData< FArrayBox > &a_2)
 
virtual void incr (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, Real a_scale)
 
virtual void axby (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_x, const LevelData< FArrayBox > &a_y, Real a, Real b)
 
virtual void scale (LevelData< FArrayBox > &a_lhs, const Real &a_scale)
 
virtual Real norm (const LevelData< FArrayBox > &a_x, int a_ord)
 
virtual void setToZero (LevelData< FArrayBox > &a_x)
 
MGLevelOp functions
virtual void relax (LevelData< FArrayBox > &a_e, const LevelData< FArrayBox > &a_residual, int iterations)
 
virtual void createCoarser (LevelData< FArrayBox > &a_coarse, const LevelData< FArrayBox > &a_fine, bool ghost)
 
virtual void restrictResidual (LevelData< FArrayBox > &a_resCoarse, LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > &a_rhsFine)
 
virtual void prolongIncrement (LevelData< FArrayBox > &a_phiThisLevel, const LevelData< FArrayBox > &a_correctCoarse)
 
- Public Member Functions inherited from MGLevelOp< LevelData< FArrayBox > >
 MGLevelOp ()
 Constructor. More...
 
virtual ~MGLevelOp ()
 Destructor. More...
 
virtual void relaxNF (LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > *a_phiCoarse, const LevelData< FArrayBox > &a_rhs, int a_iterations)
 specialized no-fine relax function, useful for full-multigrid schemes, defaults to regular relax More...
 
virtual void restrictResidual (LevelData< FArrayBox > &a_resCoarse, LevelData< FArrayBox > &a_phiFine, const LevelData< FArrayBox > *a_phiCoarse, const LevelData< FArrayBox > &a_rhsFine, bool homogeneous)
 full-multigrid version of restrictResidual, useful for FAS-type schemes. Defaults to standard restriction More...
 
virtual void restrictR (LevelData< FArrayBox > &a_phiCoarse, const LevelData< FArrayBox > &a_phiFine)
 simple restriction function More...
 
void addObserver (MGLevelOpObserver< LevelData< FArrayBox > > *a_observer)
 
virtual void applyOpMg (LevelData< FArrayBox > &a_lhs, LevelData< FArrayBox > &a_phi, LevelData< FArrayBox > *a_phiCoarse, bool a_homogeneous)
 Apply an operator. More...
 
virtual void residualNF (LevelData< FArrayBox > &a_lhs, LevelData< FArrayBox > &a_phi, const LevelData< FArrayBox > *a_phiCoarse, const LevelData< FArrayBox > &a_rhs, bool a_homogeneous=false)
 
void removeObserver (MGLevelOpObserver< LevelData< FArrayBox > > *a_observer)
 
void addCoarserObserver (MGLevelOp< LevelData< FArrayBox > > *a_operator, int a_coarseningFactor)
 
void notifyObserversOfChange ()
 This should be called whenever the operator's data is updated. More...
 
virtual void finerOperatorChanged (const MGLevelOp< LevelData< FArrayBox > > &a_operator, int a_coarseningFactor)
 
int numObservers () const
 Returns the number of objects observing this operator. More...
 
- Public Member Functions inherited from LinearOp< LevelData< FArrayBox > >
virtual ~LinearOp ()
 
virtual void clear (LevelData< FArrayBox > &a_lhs)
 
virtual void assignLocal (LevelData< FArrayBox > &a_lhs, const LevelData< FArrayBox > &a_rhs)
 
virtual void mDotProduct (const LevelData< FArrayBox > &a_1, const int a_sz, const LevelData< FArrayBox > a_2[], Real a_mdots[])
 
virtual Real dx () const
 
virtual void write (const LevelData< FArrayBox > *a, const char *filename)
 
- Public Member Functions inherited from MGLevelOpObserver< LevelData< FArrayBox > >
 MGLevelOpObserver ()
 Base level Constructor. Called by all subclasses. More...
 
virtual ~MGLevelOpObserver ()
 Destructor. More...
 
virtual void operatorChanged (const MGLevelOp< LevelData< FArrayBox > > &a_operator)
 
void setObservee (MGLevelOp< LevelData< FArrayBox > > *a_observee)
 
void clearObservee ()
 

Static Public Attributes

static const int m_nGhost = 2
 

Protected Member Functions

void levelGSRB (LevelData< FArrayBox > &a_e, const LevelData< FArrayBox > &a_residual)
 

Protected Attributes

RealVect m_dx
 
RealVect m_dxCrse
 
ProblemDomain m_domain
 
BCFunc m_bc
 
LevelDataOps< FArrayBoxm_levelOps
 
DisjointBoxLayout m_coarsenedMGrids
 

Constructor & Destructor Documentation

◆ PoissonOp4()

PoissonOp4::PoissonOp4 ( )
inline

◆ ~PoissonOp4()

virtual PoissonOp4::~PoissonOp4 ( )
inlinevirtual

Member Function Documentation

◆ define()

void PoissonOp4::define ( const RealVect a_dx,
const ProblemDomain a_domain,
BCFunc  a_bc 
)

◆ createCoarsened()

virtual void PoissonOp4::createCoarsened ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_rhs,
const int &  a_refRat 
)
virtual

◆ residual()

virtual void PoissonOp4::residual ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_phi,
const LevelData< FArrayBox > &  a_rhs,
bool  a_homogeneous = false 
)
virtual

Say you are solving L(phi) = rhs. Make a_lhs = L(a_phi) - a_rhs. If a_homogeneous is true, evaluate the operator using homogeneous boundary conditions.

Implements LinearOp< LevelData< FArrayBox > >.

◆ preCond()

virtual void PoissonOp4::preCond ( LevelData< FArrayBox > &  a_cor,
const LevelData< FArrayBox > &  a_residual 
)
virtual

Given the current state of the residual the correction, apply your preconditioner to a_cor.

Implements LinearOp< LevelData< FArrayBox > >.

◆ applyOp()

virtual void PoissonOp4::applyOp ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_phi,
bool  a_homogeneous = false 
)
virtual

In the context of solving L(phi) = rhs, set a_lhs = L(a_phi). If a_homogeneous is true, evaluate the operator using homogeneous boundary conditions.

Implements LinearOp< LevelData< FArrayBox > >.

◆ create()

virtual void PoissonOp4::create ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_rhs 
)
virtual

Creat data holder a_lhs that mirrors a_rhs. You do not need to copy the data of a_rhs, just make a holder the same size.

Implements LinearOp< LevelData< FArrayBox > >.

◆ assign()

virtual void PoissonOp4::assign ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_rhs 
)
virtual

Set a_lhs equal to a_rhs.

Implements LinearOp< LevelData< FArrayBox > >.

◆ dotProduct()

virtual Real PoissonOp4::dotProduct ( const LevelData< FArrayBox > &  a_1,
const LevelData< FArrayBox > &  a_2 
)
virtual

Compute and return the dot product of a_1 and a_2. In most contexts, this means return the sum over all data points of a_1*a_2.

Implements LinearOp< LevelData< FArrayBox > >.

◆ incr()

virtual void PoissonOp4::incr ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_x,
Real  a_scale 
)
virtual

Increment by scaled amount (a_lhs += a_scale*a_x).

Implements LinearOp< LevelData< FArrayBox > >.

◆ axby()

virtual void PoissonOp4::axby ( LevelData< FArrayBox > &  a_lhs,
const LevelData< FArrayBox > &  a_x,
const LevelData< FArrayBox > &  a_y,
Real  a_a,
Real  a_b 
)
virtual

Set input to a scaled sum (a_lhs = a_a*a_x + a_b*a_y).

Implements LinearOp< LevelData< FArrayBox > >.

◆ scale()

virtual void PoissonOp4::scale ( LevelData< FArrayBox > &  a_lhs,
const Real a_scale 
)
virtual

Multiply the input by a given scale (a_lhs *= a_scale).

Implements LinearOp< LevelData< FArrayBox > >.

◆ norm()

virtual Real PoissonOp4::norm ( const LevelData< FArrayBox > &  a_rhs,
int  a_ord 
)
virtual

Return the norm of a_rhs. a_ord == 0 max norm, a_ord == 1 sum(abs(a_rhs)), else, L(a_ord) norm.

Implements LinearOp< LevelData< FArrayBox > >.

◆ setToZero()

virtual void PoissonOp4::setToZero ( LevelData< FArrayBox > &  a_lhs)
virtual

Set a_lhs to zero.

Implements LinearOp< LevelData< FArrayBox > >.

◆ relax()

virtual void PoissonOp4::relax ( LevelData< FArrayBox > &  a_correction,
const LevelData< FArrayBox > &  a_residual,
int  a_iterations 
)
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).

Implements MGLevelOp< LevelData< FArrayBox > >.

◆ createCoarser()

virtual void PoissonOp4::createCoarser ( LevelData< FArrayBox > &  a_coarse,
const LevelData< FArrayBox > &  a_fine,
bool  ghosted 
)
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).

Implements MGLevelOp< LevelData< FArrayBox > >.

◆ restrictResidual()

virtual void PoissonOp4::restrictResidual ( LevelData< FArrayBox > &  a_resCoarse,
LevelData< FArrayBox > &  a_phiFine,
const LevelData< FArrayBox > &  a_rhsFine 
)
virtual

calculate restricted residual a_resCoarse[2h] = I[h->2h] (rhsFine[h] - L[h](phiFine[h])

Implements MGLevelOp< LevelData< FArrayBox > >.

◆ prolongIncrement()

virtual void PoissonOp4::prolongIncrement ( LevelData< FArrayBox > &  a_phiThisLevel,
const LevelData< FArrayBox > &  a_correctCoarse 
)
virtual

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

Implements MGLevelOp< LevelData< FArrayBox > >.

◆ levelGSRB()

void PoissonOp4::levelGSRB ( LevelData< FArrayBox > &  a_e,
const LevelData< FArrayBox > &  a_residual 
)
protected

Member Data Documentation

◆ m_nGhost

const int PoissonOp4::m_nGhost = 2
static

◆ m_dx

RealVect PoissonOp4::m_dx
protected

◆ m_dxCrse

RealVect PoissonOp4::m_dxCrse
protected

◆ m_domain

ProblemDomain PoissonOp4::m_domain
protected

◆ m_bc

BCFunc PoissonOp4::m_bc
protected

◆ m_levelOps

LevelDataOps<FArrayBox> PoissonOp4::m_levelOps
protected

◆ m_coarsenedMGrids

DisjointBoxLayout PoissonOp4::m_coarsenedMGrids
protected

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