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

#include <NewPoissonOp.H>

Inheritance diagram for NewPoissonOp:
Inheritance graph
[legend]

Public Member Functions

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

Protected Member Functions

void levelGSRB (FArrayBox &a_e, const FArrayBox &a_residual)
 
void colorGS (FArrayBox &a_phi, const FArrayBox &a_rhs, const IntVect &color)
 
bool nextColor (IntVect &color, const IntVect &limit)
 
void levelRelaxColor (FArrayBox &a_phi, const FArrayBox &a_rhs, const IntVect &a_color, const Real &a_weight, const bool &a_homogeneousPhysBC)
 

Protected Attributes

RealVect m_dx
 
RealVect m_dxCrse
 
ProblemDomain m_domain
 
BCFunc m_bc
 

Constructor & Destructor Documentation

NewPoissonOp::NewPoissonOp ( )
inline
virtual NewPoissonOp::~NewPoissonOp ( )
inlinevirtual

Member Function Documentation

void NewPoissonOp::define ( const RealVect a_dx,
const ProblemDomain a_domain,
BCFunc  a_bc 
)
virtual void NewPoissonOp::createCoarsened ( FArrayBox a_lhs,
const FArrayBox a_rhs,
const int &  a_refRat 
)
virtual
virtual void NewPoissonOp::residual ( FArrayBox a_lhs,
const FArrayBox a_phi,
const 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< FArrayBox >.

virtual void NewPoissonOp::preCond ( FArrayBox a_cor,
const FArrayBox a_residual 
)
virtual

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

Implements LinearOp< FArrayBox >.

virtual void NewPoissonOp::applyOp ( FArrayBox a_lhs,
const 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< FArrayBox >.

virtual void NewPoissonOp::create ( FArrayBox a_lhs,
const 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< FArrayBox >.

virtual void NewPoissonOp::assign ( FArrayBox a_lhs,
const FArrayBox a_rhs 
)
virtual

Set a_lhs equal to a_rhs.

Implements LinearOp< FArrayBox >.

virtual Real NewPoissonOp::dotProduct ( const FArrayBox a_1,
const 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< FArrayBox >.

virtual void NewPoissonOp::incr ( FArrayBox a_lhs,
const FArrayBox a_x,
Real  a_scale 
)
virtual

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

Implements LinearOp< FArrayBox >.

virtual void NewPoissonOp::axby ( FArrayBox a_lhs,
const FArrayBox a_x,
const 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< FArrayBox >.

virtual void NewPoissonOp::scale ( FArrayBox a_lhs,
const Real a_scale 
)
virtual

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

Implements LinearOp< FArrayBox >.

virtual Real NewPoissonOp::norm ( const 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< FArrayBox >.

virtual void NewPoissonOp::setToZero ( FArrayBox a_lhs)
virtual

Set a_lhs to zero.

Implements LinearOp< FArrayBox >.

virtual void NewPoissonOp::relax ( FArrayBox a_correction,
const 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< FArrayBox >.

virtual void NewPoissonOp::createCoarser ( FArrayBox a_coarse,
const 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< FArrayBox >.

virtual void NewPoissonOp::restrictResidual ( FArrayBox a_resCoarse,
FArrayBox a_phiFine,
const FArrayBox a_rhsFine 
)
virtual

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

Implements MGLevelOp< FArrayBox >.

virtual void NewPoissonOp::prolongIncrement ( FArrayBox a_phiThisLevel,
const FArrayBox a_correctCoarse 
)
virtual

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

Implements MGLevelOp< FArrayBox >.

void NewPoissonOp::levelGSRB ( FArrayBox a_e,
const FArrayBox a_residual 
)
protected
void NewPoissonOp::colorGS ( FArrayBox a_phi,
const FArrayBox a_rhs,
const IntVect color 
)
protected
bool NewPoissonOp::nextColor ( IntVect color,
const IntVect limit 
)
protected
void NewPoissonOp::levelRelaxColor ( FArrayBox a_phi,
const FArrayBox a_rhs,
const IntVect a_color,
const Real a_weight,
const bool &  a_homogeneousPhysBC 
)
protected

Member Data Documentation

RealVect NewPoissonOp::m_dx
protected
RealVect NewPoissonOp::m_dxCrse
protected
ProblemDomain NewPoissonOp::m_domain
protected
BCFunc NewPoissonOp::m_bc
protected

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