#include <NodePoissonOp.H>
This class contains stuff to solve div (grad phi) = rhs at one level.
NodePoissonOp::NodePoissonOp | ( | ) |
Default constructor. User must subsequently call define().
NodePoissonOp::~NodePoissonOp | ( | ) |
Destructor.
virtual NodeLevelOp* NodePoissonOp::new_levelop | ( | ) | const [virtual] |
Virtual constructor workaround. Sets these to be the same as this:
Implements NodeLevelOp.
void NodePoissonOp::define | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const ProblemDomain & | a_domain, | |||
bool | a_homogeneousOnly = false , |
|||
int | a_ncomp = 1 , |
|||
bool | a_verbose = false | |||
) | [virtual] |
Full define function. Makes all coarse/fine information and sets internal variables. The current level is taken to be the fine level.
a_grids | grids at this level |
a_gridsCoarsePtr | pointer to grids at next coarser AMR level, or NULL if none |
a_dx | mesh spacing at this level |
a_refToCoarse | refinement ratio between this and next coarser level |
a_domain | physical domain at this level |
a_homogeneousOnly | only homogeneous coarse/fine interpolation? |
a_ncomp | number of components |
a_verbose | verbose output? |
Implements NodeLevelOp.
void NodePoissonOp::define | ( | const DisjointBoxLayout & | a_grids, | |
const DisjointBoxLayout * | a_gridsCoarsePtr, | |||
Real | a_dx, | |||
int | a_refToCoarse, | |||
const Box & | a_domain, | |||
bool | a_homogeneousOnly = false , |
|||
int | a_ncomp = 1 , |
|||
bool | a_verbose = false | |||
) | [virtual] |
Full define function. Makes all coarse/fine information and sets internal variables. The current level is taken to be the fine level.
a_grids | grids at this level |
a_gridsCoarsePtr | pointer to grids at next coarser AMR level, or NULL if none |
a_dx | mesh spacing at this level |
a_refToCoarse | refinement ratio between this and next coarser level |
a_domain | physical domain at this level |
a_homogeneousOnly | only homogeneous coarse/fine interpolation? |
a_ncomp | number of components |
a_verbose | verbose output? |
Implements NodeLevelOp.
void NodePoissonOp::define | ( | const NodeLevelOp * | a_opfine, | |
int | a_refToFine | |||
) | [virtual] |
Full define function, based on a coarsening of the finer NodeLevelOp. Coarse-level grids are not set because only homogeneous interpolation is used.
a_opfine | pointer to NodeLevelOp at next finer level |
a_refToFine | refinement ratio between a_opfine's and this level |
Implements NodeLevelOp.
virtual bool NodePoissonOp::isDefined | ( | ) | const [virtual] |
Returns true
if this object was created with the defining constructor or if define() has been called.
Implements NodeLevelOp.
virtual void NodePoissonOp::setVerbose | ( | bool | a_verbose | ) | [virtual] |
set max number of bottomSmoother iterations Control output to stdout.
Reimplemented from NodeLevelOp.
void NodePoissonOp::setBottomSmoother | ( | const NodeBaseBottomSmoother & | a_bottomSmoother | ) |
Set bottom smoother.
void NodePoissonOp::setDomainNodeBC | ( | const DomainNodeBC & | a_dombcin | ) |
Set physical boundary conditions.
void NodePoissonOp::setInterpolationDegree | ( | int | a_interpolationDegree | ) |
Set interpolation degree in NodeQuadCFInterp:
Like setDomainNodeBC, this function must be called before define(). You cannot change the interpolation degree later.
void NodePoissonOp::CFInterp | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_phiCoarse, | |||
bool | a_inhomogeneous | |||
) | [virtual] |
Coarse / Fine (inhomogeneous) interpolation operator. Fill the nodes of a_phi on the coarse/fine interface with interpolated data from a_phiCoarse.
a_phi | the data at this level |
a_phiCoarse | the data at the next coarser level |
a_inhomogeneous | inhomogeneous physical boundary condition? |
Implements NodeLevelOp.
void NodePoissonOp::homogeneousCFInterp | ( | LevelData< NodeFArrayBox > & | a_phi | ) | [virtual] |
Homogeneous coarse/fine interpolation operator. Fill the nodes of a_phi on the coarse/fine interface with zeroes.
a_phi | the data at this level |
Implements NodeLevelOp.
void NodePoissonOp::residualI | ( | LevelData< NodeFArrayBox > & | a_resid, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > * | a_phiCoarsePtr, | |||
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Evaluate residual of operator,
a_resid = a_rhs - operator(a_phi),
with inhomogeneous coarse/fine boundary conditions, inhomogeneous physical boundary conditions.
The operator is evaluated on a_phi, after interpolating from *a_phiCoarsePtr at the coarse/fine boundary and applying the physical boundary conditions.
a_resid | the residual, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
a_phiCoarsePtr | pointer to data at next coarser level |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::residualH | ( | LevelData< NodeFArrayBox > & | a_resid, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Evaluate residual of operator,
a_resid = a_rhs - operator(a_phi),
with homogeneous coarse/fine boundary conditions, homogeneous physical boundary conditions.
The operator is evaluated on a_phi, after setting to zero at the coarse/fine boundary and applying homogeneous physical boundary conditions.
a_resid | the residual, at interior nodes |
a_phi | the data at this level, set to zero at coarse/fine boundary |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::residualIcfHphys | ( | LevelData< NodeFArrayBox > & | a_resid, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > * | a_phiCoarsePtr, | |||
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Evaluate residual of operator,
a_resid = a_rhs - operator(a_phi),
with inhomogeneous coarse/fine boundary conditions, homogeneous physical boundary conditions.
The operator is evaluated on a_phi, after interpolating from *a_phiCoarsePtr at the coarse/fine boundary and applying homogeneous physical boundary conditions.
a_resid | the residual, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
a_phiCoarsePtr | pointer to data at next coarser level |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::residualHcfIphys | ( | LevelData< NodeFArrayBox > & | a_resid, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Evaluate residual of operator,
a_resid = a_rhs - operator(a_phi),
with homogeneous coarse/fine boundary conditions, inhomogeneous physical boundary conditions.
The operator is evaluated on a_phi, after setting to zero at the coarse/fine boundary and applying the physical boundary conditions.
a_resid | the residual, at interior nodes |
a_phi | the data at this level, set to zero at coarse/fine boundary |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::applyOpI | ( | LevelData< NodeFArrayBox > & | a_LofPhi, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > * | a_phiCoarsePtr | |||
) | [virtual] |
Evaluate operator, inhomogeneous coarse/fine boundary conditions, inhomogeneous physical boundary conditions.
The operator is evaluated on a_phi after interpolating from *a_phiCoarsePtr at the coarse/fine boundary and applying the physical boundary conditions.
a_LofPhi | value of the operator, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
a_phiCoarsePtr | pointer to data at next coarser level |
Implements NodeLevelOp.
void NodePoissonOp::applyOpH | ( | LevelData< NodeFArrayBox > & | a_LofPhi, | |
LevelData< NodeFArrayBox > & | a_phi | |||
) | [virtual] |
Evaluate operator, homogeneous coarse/fine boundary conditions, homogeneous physical boundary conditions.
The operator is evaluated on a_phi, after setting to zero at the coarse/fine boundary and applying homogeneous physical boundary conditions.
a_LofPhi | value of the operator, at interior nodes |
a_phi | the data at this level, set to zero at coarse/fine boundary |
Implements NodeLevelOp.
void NodePoissonOp::applyOpIcfHphys | ( | LevelData< NodeFArrayBox > & | a_LofPhi, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > * | a_phiCoarsePtr | |||
) | [virtual] |
Evaluate operator, inhomogeneous coarse/fine boundary conditions, homogeneous physical boundary conditions.
The operator is evaluated on a_phi, after interpolating from *a_phiCoarsePtr at the coarse/fine boundary and applying homogeneous physical boundary conditions.
a_LofPhi | value of the operator, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
a_phiCoarsePtr | pointer to data at next coarser level |
Implements NodeLevelOp.
void NodePoissonOp::applyOpHcfIphys | ( | LevelData< NodeFArrayBox > & | a_LofPhi, | |
LevelData< NodeFArrayBox > & | a_phi | |||
) | [virtual] |
Evaluate operator, homogeneous coarse/fine boundary conditions, inhomogeneous physical boundary conditions.
The operator is evaluated on a_phi, after setting to zero at the coarse/fine boundary and applying the physical boundary conditions.
a_LofPhi | value of the operator, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
Implements NodeLevelOp.
void NodePoissonOp::gradient | ( | LevelData< NodeFArrayBox > & | a_gradPhi, | |
LevelData< NodeFArrayBox > & | a_phi, | |||
const LevelData< NodeFArrayBox > * | a_phiCoarsePtr | |||
) | [virtual] |
Evaluate gradient, inhomogeneous coarse/fine boundary conditions, inhomogeneous physical boundary conditions.
The gradient is evaluated on a_phi after interpolating from *a_phiCoarsePtr at the coarse/fine boundary and applying the physical boundary conditions.
a_gradPhi | value of the gradient, at interior nodes |
a_phi | the data at this level, interpolated from *a_phiCoarsePtr at coarse/fine boundary |
a_phiCoarsePtr | pointer to data at next coarser level |
Implements NodeLevelOp.
void NodePoissonOp::smooth | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Smoother. Assumes that problem has already been put in residual-correction form, so that coarse/fine boundary conditions are homogeneous.
a_phi | the data at this level |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::levelPreconditioner | ( | LevelData< NodeFArrayBox > & | a_phihat, | |
const LevelData< NodeFArrayBox > & | a_rhshat | |||
) | [virtual] |
Apply preconditioning to the solution on this level. Given a_rhshat, returns a_phihat from M(a_phihat) = a_rhshat .
a_phihat | data at this level |
a_rhshat | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::bottomSmoother | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [virtual] |
Do a smoothing at the bottom level. Default is conjugate gradient.
a_phi | data at this level |
a_rhs | right-hand side at this level |
Implements NodeLevelOp.
void NodePoissonOp::setCFIVS | ( | ) | [private] |
Get members related to the coarse/fine interface.
void NodePoissonOp::levelGSRB | ( | LevelData< NodeFArrayBox > & | a_phi, | |
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [private] |
Does GSRB on a level.
void NodePoissonOp::applyOpOnly | ( | LevelData< NodeFArrayBox > & | a_LofPhi, | |
const LevelData< NodeFArrayBox > & | a_phi | |||
) | [private] |
Applies operator, after coarse/fine and physical boundary conditions have been set.
void NodePoissonOp::gradientOnly | ( | LevelData< NodeFArrayBox > & | a_gradPhi, | |
const LevelData< NodeFArrayBox > & | a_phi | |||
) | [private] |
Evaluates gradient, after coarse/fine and physical boundary conditions have been set.
void NodePoissonOp::homogeneousCFInterp | ( | FArrayBox & | a_phiFab, | |
const DataIndex & | a_datInd, | |||
const int | a_idir, | |||
const Side::LoHiSide | a_hiorlo | |||
) | [private] |
Does homogeneous coarse/fine interpolation.
void NodePoissonOp::clearMemory | ( | ) | [private] |
void NodePoissonOp::setDefaultValues | ( | ) | [private] |
void NodePoissonOp::residualDiff | ( | LevelData< NodeFArrayBox > & | a_resid, | |
const LevelData< NodeFArrayBox > & | a_rhs | |||
) | [private] |
DomainNodeBC NodePoissonOp::m_dombc [protected] |
boundary conditons
int NodePoissonOp::m_interpolationDegree [protected] |
degree of interpolation at c/f interfaces: 1 for (bi)linear, 2 for (bi)quadratic
ProblemDomain NodePoissonOp::m_domainInteriorNodes [protected] |
nodes inside physical domain of current level
DisjointBoxLayout NodePoissonOp::m_grids [protected] |
CELL-centered grids at the current level
Copier NodePoissonOp::m_exchangeCopier [protected] |
DisjointBoxLayout NodePoissonOp::m_gridsCoarse [protected] |
CELL-centered grids at next coarser level, if any
int NodePoissonOp::m_ncomp [protected] |
number of components
int NodePoissonOp::m_refToCoarse [protected] |
refinement ratio between this and the next coarser level
Real NodePoissonOp::m_dx [protected] |
mesh spacing at this level
Real NodePoissonOp::m_dxCoarse [protected] |
mesh spacing at next coarser level
bool NodePoissonOp::m_isDefined [protected] |
has full define function been called?
bool NodePoissonOp::m_isBCDefined [protected] |
has boundary condition been defined?
bool NodePoissonOp::m_ihcfiEnabled [protected] |
is inhomogeneous CF interpolation possible?
LayoutData<NodeCFIVS> NodePoissonOp::m_loCFIVS[SpaceDim] [protected] |
used for figuring out which nodes lie on interface with next coarser level
LayoutData<NodeCFIVS> NodePoissonOp::m_hiCFIVS[SpaceDim] [protected] |
used for figuring out which nodes lie on interface with next coarser level
NodeQuadCFInterp NodePoissonOp::m_qcfi [protected] |
coarse-fine quadratic interpolation
NodeBaseBottomSmoother* NodePoissonOp::m_bottomSmootherPtr [protected] |
bottom smoother object
LayoutData< Vector<IntVectSet> > NodePoissonOp::m_IVSV [protected] |
interior boundary nodes
LayoutData< BitSet > NodePoissonOp::m_IVSVfull [protected] |
whether each section of m_IVSV is a complete box