Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::MLTerrainPoisson Class Reference

Cell-centered Poisson operator on a terrain-following mesh. More...

#include <AMReX_MLTerrainPoisson.H>

Inheritance diagram for amrex::MLTerrainPoisson:
amrex::MLCellLinOpT< MultiFab > amrex::MLLinOpT< MultiFab >

Classes

struct  BCTag

Public Types

enum struct  ZSplitSolver { Spike , Column }
 Line solver for levels whose boxes do not span z. More...
using MF = MultiFab
using RT = Real
using FAB = FArrayBox
using BCMode = MLCellLinOpT<MF>::BCMode
using StateMode = MLCellLinOpT<MF>::StateMode
using Location = MLCellLinOpT<MF>::Location
Public Types inherited from amrex::MLCellLinOpT< MultiFab >
using FAB
using RT
using BCType
using BCMode
using StateMode
using Location
Public Types inherited from amrex::MLLinOpT< MultiFab >
using MFType
using FAB
using RT
using BCType
using BCMode
using StateMode
using Location

Public Member Functions

 MLTerrainPoisson ()=default
 MLTerrainPoisson (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo())
 Construct the operator. See define().
 ~MLTerrainPoisson () override=default
 MLTerrainPoisson (const MLTerrainPoisson &)=delete
 MLTerrainPoisson (MLTerrainPoisson &&)=delete
MLTerrainPoisson & operator= (const MLTerrainPoisson &)=delete
MLTerrainPoisson & operator= (MLTerrainPoisson &&)=delete
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo())
 Define the operator.
void setZPhys (int amrlev, MultiFab const &z_phys_nd)
 Set the physical height of the cell corners.
void setAreas (int amrlev, Array< MultiFab const *, 3 > const &area)
 Set the face area factors (required).
void setDetJ (int amrlev, MultiFab const &detJ)
 Set the cell volume factor J. If not set, J = 1.
void setZSplitSolver (ZSplitSolver a_solver)
 Choose the solver used when boxes are split in z: Spike (the default) or Column.
std::string name () const override
bool isCrossStencil () const override
 Whether the stencil is the cross shape.
BottomSolver getDefaultBottomSolver () const override
void prepareForSolve () override
 Prepare multilevel metadata before MLMG iterates (coefficients, BC caches, etc.).
bool needsUpdate () const override
 Does it need update if it's reused?
void update () override
 Update for reuse.
bool isSingular (int amrlev) const override
 Is it singular on AMR level amrlev?
bool isBottomSingular () const override
 Is the bottom of the multigrid hierarchy singular?
bool scaleRHS (int amrlev, MultiFab *rhs) const override
 Optionally scale the RHS to fix solvability.
void setDirichletNodesToZero (int, int, MultiFab &) const override
 No-op: cell-centered unknowns are never on a Dirichlet boundary.
void applyBC (int amrlev, int mglev, MultiFab &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MultiFab > *bndry=nullptr, bool skip_fillboundary=false) const override
 Apply physical BCs (optionally skipping FillBoundary).
void interpolation (int amrlev, int fmglev, MultiFab &fine, const MultiFab &crse) const override
 Add the prolongation of coarse data onto the fine grid (fine += prolong(crse)).
void Fapply (int amrlev, int mglev, MultiFab &out, const MultiFab &in) const override
void Fsmooth (int amrlev, int mglev, MultiFab &sol, const MultiFab &rhs, int redblack) const override
void FFlux (int amrlev, const MFIter &mfi, const Array< FAB *, 3 > &flux, const FAB &sol, Location loc, int face_only=0) const override
void compGrad (int amrlev, const Array< MultiFab *, 3 > &grad, MultiFab &sol, Location loc) const override
 Compute the terrain-following gradient, i.e., the negative of the flux.
void getFluxes (const Vector< Array< MultiFab *, 3 > > &a_flux, const Vector< MultiFab * > &a_sol, Location a_loc) const override
 Compute the flux, the negative of the terrain-following gradient.
mlterrain::BCInfo bcInfo (int mglev) const
IntVect coarsenRatio (int mglev) const
void fillZPhysGhost (MultiFab &zp, int mglev) const
void updateCoefs ()
Public Member Functions inherited from amrex::MLCellLinOpT< MultiFab >
 MLCellLinOpT ()
 ~MLCellLinOpT () override=default
 MLCellLinOpT (const MLCellLinOpT< MultiFab > &)=delete
 MLCellLinOpT (MLCellLinOpT< MultiFab > &&)=delete
MLCellLinOpT< MultiFab > & operator= (const MLCellLinOpT< MultiFab > &)=delete
MLCellLinOpT< MultiFab > & operator= (MLCellLinOpT< MultiFab > &&)=delete
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={})
 Bind the operator to an AMR hierarchy.
void setLevelBC (int amrlev, const MultiFab *levelbcdata, const MultiFab *robinbc_a=nullptr, const MultiFab *robinbc_b=nullptr, const MultiFab *robinbc_f=nullptr) final
 Provide per-level inhomogeneous boundary data.
void setLevelBC (int amrlev, const AMF *levelbcdata, const AMF *robinbc_a=nullptr, const AMF *robinbc_b=nullptr, const AMF *robinbc_f=nullptr)
void setGaussSeidel (bool flag) noexcept
 Toggle Gauss–Seidel smoothing in place of Jacobi relaxation.
virtual bool isTensorOp () const
 Whether this operator is a tensor solve.
void updateSolBC (int amrlev, const MultiFab &crse_bcdata) const
 Refresh stored solution BC data from coarse inputs.
void updateCorBC (int amrlev, const MultiFab &crse_bcdata) const
 Refresh stored correction BC data from coarse inputs.
BoxArray makeNGrids (int grid_size) const
 Helper that builds a BoxArray for NSolve with boxes no larger than the requested grid_size.
void restriction (int amrlev, int cmglev, MultiFab &crse, MultiFab &fine) const override
 Restrict a fine-grid field onto its coarse counterpart.
void interpAssign (int amrlev, int fmglev, MultiFab &fine, MultiFab &crse) const override
 Overwrite fine data with the prolongation of coarse data (fine = prolong(crse)).
void interpolationAmr (int famrlev, MultiFab &fine, const MultiFab &crse, IntVect const &nghost) const override
 Prolong AMR-level data during FMG initialization.
void averageDownSolutionRHS (int camrlev, MultiFab &crse_sol, MultiFab &crse_rhs, const MultiFab &fine_sol, const MultiFab &fine_rhs) override
 Average fine solution/RHS onto the next coarser AMR level.
void apply (int amrlev, int mglev, MultiFab &out, MultiFab &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MultiFab > *bndry=nullptr) const override
 Apply the linear operator with boundary conditions.
void smooth (int amrlev, int mglev, MultiFab &sol, const MultiFab &rhs, bool skip_fillboundary, int niter) const override
 Perform niter smoothing iterations on the supplied residual equation.
void solutionResidual (int amrlev, MultiFab &resid, MultiFab &x, const MultiFab &b, const MultiFab *crse_bcdata=nullptr) override
 Compute the residual resid = b - A(x) using solution boundary data.
void prepareForFluxes (int amrlev, const MultiFab *crse_bcdata=nullptr) override
 Ensure BC caches are ready for flux computations (e.g., getFluxes).
void correctionResidual (int amrlev, int mglev, MultiFab &resid, MultiFab &x, const MultiFab &b, BCMode bc_mode, const MultiFab *crse_bcdata=nullptr) final
 Compute the correction residual with optional coarse data.
void reflux (int crse_amrlev, MultiFab &res, const MultiFab &crse_sol, const MultiFab &, MultiFab &, MultiFab &fine_sol, const MultiFab &) const final
 Reflux fine-level fluxes into the coarse residual.
void compFlux (int amrlev, const Array< MultiFab *, 3 > &fluxes, MultiFab &sol, Location loc) const override
 Compute face-centered fluxes from the supplied solution.
void applyMetricTerm (int amrlev, int mglev, MultiFab &rhs) const final
 Multiply the RHS by metric terms appropriate for curvilinear coordinates.
void unapplyMetricTerm (int amrlev, int mglev, MultiFab &rhs) const final
 Remove metric scaling previously applied to the RHS.
Vector< RT > getSolvabilityOffset (int amrlev, int mglev, MultiFab const &rhs) const override
 Compute the average offset needed to enforce solvability constraints.
void fixSolvabilityByOffset (int amrlev, int mglev, MultiFab &rhs, Vector< RT > const &offset) const override
 Apply solvability offsets to the RHS (subtracting the average).
RT xdoty (int amrlev, int mglev, const MultiFab &x, const MultiFab &y, bool local) const final
 Dot product helper.
RT dotProductPrecond (Vector< MultiFab const * > const &x, Vector< MultiFab const * > const &y) const final
 Dot product over the composite AMR hierarchy, excluding cells covered by finer levels (used when the operator is a preconditioner).
RT norm2Precond (Vector< MultiFab const * > const &x) const final
 L2 norm over the composite AMR hierarchy, excluding cells covered by finer levels (used when the operator is a preconditioner).
virtual void FFlux (int amrlev, const MFIter &mfi, const Array< FAB *, 3 > &flux, const FAB &sol, Location loc, int face_only=0) const=0
virtual void addInhomogNeumannFlux (int, const Array< MultiFab *, 3 > &, MultiFab const &, bool) const
 Optional hook for adding inhomogeneous Neumann contributions.
RT normInf (int amrlev, MultiFab const &mf, bool local) const override
 Infinity norm helper used by solvers and diagnostics.
void averageDownAndSync (Vector< MultiFab > &sol) const override
 Average the solution hierarchy down (fine-to-coarse) and sync.
void avgDownResAmr (int clev, MultiFab &cres, MultiFab const &fres) const override
 Average a residual from a fine AMR level to its coarse parent.
void beginPrecondBC () override
 Called when the operator starts being used as a preconditioner.
void endPrecondBC () override
 Called when the operator stops being used as a preconditioner.
void setInterpBndryHalfWidth (int w)
 Control how many cells the interpolation boundary stencil spans.
Public Member Functions inherited from amrex::MLLinOpT< MultiFab >
 MLLinOpT ()=default
virtual ~MLLinOpT ()=default
 MLLinOpT (const MLLinOpT< MultiFab > &)=delete
 MLLinOpT (MLLinOpT< MultiFab > &&)=delete
MLLinOpT< MultiFab > & operator= (const MLLinOpT< MultiFab > &)=delete
MLLinOpT< MultiFab > & operator= (MLLinOpT< MultiFab > &&)=delete
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info, const Vector< FabFactory< FAB > const * > &a_factory, bool eb_limit_coarsening=true)
 Initialize the operator hierarchy on a set of AMR levels.
void setDomainBC (const Array< BCType, 3 > &lobc, const Array< BCType, 3 > &hibc) noexcept
 Boundary of the whole domain.
void setDomainBC (const Vector< Array< BCType, 3 > > &lobc, const Vector< Array< BCType, 3 > > &hibc)
 Boundary of the whole domain.
void setDomainBCLoc (const Array< Real, 3 > &lo_bcloc, const Array< Real, 3 > &hi_bcloc) noexcept
 Set location offsets for the physical domain boundaries.
bool needsCoarseDataForBC () const noexcept
 Needs coarse data for bc?
void setCoarseFineBC (const MultiFab *crse, int crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
 Set coarse/fine boundary conditions. For cell-centered solves only.
void setCoarseFineBC (const MultiFab *crse, IntVect const &crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
void setCoarseFineBC (const AMF *crse, int crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
void setCoarseFineBC (const AMF *crse, IntVect const &crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
void setLevelBC (int amrlev, const AMF *levelbcdata, const AMF *robinbc_a=nullptr, const AMF *robinbc_b=nullptr, const AMF *robinbc_f=nullptr)
void setVerbose (int v) noexcept
 Set verbosity.
void setPrintIndentation (std::string s)
 Prefix printed messages (e.g., to indent per level).
void setMaxOrder (int o) noexcept
 Set order of interpolation at coarse/fine boundary.
int getMaxOrder () const noexcept
 Get order of interpolation at coarse/fine boundary.
void setEnforceSingularSolvable (bool o) noexcept
 Control whether the solver should try to make singular problems solvable.
bool getEnforceSingularSolvable () const noexcept
virtual bool supportCustomBottomSolver () const
 Does this operator provide its own bottom solver (BottomSolver::custom)?
virtual void customBottomSolve (MLMGT< MultiFab > *mlmg, MultiFab &x, const MultiFab &b, RT eps_rel, RT eps_abs, int maxiter)
 Bottom solve provided by the operator itself.
virtual int getNComp () const
 Return number of components.
virtual int getNGrow (int=0, int=0) const
virtual void interpCoarseFineSolution (int famrlev, MultiFab &fine_sol, const MultiFab &crse_sol) const
 Before a composite solve, set the solution at the nodes that fine AMR level famrlev takes from the coarse level (the coarse/fine nodes of MLNodeLaplacian) to the interpolated coarse solution. The solve only adds interpolated corrections there, so the result would otherwise depend on the initial guess. The default does nothing.
virtual void normalize (int amrlev, int mglev, MultiFab &mf) const
 Divide mf by the diagonal component of the operator. Used by the bottom solvers.
virtual void unimposeNeumannBC (int amrlev, MultiFab &rhs) const
 Undo Neumann contributions stored on the RHS.
virtual void applyInhomogNeumannTerm (int amrlev, MultiFab &rhs) const
 Add extra terms introduced when treating inhomogeneous Neumann BC as homogeneous.
virtual void applyOverset (int amrlev, MultiFab &rhs) const
 Overset-only hook for zeroing regions covered by masks.
virtual void preparePrecond ()
 Prepare auxiliary data used when the operator acts as a preconditioner.
virtual std::unique_ptr< MLLinOpT< MultiFab > > makeNLinOp (int grid_size) const
 Create the NSolve counterpart of this operator with the requested grid size.
virtual void getFluxes (const Vector< MultiFab * > &a_flux, const Vector< MultiFab * > &a_sol) const
 Extract fluxes when the operator stores them in single MultiFabs per level.
virtual void getEBFluxes (const Vector< MultiFab * > &a_flux, const Vector< MultiFab * > &a_sol) const
 Extract embedded-boundary fluxes.
virtual std::unique_ptr< MLAlgMG > makeAlgMG (int mglev) const
 Build the algebraic system of MG level mglev of AMR level 0 for the AlgMG solver. Operators that hypre supports implement this.
virtual bool supportsAlgMG () const
 True if makeAlgMG is implemented for this operator.
virtual bool supportsAnisotropicCoarsening () const
 True if the operator supports MG levels coarsened in any subset of directions. Then MLMG coarsens stretched cells only in their short directions until they are nearly cubic.
virtual GpuArray< Real, 3 > anisotropicCoarseningCellSize (Geometry const &geom) const
 Cell size used to pick the directions to coarsen when supportsAnisotropicCoarsening() is true. A direction with weaker coupling counts as having longer cells.
virtual bool supportNSolve () const
 Whether this operator supports NSolve.
virtual void copyNSolveSolution (MultiFab &dst, MultiFab const &src) const
 Copy an NSolve solution from src to dst.
virtual void postSolve (Vector< MultiFab * > const &sol) const
 Optional hook invoked after the main solve completes.
virtual void avgDownResMG (int clev, MultiFab &cres, MultiFab const &fres) const
 Average residuals from fine to coarse MG levels (FMG helper).
bool isMFIterSafe (int amrlev, int mglev1, int mglev2) const
 Check whether mixing MFIter loops for different MG levels is safe.
int NAMRLevels () const noexcept
 Return the number of AMR levels.
int NMGLevels (int amrlev) const noexcept
 Return the number of MG levels at given AMR level.
const Geometry & Geom (int amr_lev, int mglev=0) const noexcept
 Geometry accessor for (amr_lev,mglev).

Additional Inherited Members

Public Attributes inherited from amrex::MLCellLinOpT< MultiFab >
Vector< std::unique_ptr< MultiFab > > m_robin_bcval
Public Attributes inherited from amrex::MLLinOpT< MultiFab >
Vector< Array< BCType, 3 > > m_lobc
Vector< Array< BCType, 3 > > m_hibc
Vector< Array< BCType, 3 > > m_lobc_orig
Vector< Array< BCType, 3 > > m_hibc_orig
Protected Types inherited from amrex::MLCellLinOpT< MultiFab >
using RealTuple
using BCTuple
Protected Member Functions inherited from amrex::MLLinOpT< MultiFab >
const Vector< int > & AMRRefRatio () const noexcept
 Return AMR refinement ratios.
int AMRRefRatio (int amr_lev) const noexcept
 Return AMR refinement ratio at given AMR level.
IntVect AMRRefRatioVect (int amr_lev) const noexcept
 Return AMR refinement ratio as IntVect (1 in hidden direction).
FabFactory< FAB > const * Factory (int amr_lev, int mglev=0) const noexcept
GpuArray< BCType, 3 > LoBC (int icomp=0) const noexcept
GpuArray< BCType, 3 > HiBC (int icomp=0) const noexcept
bool hasBC (BCType bct) const noexcept
bool hasInhomogNeumannBC () const noexcept
bool hasRobinBC () const noexcept
virtual bool supportRobinBC () const noexcept
virtual bool supportInhomogNeumannBC () const noexcept
bool isBottomActive () const noexcept
MPI_Comm BottomCommunicator () const noexcept
MPI_Comm Communicator () const noexcept
void setCoarseFineBCLocation (const RealVect &cloc) noexcept
bool doAgglomeration () const noexcept
bool doConsolidation () const noexcept
bool doSemicoarsening () const noexcept
bool isCellCentered () const noexcept
virtual IntVect getNGrowVectRestriction () const
virtual void make (Vector< Vector< MultiFab > > &mf, IntVect const &ng) const
virtual MultiFab make (int amrlev, int mglev, IntVect const &ng) const
virtual MultiFab make (int amrlev, int mglev, IntVect const &ng, MFInfo const &mf_info) const
 As above, with caller-selected allocation metadata for temporary storage.
virtual MultiFab makeAlias (MultiFab const &mf) const
virtual MultiFab makeCoarseMG (int amrlev, int mglev, IntVect const &ng) const
 Allocate an MF on the next coarser MG level (mglev+1) with grow cells ng.
virtual MultiFab makeCoarseMG (int amrlev, int mglev, IntVect const &ng, MFInfo const &mf_info) const
 As above, with caller-selected allocation metadata for temporary storage.
virtual MultiFab makeCoarseAmr (int famrlev, IntVect const &ng) const
 Allocate an MF on the next coarser AMR level (famrlev-1) with grow cells ng.
virtual MultiFab makeCoarseAmr (int famrlev, IntVect const &ng, MFInfo const &mf_info) const
 As above, with caller-selected allocation metadata for temporary storage.
virtual std::unique_ptr< FabFactory< FAB > > makeFactory (int, int) const
virtual void resizeMultiGrid (int new_size)
void prepareMGHierarchy ()
 Build the deferred MG levels of AMR level 0 once. See supportsAnisotropicCoarsening.
virtual void buildMGHierarchy ()
 Build the MG levels of AMR level 0 below the finest one.
bool hasHiddenDimension () const noexcept
int hiddenDirection () const noexcept
Box compactify (Box const &b) const noexcept
Array4< T > compactify (Array4< T > const &a) const noexcept
T get_d0 (T const &dx, T const &dy, T const &) const noexcept
T get_d1 (T const &, T const &dy, T const &dz) const noexcept
Protected Attributes inherited from amrex::MLCellLinOpT< MultiFab >
bool m_has_metric_term
Vector< std::unique_ptr< MLMGBndryT< MultiFab > > > m_bndry_sol
Vector< std::unique_ptr< BndryRegisterT< MultiFab > > > m_crse_sol_br
Vector< std::unique_ptr< MLMGBndryT< MultiFab > > > m_bndry_cor
Vector< std::unique_ptr< BndryRegisterT< MultiFab > > > m_crse_cor_br
Vector< std::unique_ptr< MLMGBndryT< MultiFab > > > m_bndry_sol_zero
Vector< Vector< std::unique_ptr< BndryCondLoc > > > m_bcondloc
Vector< Vector< BndryRegisterT< MultiFab > > > m_undrrelxr
Vector< Vector< Array< MultiMask, 2 *3 > > > m_maskvals
Vector< std::unique_ptr< iMultiFab > > m_norm_fine_mask
Vector< YAFluxRegisterT< MultiFab > > m_fluxreg
bool m_use_gauss_seidel
Protected Attributes inherited from amrex::MLLinOpT< MultiFab >
int mg_box_min_width
int mg_domain_min_width
int mg_agg_no_split_direction
bool mg_odd_coarsening
bool mg_independent_coarsening
LPInfo info
int verbose
std::string print_ident
int maxorder
bool enforceSingularSolvable
bool m_mg_deferred
 MG levels of AMR level 0 built at first solve.
bool m_mg_built
int m_num_amr_levels
Vector< int > m_amr_ref_ratio
Vector< int > m_num_mg_levels
const MLLinOpT< MultiFab > * m_parent
IntVect m_ixtype
bool m_do_agglomeration
bool m_do_consolidation
bool m_do_semicoarsening
Vector< IntVect > mg_coarsen_ratio_vec
Vector< Vector< Geometry > > m_geom
 first Vector is for amr level and second is mg level
Vector< Vector< BoxArray > > m_grids
Vector< Vector< DistributionMapping > > m_dmap
Vector< Vector< std::unique_ptr< FabFactory< FAB > > > > m_factory
Vector< int > m_domain_covered
MPI_Comm m_default_comm
MPI_Comm m_bottom_comm
std::unique_ptr< CommContainer > m_raii_comm
Array< Real, 3 > m_domain_bloc_lo
Array< Real, 3 > m_domain_bloc_hi
bool m_needs_coarse_data_for_bc
LinOpBCType m_coarse_fine_bc_type
IntVect m_coarse_data_crse_ratio
RealVect m_coarse_bc_loc
const MultiFab * m_coarse_data_for_bc
MultiFab m_coarse_data_for_bc_raii
bool m_precond_mode
Static Protected Attributes inherited from amrex::MLLinOpT< MultiFab >
static constexpr int mg_coarsen_ratio

Detailed Description

Cell-centered Poisson operator on a terrain-following mesh.

The mesh is uniform in computational space, and the physical height of each cell corner is given by a nodal MultiFab (setZPhys). The operator is

L(phi) = div(A grad phi) / J,

where grad is the physical gradient in terrain-following form, A holds the face area factors (setAreas) and J is the cell volume factor (setDetJ). The flux on a Neumann domain face is zero. MLMG solves the J-scaled system div(A grad phi) = J rhs, so apply and the residuals compute div(A grad phi), without the division by J.

Only 3D, a single AMR level whose grids cover the domain, and homogeneous boundary conditions are supported. The level BC must be set with setLevelBC(0, nullptr). The operator is not symmetric; use BiCGStab or the smoother as the bottom solver. It can be used with MLMG or with GMRESMLMG, which always uses the smoother as the bottom solver. The semicoarsening settings in LPInfo are ignored.

Boxes that span the whole domain in z are fastest, but boxes split in z are also supported.

Member Typedef Documentation

◆ BCMode

◆ FAB

◆ Location

◆ MF

◆ RT

◆ StateMode

Member Enumeration Documentation

◆ ZSplitSolver

Line solver for levels whose boxes do not span z.

Enumerator
Spike 
Column 

Constructor & Destructor Documentation

◆ MLTerrainPoisson() [1/4]

amrex::MLTerrainPoisson::MLTerrainPoisson ( )
default

◆ MLTerrainPoisson() [2/4]

amrex::MLTerrainPoisson::MLTerrainPoisson ( const Vector< Geometry > & a_geom,
const Vector< BoxArray > & a_grids,
const Vector< DistributionMapping > & a_dmap,
const LPInfo & a_info = LPInfo() )

Construct the operator. See define().

◆ ~MLTerrainPoisson()

amrex::MLTerrainPoisson::~MLTerrainPoisson ( )
overridedefault

◆ MLTerrainPoisson() [3/4]

amrex::MLTerrainPoisson::MLTerrainPoisson ( const MLTerrainPoisson & )
delete

◆ MLTerrainPoisson() [4/4]

amrex::MLTerrainPoisson::MLTerrainPoisson ( MLTerrainPoisson && )
delete

Member Function Documentation

◆ applyBC()

void amrex::MLTerrainPoisson::applyBC ( int amrlev,
int mglev,
MultiFab & in,
BCMode bc_mode,
StateMode s_mode,
const MLMGBndryT< MultiFab > * bndry = nullptr,
bool skip_fillboundary = false ) const
overridevirtual

Apply physical BCs (optionally skipping FillBoundary).

Parameters
amrlevAMR level index.
mglevMultigrid level index.
inMultiFab whose boundary values are updated.
bc_modeBoundary-condition interpretation (solution vs correction).
s_modeState interpretation (solution or correction).
bndryOptional cached boundary data.
skip_fillboundaryTrue to assume ghost cells already filled.

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ bcInfo()

mlterrain::BCInfo amrex::MLTerrainPoisson::bcInfo ( int mglev) const
nodiscard

◆ coarsenRatio()

IntVect amrex::MLTerrainPoisson::coarsenRatio ( int mglev) const
nodiscard

◆ compGrad()

void amrex::MLTerrainPoisson::compGrad ( int amrlev,
const Array< MultiFab *, 3 > & grad,
MultiFab & sol,
Location loc ) const
overridevirtual

Compute the terrain-following gradient, i.e., the negative of the flux.

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ define()

void amrex::MLTerrainPoisson::define ( const Vector< Geometry > & a_geom,
const Vector< BoxArray > & a_grids,
const Vector< DistributionMapping > & a_dmap,
const LPInfo & a_info = LPInfo() )

Define the operator.

Parameters
a_geomGeometry. Only one AMR level is supported.
a_gridsBoxArray, which must cover the domain.
a_dmapDistributionMapping.
a_infoLPInfo.

◆ Fapply()

void amrex::MLTerrainPoisson::Fapply ( int amrlev,
int mglev,
MultiFab & out,
const MultiFab & in ) const
overridevirtual

◆ FFlux()

void amrex::MLTerrainPoisson::FFlux ( int amrlev,
const MFIter & mfi,
const Array< FAB *, 3 > & flux,
const FAB & sol,
Location loc,
int face_only = 0 ) const
override

◆ fillZPhysGhost()

void amrex::MLTerrainPoisson::fillZPhysGhost ( MultiFab & zp,
int mglev ) const

◆ Fsmooth()

void amrex::MLTerrainPoisson::Fsmooth ( int amrlev,
int mglev,
MultiFab & sol,
const MultiFab & rhs,
int redblack ) const
overridevirtual

◆ getDefaultBottomSolver()

BottomSolver amrex::MLTerrainPoisson::getDefaultBottomSolver ( ) const
inlinenodiscardoverridevirtual

The smoother if the coarsest level covers the domain with at most 5x5 columns, else BiCGStab.

Reimplemented from amrex::MLLinOpT< MultiFab >.

◆ getFluxes()

void amrex::MLTerrainPoisson::getFluxes ( const Vector< Array< MultiFab *, 3 > > & a_flux,
const Vector< MultiFab * > & a_sol,
Location a_loc ) const
overridevirtual

Compute the flux, the negative of the terrain-following gradient.

Reimplemented from amrex::MLLinOpT< MultiFab >.

◆ interpolation()

void amrex::MLTerrainPoisson::interpolation ( int amrlev,
int fmglev,
MultiFab & fine,
const MultiFab & crse ) const
overridevirtual

Add the prolongation of coarse data onto the fine grid (fine += prolong(crse)).

Parameters
amrlevAMR level index.
fmglevMultigrid level index within that AMR level.
fineDestination fine-grid data (updated in place).
crseSource coarse-grid data.

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ isBottomSingular()

bool amrex::MLTerrainPoisson::isBottomSingular ( ) const
inlinenodiscardoverridevirtual

Is the bottom of the multigrid hierarchy singular?

Implements amrex::MLLinOpT< MultiFab >.

◆ isCrossStencil()

bool amrex::MLTerrainPoisson::isCrossStencil ( ) const
inlinenodiscardoverridevirtual

Whether the stencil is the cross shape.

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ isSingular()

bool amrex::MLTerrainPoisson::isSingular ( int amrlev) const
inlinenodiscardoverridevirtual

Is it singular on AMR level amrlev?

Implements amrex::MLLinOpT< MultiFab >.

◆ name()

std::string amrex::MLTerrainPoisson::name ( ) const
inlinenodiscardoverridevirtual

Reimplemented from amrex::MLLinOpT< MultiFab >.

◆ needsUpdate()

bool amrex::MLTerrainPoisson::needsUpdate ( ) const
inlinenodiscardoverridevirtual

Does it need update if it's reused?

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ operator=() [1/2]

MLTerrainPoisson & amrex::MLTerrainPoisson::operator= ( const MLTerrainPoisson & )
delete

◆ operator=() [2/2]

MLTerrainPoisson & amrex::MLTerrainPoisson::operator= ( MLTerrainPoisson && )
delete

◆ prepareForSolve()

void amrex::MLTerrainPoisson::prepareForSolve ( )
overridevirtual

Prepare multilevel metadata before MLMG iterates (coefficients, BC caches, etc.).

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ scaleRHS()

bool amrex::MLTerrainPoisson::scaleRHS ( int amrlev,
MultiFab * rhs ) const
nodiscardoverridevirtual

Optionally scale the RHS to fix solvability.

Parameters
amrlevAMR level receiving the scaling.
rhsRHS pointer (may be null) scaled in place.
Returns
True if scaling occurred, false otherwise.

Reimplemented from amrex::MLLinOpT< MultiFab >.

◆ setAreas()

void amrex::MLTerrainPoisson::setAreas ( int amrlev,
Array< MultiFab const *, 3 > const & area )

Set the face area factors (required).

Parameters
amrlevAMR level (must be 0).
areaFace MultiFabs in x, y and z.

◆ setDetJ()

void amrex::MLTerrainPoisson::setDetJ ( int amrlev,
MultiFab const & detJ )

Set the cell volume factor J. If not set, J = 1.

Parameters
amrlevAMR level (must be 0).
detJCell-centered MultiFab.

◆ setDirichletNodesToZero()

void amrex::MLTerrainPoisson::setDirichletNodesToZero ( int ,
int ,
MultiFab &  ) const
inlineoverridevirtual

No-op: cell-centered unknowns are never on a Dirichlet boundary.

Reimplemented from amrex::MLLinOpT< MultiFab >.

◆ setZPhys()

void amrex::MLTerrainPoisson::setZPhys ( int amrlev,
MultiFab const & z_phys_nd )

Set the physical height of the cell corners.

Parameters
amrlevAMR level (must be 0).
z_phys_ndNodal MultiFab with at least one ghost node filled.

◆ setZSplitSolver()

void amrex::MLTerrainPoisson::setZSplitSolver ( ZSplitSolver a_solver)

Choose the solver used when boxes are split in z: Spike (the default) or Column.

◆ update()

void amrex::MLTerrainPoisson::update ( )
overridevirtual

Update for reuse.

Reimplemented from amrex::MLCellLinOpT< MultiFab >.

◆ updateCoefs()

void amrex::MLTerrainPoisson::updateCoefs ( )

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