Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::MLABecLaplacianT< MF > Class Template Reference

#include <AMReX_MLABecLaplacian.H>

Inheritance diagram for amrex::MLABecLaplacianT< MF >:
amrex::MLCellABecLapT< MF > amrex::MLCellLinOpT< MF > amrex::MLLinOpT< MF > amrex::MLTensorOp

Public Types

using FAB = typename MF::fab_type
 
using RT = typename MF::value_type
 
using BCType = LinOpBCType
 
using Location = typename MLLinOpT< MF >::Location
 
- Public Types inherited from amrex::MLCellABecLapT< MF >
using FAB = typename MF::fab_type
 
using RT = typename MF::value_type
 
using Location = typename MLLinOpT< MF >::Location
 
- Public Types inherited from amrex::MLCellLinOpT< MF >
using FAB = typename FabDataType< MF >::fab_type
 
using RT = typename FabDataType< MF >::value_type
 
using BCType = LinOpBCType
 
using BCMode = typename MLLinOpT< MF >::BCMode
 
using StateMode = typename MLLinOpT< MF >::StateMode
 
using Location = typename MLLinOpT< MF >::Location
 
- Public Types inherited from amrex::MLLinOpT< MF >
using MFType = MF
 
using FAB = typename FabDataType< MF >::fab_type
 
using RT = typename FabDataType< MF >::value_type
 
using BCType = LinOpBCType
 
using BCMode = LinOpEnumType::BCMode
 
using StateMode = LinOpEnumType::StateMode
 
using Location = LinOpEnumType::Location
 

Public Member Functions

 MLABecLaplacianT ()=default
 Construct an empty operator; call define() before solving.
 
 MLABecLaplacianT (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={}, int a_ncomp=1)
 Convenience constructor for cell-based solves without overset regions.
 
 MLABecLaplacianT (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const Vector< iMultiFab const * > &a_overset_mask, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={}, int a_ncomp=1)
 Convenience constructor that includes overset-mask handling (1 = unknown, 0 = known).
 
 ~MLABecLaplacianT () override
 
 MLABecLaplacianT (const MLABecLaplacianT< MF > &)=delete
 
 MLABecLaplacianT (MLABecLaplacianT< MF > &&)=delete
 
MLABecLaplacianT< MF > & operator= (const MLABecLaplacianT< MF > &)=delete
 
MLABecLaplacianT< MF > & operator= (MLABecLaplacianT< MF > &&)=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={}, int a_ncomp=1)
 Define coefficients/layouts for a standard cell-centered solve.
 
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const Vector< iMultiFab const * > &a_overset_mask, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={}, int a_ncomp=1)
 Define coefficients/layouts plus overset-mask information.
 
template<typename T1 , typename T2 >
requires (std::is_convertible_v<T1, typename MF::value_type> && std::is_convertible_v<T2, typename MF::value_type>)
void setScalars (T1 a, T2 b) noexcept
 
template<FabArrayType AMF>
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
void setACoeffs (int amrlev, const AMF &alpha)
 
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void setACoeffs (int amrlev, T alpha)
 
template<FabArrayType AMF>
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
void setBCoeffs (int amrlev, const Array< AMF const *, 3 > &beta)
 
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void setBCoeffs (int amrlev, T beta)
 
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void setBCoeffs (int amrlev, Vector< T > const &beta)
 
int getNComp () const override
 Return number of components.
 
bool needsUpdate () const override
 True if coefficients need to be averaged down before the next apply().
 
void update () override
 Average coefficients and enforce boundary-provided adjustments when needed.
 
void prepareForSolve () override
 Finalize singular flags and metric/Robin adjustments prior to calling MLMG.
 
bool isSingular (int amrlev) const override
 Query whether AMR level amrlev is singular (null space present).
 
bool isBottomSingular () const override
 Convenience helper for the coarsest level singularity flag.
 
void Fapply (int amrlev, int mglev, MF &out, const MF &in) const override
 Apply the operator on (amrlev,mglev), storing L(in) in out.
 
void Fsmooth (int amrlev, int mglev, MF &sol, const MF &rhs, int redblack) const override
 Perform one smoothing pass on (amrlev,mglev) updating sol against rhs. redblack selects the red (0) or black (1) half of the grid.
 
void FFlux (int amrlev, const MFIter &mfi, const Array< FAB *, 3 > &flux, const FAB &sol, Location, int face_only=0) const override
 Compute fluxes on AMR level amrlev for the tilebox described by mfi using sol, writing to flux and honoring face_only.
 
void normalize (int amrlev, int mglev, MF &mf) const override
 Divide mf by the diagonal of the operator (used by CG-family bottom solvers).
 
RT getAScalar () const final
 Scalar alpha applied to the a-coefficient term.
 
RT getBScalar () const final
 Scalar beta applied to the b-coefficient term.
 
MF const * getACoeffs (int amrlev, int mglev) const final
 Access the stored a coefficient on AMR level amrlev and MG level mglev.
 
Array< MF const *, 3 > getBCoeffs (int amrlev, int mglev) const final
 Access the stored b coefficients on AMR level amrlev and MG level mglev.
 
std::unique_ptr< MLLinOpT< MF > > makeNLinOp (int) const final
 Build the NSolve counterpart of this operator.
 
bool supportNSolve () const override
 Whether this operator supports NSolve.
 
void copyNSolveSolution (MF &dst, MF const &src) const final
 Copy an NSolve solution from src to dst.
 
void averageDownCoeffsSameAmrLevel (int amrlev, Vector< MF > &a, Vector< Array< MF, 3 > > &b)
 Average coefficients down within AMR level amrlev (fine-to-coarse multigrid) updating a and b.
 
void averageDownCoeffs ()
 Average a and b coefficients down across all AMR and MG levels.
 
void averageDownCoeffsToCoarseAmrLevel (int flev)
 Average coefficients from fine AMR level flev to coarse AMR level flev-1.
 
void applyMetricTermsCoeffs ()
 Apply metric factors to the stored coefficients when solving in mapped space.
 
void applyRobinBCTermsCoeffs ()
 Modify coefficients to honor Robin BC terms introduced at level boundaries.
 
- Public Member Functions inherited from amrex::MLCellABecLapT< MF >
 MLCellABecLapT ()=default
 
 ~MLCellABecLapT () override=default
 
 MLCellABecLapT (const MLCellABecLapT< MF > &)=delete
 
 MLCellABecLapT (MLCellABecLapT< MF > &&)=delete
 
MLCellABecLapT< MF > & operator= (const MLCellABecLapT< MF > &)=delete
 
MLCellABecLapT< MF > & operator= (MLCellABecLapT< MF > &&)=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={})
 Describe the AMR hierarchy when overset masks are not required.
 
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const Vector< iMultiFab const * > &a_overset_mask, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={})
 Describe the AMR hierarchy when overset masks participate.
 
iMultiFab const * getOversetMask (int amrlev, int mglev) const
 Overset mask for (amrlev,mglev); returns nullptr when not defined.
 
bool needsUpdate () const override
 Does it need update if it's reused?
 
void update () override
 Average coefficients/metrics when marked dirty.
 
void prepareForSolve () override
 Standard hook called before MLMG iterates (fixes BC data, etc.).
 
void setDirichletNodesToZero (int amrlev, int mglev, MF &mf) const override
 Zero out Dirichlet nodes on (amrlev,mglev) so that GMRES can treat them as known.
 
void getFluxes (const Vector< Array< MF *, 3 > > &a_flux, const Vector< MF * > &a_sol, Location a_loc) const final
 Fill per-face fluxes using the supplied solution hierarchy.
 
void getFluxes (const Vector< MF * > &a_flux, const Vector< MF * > &a_sol) const final
 Guard overload that aborts if called (cell-centered flux extraction requires per-direction face arrays).
 
void applyInhomogNeumannTerm (int amrlev, MF &rhs) const final
 Apply stored Neumann data to the RHS rhs on AMR level amrlev.
 
void addInhomogNeumannFlux (int amrlev, const Array< MF *, 3 > &grad, MF const &sol, bool mult_bcoef) const final
 Add inhomogeneous Neumann/Robin flux contributions into grad from sol (include b when mult_bcoef is true).
 
void applyOverset (int amrlev, MF &rhs) const override
 Zero RHS entries in rhs that are covered by overset masks on level amrlev.
 
- Public Member Functions inherited from amrex::MLCellLinOpT< MF >
 MLCellLinOpT ()
 
 ~MLCellLinOpT () override=default
 
 MLCellLinOpT (const MLCellLinOpT< MF > &)=delete
 
 MLCellLinOpT (MLCellLinOpT< MF > &&)=delete
 
MLCellLinOpT< MF > & operator= (const MLCellLinOpT< MF > &)=delete
 
MLCellLinOpT< MF > & operator= (MLCellLinOpT< MF > &&)=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 MF *levelbcdata, const MF *robinbc_a=nullptr, const MF *robinbc_b=nullptr, const MF *robinbc_f=nullptr) final
 Provide per-level inhomogeneous boundary data.
 
template<MultiFabLike AMF>
requires (!std::same_as<MF,AMF>)
void setLevelBC (int amrlev, const AMF *levelbcdata, const AMF *robinbc_a=nullptr, const AMF *robinbc_b=nullptr, const AMF *robinbc_f=nullptr)
 
bool needsUpdate () const override
 Does it need update if it's reused?
 
void update () override
 Update for reuse.
 
void setGaussSeidel (bool flag) noexcept
 Toggle Gauss–Seidel smoothing in place of Jacobi relaxation.
 
virtual bool isCrossStencil () const
 Whether the stencil is the cross shape.
 
virtual bool isTensorOp () const
 Whether this operator is a tensor solve.
 
void updateSolBC (int amrlev, const MF &crse_bcdata) const
 Refresh stored solution BC data from coarse inputs.
 
void updateCorBC (int amrlev, const MF &crse_bcdata) const
 Refresh stored correction BC data from coarse inputs.
 
virtual void applyBC (int amrlev, int mglev, MF &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MF > *bndry=nullptr, bool skip_fillboundary=false) const
 Apply physical BCs (optionally skipping FillBoundary).
 
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, MF &crse, MF &fine) const override
 Restrict a fine-grid field onto its coarse counterpart.
 
void interpolation (int amrlev, int fmglev, MF &fine, const MF &crse) const override
 Add the prolongation of coarse data onto the fine grid (fine += prolong(crse)).
 
void interpAssign (int amrlev, int fmglev, MF &fine, MF &crse) const override
 Overwrite fine data with the prolongation of coarse data (fine = prolong(crse)).
 
void interpolationAmr (int famrlev, MF &fine, const MF &crse, IntVect const &nghost) const override
 Prolong AMR-level data during FMG initialization.
 
void averageDownSolutionRHS (int camrlev, MF &crse_sol, MF &crse_rhs, const MF &fine_sol, const MF &fine_rhs) override
 Average fine solution/RHS onto the next coarser AMR level.
 
void apply (int amrlev, int mglev, MF &out, MF &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MF > *bndry=nullptr) const override
 Apply the linear operator with boundary conditions.
 
void smooth (int amrlev, int mglev, MF &sol, const MF &rhs, bool skip_fillboundary, int niter) const final
 Perform niter smoothing iterations on the supplied residual equation.
 
void solutionResidual (int amrlev, MF &resid, MF &x, const MF &b, const MF *crse_bcdata=nullptr) override
 Compute the residual resid = b - A(x) using solution boundary data.
 
void prepareForFluxes (int amrlev, const MF *crse_bcdata=nullptr) override
 Ensure BC caches are ready for flux computations (e.g., getFluxes).
 
void correctionResidual (int amrlev, int mglev, MF &resid, MF &x, const MF &b, BCMode bc_mode, const MF *crse_bcdata=nullptr) final
 Compute the correction residual with optional coarse data.
 
void reflux (int crse_amrlev, MF &res, const MF &crse_sol, const MF &, MF &, MF &fine_sol, const MF &) const final
 Reflux fine-level fluxes into the coarse residual.
 
void compFlux (int amrlev, const Array< MF *, 3 > &fluxes, MF &sol, Location loc) const override
 Compute face-centered fluxes from the supplied solution.
 
void compGrad (int amrlev, const Array< MF *, 3 > &grad, MF &sol, Location loc) const override
 Compute directional gradients of the solution.
 
void applyMetricTerm (int amrlev, int mglev, MF &rhs) const final
 Multiply the RHS by metric terms appropriate for curvilinear coordinates.
 
void unapplyMetricTerm (int amrlev, int mglev, MF &rhs) const final
 Remove metric scaling previously applied to the RHS.
 
Vector< RTgetSolvabilityOffset (int amrlev, int mglev, MF const &rhs) const override
 Compute the average offset needed to enforce solvability constraints.
 
void fixSolvabilityByOffset (int amrlev, int mglev, MF &rhs, Vector< RT > const &offset) const override
 Apply solvability offsets to the RHS (subtracting the average).
 
void prepareForSolve () override
 Prepare multilevel metadata before MLMG iterates (coefficients, BC caches, etc.).
 
RT xdoty (int amrlev, int mglev, const MF &x, const MF &y, bool local) const final
 Dot product helper.
 
RT dotProductPrecond (Vector< MF const * > const &x, Vector< MF 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< MF 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
 
RT normInf (int amrlev, MF const &mf, bool local) const override
 Infinity norm helper used by solvers and diagnostics.
 
void averageDownAndSync (Vector< MF > &sol) const override
 Average the solution hierarchy down (fine-to-coarse) and sync.
 
void avgDownResAmr (int clev, MF &cres, MF 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< MF >
 MLLinOpT ()=default
 
virtual ~MLLinOpT ()=default
 
 MLLinOpT (const MLLinOpT< MF > &)=delete
 
 MLLinOpT (MLLinOpT< MF > &&)=delete
 
MLLinOpT< MF > & operator= (const MLLinOpT< MF > &)=delete
 
MLLinOpT< MF > & operator= (MLLinOpT< MF > &&)=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.
 
virtual std::string name () const
 
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 MF *crse, int crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
 Set coarse/fine boundary conditions. For cell-centered solves only.
 
void setCoarseFineBC (const MF *crse, IntVect const &crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
 
template<typename AMF >
requires (!std::same_as<MF,AMF>)
void setCoarseFineBC (const AMF *crse, int crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
 
template<typename AMF >
requires (!std::same_as<MF,AMF>)
void setCoarseFineBC (const AMF *crse, IntVect const &crse_ratio, LinOpBCType bc_type=LinOpBCType::Dirichlet) noexcept
 
template<MultiFabLike AMF>
requires (!std::same_as<MF,AMF>)
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 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 BottomSolver getDefaultBottomSolver () const
 
virtual int getNGrow (int=0, int=0) const
 
virtual void unimposeNeumannBC (int amrlev, MF &rhs) const
 Undo Neumann contributions stored on the RHS.
 
virtual bool scaleRHS (int amrlev, MF *rhs) const
 Optionally scale the RHS to fix solvability.
 
virtual void preparePrecond ()
 Prepare auxiliary data used when the operator acts as a preconditioner.
 
virtual void getEBFluxes (const Vector< MF * > &a_flux, const Vector< MF * > &a_sol) const
 Extract embedded-boundary fluxes.
 
virtual void postSolve (Vector< MF * > const &sol) const
 Optional hook invoked after the main solve completes.
 
virtual void avgDownResMG (int clev, MF &cres, MF 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 GeometryGeom (int amr_lev, int mglev=0) const noexcept
 Geometry accessor for (amr_lev,mglev).
 

Static Public Member Functions

static void FFlux (Box const &box, Real const *dxinv, RT bscalar, Array< FAB const *, 3 > const &bcoef, Array< FAB *, 3 > const &flux, FAB const &sol, int face_only, int ncomp)
 Helper that computes face fluxes for a single tilebox.
 

Public Attributes

RT m_a_scalar = std::numeric_limits<RT>::quiet_NaN()
 
RT m_b_scalar = std::numeric_limits<RT>::quiet_NaN()
 
Vector< Vector< MF > > m_a_coeffs
 
Vector< Vector< Array< MF, 3 > > > m_b_coeffs
 
bool m_scalars_set = false
 
bool m_acoef_set = false
 
- Public Attributes inherited from amrex::MLCellLinOpT< MF >
Vector< std::unique_ptr< MF > > m_robin_bcval
 
- Public Attributes inherited from amrex::MLLinOpT< MF >
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 Member Functions

bool supportRobinBC () const noexcept override
 
- Protected Member Functions inherited from amrex::MLCellABecLapT< MF >
bool supportInhomogNeumannBC () const noexcept override
 
- Protected Member Functions inherited from amrex::MLLinOpT< MF >
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
 
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< MF > > &mf, IntVect const &ng) const
 
virtual MF make (int amrlev, int mglev, IntVect const &ng) const
 
virtual MF makeAlias (MF const &mf) const
 
virtual MF 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 MF makeCoarseAmr (int famrlev, IntVect const &ng) const
 Allocate an MF on the next coarser AMR level (famrlev-1) with grow cells ng.
 
virtual std::unique_ptr< FabFactory< FAB > > makeFactory (int, int) const
 
virtual void resizeMultiGrid (int new_size)
 
bool hasHiddenDimension () const noexcept
 
int hiddenDirection () const noexcept
 
Box compactify (Box const &b) const noexcept
 
template<typename T >
Array4< T > compactify (Array4< T > const &a) const noexcept
 
template<typename T >
get_d0 (T const &dx, T const &dy, T const &) const noexcept
 
template<typename T >
get_d1 (T const &, T const &dy, T const &dz) const noexcept
 

Protected Attributes

Vector< intm_is_singular
 
- Protected Attributes inherited from amrex::MLCellABecLapT< MF >
Vector< Vector< std::unique_ptr< iMultiFab > > > m_overset_mask
 
LPInfo m_lpinfo_arg
 
- Protected Attributes inherited from amrex::MLCellLinOpT< MF >
bool m_has_metric_term = false
 
Vector< std::unique_ptr< MLMGBndryT< MF > > > m_bndry_sol
 
Vector< std::unique_ptr< BndryRegisterT< MF > > > m_crse_sol_br
 
Vector< std::unique_ptr< MLMGBndryT< MF > > > m_bndry_cor
 
Vector< std::unique_ptr< BndryRegisterT< MF > > > m_crse_cor_br
 
Vector< std::unique_ptr< MLMGBndryT< MF > > > m_bndry_sol_zero
 
Vector< Vector< std::unique_ptr< BndryCondLoc > > > m_bcondloc
 
Vector< Vector< BndryRegisterT< MF > > > m_undrrelxr
 
Vector< Vector< Array< MultiMask, 2 *3 > > > m_maskvals
 
Vector< std::unique_ptr< iMultiFab > > m_norm_fine_mask
 
Vector< YAFluxRegisterT< MF > > m_fluxreg
 
bool m_use_gauss_seidel = true
 
- Protected Attributes inherited from amrex::MLLinOpT< MF >
int mg_domain_min_width = 2
 
LPInfo info
 
int verbose = 0
 
int maxorder = 3
 
bool enforceSingularSolvable = true
 
int m_num_amr_levels = 0
 
Vector< intm_amr_ref_ratio
 
Vector< intm_num_mg_levels
 
const MLLinOpT< MF > * m_parent = nullptr
 
IntVect m_ixtype
 
bool m_do_agglomeration = false
 
bool m_do_consolidation = false
 
bool m_do_semicoarsening = false
 
Vector< IntVectmg_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< intm_domain_covered
 
MPI_Comm m_default_comm = MPI_COMM_NULL
 
MPI_Comm m_bottom_comm = MPI_COMM_NULL
 
std::unique_ptr< CommContainer > m_raii_comm
 
Array< Real, 3 > m_domain_bloc_lo {{ 0._rt , 0._rt , 0._rt }}
 
Array< Real, 3 > m_domain_bloc_hi {{ 0._rt , 0._rt , 0._rt }}
 
bool m_needs_coarse_data_for_bc = false
 
LinOpBCType m_coarse_fine_bc_type = LinOpBCType::Dirichlet
 
IntVect m_coarse_data_crse_ratio = IntVect(-1)
 
RealVect m_coarse_bc_loc
 
const MF * m_coarse_data_for_bc = nullptr
 
MF m_coarse_data_for_bc_raii
 
bool m_precond_mode = false
 

Additional Inherited Members

- Protected Types inherited from amrex::MLCellLinOpT< MF >
using RealTuple = Array< RT, 2 *3 >
 
using BCTuple = Array< BoundCond, 2 *3 >
 
- Static Protected Attributes inherited from amrex::MLLinOpT< MF >
static constexpr int mg_coarsen_ratio = 2
 
static constexpr int mg_box_min_width = 2
 

Detailed Description

template<typename MF>
class amrex::MLABecLaplacianT< MF >

(alpha * a - beta * (del dot b grad)) phi

Member Typedef Documentation

◆ BCType

template<typename MF >
using amrex::MLABecLaplacianT< MF >::BCType = LinOpBCType

◆ FAB

template<typename MF >
using amrex::MLABecLaplacianT< MF >::FAB = typename MF::fab_type

◆ Location

template<typename MF >
using amrex::MLABecLaplacianT< MF >::Location = typename MLLinOpT<MF>::Location

◆ RT

template<typename MF >
using amrex::MLABecLaplacianT< MF >::RT = typename MF::value_type

Constructor & Destructor Documentation

◆ MLABecLaplacianT() [1/5]

template<typename MF >
amrex::MLABecLaplacianT< MF >::MLABecLaplacianT ( )
default

Construct an empty operator; call define() before solving.

◆ MLABecLaplacianT() [2/5]

template<typename MF >
amrex::MLABecLaplacianT< MF >::MLABecLaplacianT ( 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 = {},
int  a_ncomp = 1 
)

Convenience constructor for cell-based solves without overset regions.

◆ MLABecLaplacianT() [3/5]

template<typename MF >
amrex::MLABecLaplacianT< MF >::MLABecLaplacianT ( const Vector< Geometry > &  a_geom,
const Vector< BoxArray > &  a_grids,
const Vector< DistributionMapping > &  a_dmap,
const Vector< iMultiFab const * > &  a_overset_mask,
const LPInfo a_info = LPInfo(),
const Vector< FabFactory< FAB > const * > &  a_factory = {},
int  a_ncomp = 1 
)

Convenience constructor that includes overset-mask handling (1 = unknown, 0 = known).

◆ ~MLABecLaplacianT()

template<typename MF >
amrex::MLABecLaplacianT< MF >::~MLABecLaplacianT ( )
overridedefault

◆ MLABecLaplacianT() [4/5]

template<typename MF >
amrex::MLABecLaplacianT< MF >::MLABecLaplacianT ( const MLABecLaplacianT< MF > &  )
delete

◆ MLABecLaplacianT() [5/5]

template<typename MF >
amrex::MLABecLaplacianT< MF >::MLABecLaplacianT ( MLABecLaplacianT< MF > &&  )
delete

Member Function Documentation

◆ applyMetricTermsCoeffs()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::applyMetricTermsCoeffs ( )

Apply metric factors to the stored coefficients when solving in mapped space.

◆ applyRobinBCTermsCoeffs()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::applyRobinBCTermsCoeffs ( )

Modify coefficients to honor Robin BC terms introduced at level boundaries.

◆ averageDownCoeffs()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::averageDownCoeffs ( )

Average a and b coefficients down across all AMR and MG levels.

◆ averageDownCoeffsSameAmrLevel()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::averageDownCoeffsSameAmrLevel ( int  amrlev,
Vector< MF > &  a,
Vector< Array< MF, 3 > > &  b 
)

Average coefficients down within AMR level amrlev (fine-to-coarse multigrid) updating a and b.

◆ averageDownCoeffsToCoarseAmrLevel()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::averageDownCoeffsToCoarseAmrLevel ( int  flev)

Average coefficients from fine AMR level flev to coarse AMR level flev-1.

◆ copyNSolveSolution()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::copyNSolveSolution ( MF &  dst,
MF const &  src 
) const
finalvirtual

Copy an NSolve solution from src to dst.

Reimplemented from amrex::MLLinOpT< MF >.

◆ define() [1/2]

template<typename MF >
void amrex::MLABecLaplacianT< MF >::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 = {},
int  a_ncomp = 1 
)

Define coefficients/layouts for a standard cell-centered solve.

Parameters
a_geomPer-level geometries.
a_gridsPer-level grids.
a_dmapDistribution mappings.
a_infoOptional LPInfo overrides.
a_factoryOptional FAB factories.
a_ncompNumber of components handled by the operator.

◆ define() [2/2]

template<typename MF >
void amrex::MLABecLaplacianT< MF >::define ( const Vector< Geometry > &  a_geom,
const Vector< BoxArray > &  a_grids,
const Vector< DistributionMapping > &  a_dmap,
const Vector< iMultiFab const * > &  a_overset_mask,
const LPInfo a_info = LPInfo(),
const Vector< FabFactory< FAB > const * > &  a_factory = {},
int  a_ncomp = 1 
)

Define coefficients/layouts plus overset-mask information.

Parameters
a_geomPer-level geometries.
a_gridsPer-level grids.
a_dmapDistribution mappings.
a_overset_maskOverset masks (1 unknown, 0 known).
a_infoOptional LPInfo overrides.
a_factoryOptional FAB factories.
a_ncompNumber of components handled.

◆ Fapply()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::Fapply ( int  amrlev,
int  mglev,
MF &  out,
const MF &  in 
) const
overridevirtual

Apply the operator on (amrlev,mglev), storing L(in) in out.

Implements amrex::MLCellLinOpT< MF >.

◆ FFlux() [1/2]

template<typename MF >
void amrex::MLABecLaplacianT< MF >::FFlux ( Box const &  box,
Real const *  dxinv,
RT  bscalar,
Array< FAB const *, 3 > const &  bcoef,
Array< FAB *, 3 > const &  flux,
FAB const &  sol,
int  face_only,
int  ncomp 
)
static

Helper that computes face fluxes for a single tilebox.

Parameters
boxTilebox region whose faces receive fluxes.
dxinvMetric factors (1/dx per dimension).
bscalarScalar multiplier applied to each b coefficient.
bcoefFace-centered b coefficients per direction.
fluxOutput flux arrays per direction.
solCell-centered solution supplying gradients.
face_onlyNon-zero to fill faces only (skip centroids).
ncompNumber of components to process.

◆ FFlux() [2/2]

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

Compute fluxes on AMR level amrlev for the tilebox described by mfi using sol, writing to flux and honoring face_only.

◆ Fsmooth()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::Fsmooth ( int  amrlev,
int  mglev,
MF &  sol,
const MF &  rhs,
int  redblack 
) const
overridevirtual

Perform one smoothing pass on (amrlev,mglev) updating sol against rhs. redblack selects the red (0) or black (1) half of the grid.

Implements amrex::MLCellLinOpT< MF >.

◆ getACoeffs()

template<typename MF >
MF const * amrex::MLABecLaplacianT< MF >::getACoeffs ( int  amrlev,
int  mglev 
) const
inlinefinalvirtual

Access the stored a coefficient on AMR level amrlev and MG level mglev.

Implements amrex::MLCellABecLapT< MF >.

◆ getAScalar()

template<typename MF >
RT amrex::MLABecLaplacianT< MF >::getAScalar ( ) const
inlinefinalvirtual

Scalar alpha applied to the a-coefficient term.

Implements amrex::MLCellABecLapT< MF >.

◆ getBCoeffs()

template<typename MF >
Array< MF const *, 3 > amrex::MLABecLaplacianT< MF >::getBCoeffs ( int  amrlev,
int  mglev 
) const
inlinefinalvirtual

Access the stored b coefficients on AMR level amrlev and MG level mglev.

Implements amrex::MLCellABecLapT< MF >.

◆ getBScalar()

template<typename MF >
RT amrex::MLABecLaplacianT< MF >::getBScalar ( ) const
inlinefinalvirtual

Scalar beta applied to the b-coefficient term.

Implements amrex::MLCellABecLapT< MF >.

◆ getNComp()

template<typename MF >
int amrex::MLABecLaplacianT< MF >::getNComp ( ) const
inlineoverridevirtual

Return number of components.

Reimplemented from amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

◆ isBottomSingular()

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::isBottomSingular ( ) const
inlineoverridevirtual

Convenience helper for the coarsest level singularity flag.

Implements amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

◆ isSingular()

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::isSingular ( int  amrlev) const
inlineoverridevirtual

Query whether AMR level amrlev is singular (null space present).

Implements amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

◆ makeNLinOp()

template<typename MF >
std::unique_ptr< MLLinOpT< MF > > amrex::MLABecLaplacianT< MF >::makeNLinOp ( int  ) const
finalvirtual

Build the NSolve counterpart of this operator.

Reimplemented from amrex::MLLinOpT< MF >.

◆ needsUpdate()

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::needsUpdate ( ) const
inlineoverridevirtual

True if coefficients need to be averaged down before the next apply().

Reimplemented from amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

◆ normalize()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::normalize ( int  amrlev,
int  mglev,
MF &  mf 
) const
overridevirtual

Divide mf by the diagonal of the operator (used by CG-family bottom solvers).

Reimplemented from amrex::MLLinOpT< MF >.

◆ operator=() [1/2]

template<typename MF >
MLABecLaplacianT< MF > & amrex::MLABecLaplacianT< MF >::operator= ( const MLABecLaplacianT< MF > &  )
delete

◆ operator=() [2/2]

template<typename MF >
MLABecLaplacianT< MF > & amrex::MLABecLaplacianT< MF >::operator= ( MLABecLaplacianT< MF > &&  )
delete

◆ prepareForSolve()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::prepareForSolve ( )
overridevirtual

Finalize singular flags and metric/Robin adjustments prior to calling MLMG.

Implements amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

◆ setACoeffs() [1/2]

template<typename MF >
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
template<FabArrayType AMF>
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setACoeffs ( int  amrlev,
const AMF &  alpha 
)

Sets alpha as a scalar field to values from a single component multifab.

Parameters
[in]amrlevThe level of the multifab for the solver, with amrlev = 0 always being the lowest level in the AMR hierarchy represented in the solve.
[in]alphaMultifab of alpha values.

◆ setACoeffs() [2/2]

template<typename MF >
requires (std::is_convertible_v<T, typename MF::value_type>)
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setACoeffs ( int  amrlev,
alpha 
)

Sets alpha as a single scalar constant value across the multifab.

Parameters
[in]amrlevThe level of the multifab for the solver, with amrlev = 0 always being the lowest level in the AMR hierarchy represented in the solve.
[in]alphaSingle scalar value to populate across multifab.

◆ setBCoeffs() [1/3]

template<typename MF >
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
template<FabArrayType AMF>
requires (std::is_convertible_v<typename AMF::value_type, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setBCoeffs ( int  amrlev,
const Array< AMF const *, 3 > &  beta 
)

Sets beta as a scalar field to be the values defined in the supplied multifabs (one for each space dimension).

Parameters
[in]amrlevThe level of the multifab for the solver, with amrlev = 0 always being the lowest level in the AMR hierarchy represented in the solve.
[in]betaArray of Multifabs of beta values.

◆ setBCoeffs() [2/3]

template<typename MF >
requires (std::is_convertible_v<T, typename MF::value_type>)
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setBCoeffs ( int  amrlev,
beta 
)

Sets beta as a single scalar constant value across the multifabs (one for each dimension).

Parameters
[in]amrlevThe level of the multifab for the solver, with amrlev = 0 always being the lowest level in the AMR hierarchy represented in the solve.
[in]betaSingle scalar value to populate across multifabs.

◆ setBCoeffs() [3/3]

template<typename MF >
requires (std::is_convertible_v<T, typename MF::value_type>)
template<typename T >
requires (std::is_convertible_v<T, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setBCoeffs ( int  amrlev,
Vector< T > const &  beta 
)

Set each beta component to a single scalar constant value corresponding to the respective component of the supplied vector.

Parameters
[in]amrlevThe level of the multifab for the solver, with amrlev = 0 always being the lowest level in the AMR hierarchy represented in the solve.
[in]betaVector of scalar constant values.

◆ setScalars()

template<typename MF >
requires (std::is_convertible_v<T1, typename MF::value_type> && std::is_convertible_v<T2, typename MF::value_type>)
template<typename T1 , typename T2 >
requires (std::is_convertible_v<T1, typename MF::value_type> && std::is_convertible_v<T2, typename MF::value_type>)
void amrex::MLABecLaplacianT< MF >::setScalars ( T1  a,
T2  b 
)
noexcept

Set scalar constants A and B in the equation: (A \alpha - B \nabla \cdot \beta \nabla ) \phi = f for the Multi-Level AB Laplacian Solver.

◆ supportNSolve()

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::supportNSolve ( ) const
overridevirtual

Whether this operator supports NSolve.

Reimplemented from amrex::MLLinOpT< MF >.

◆ supportRobinBC()

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::supportRobinBC ( ) const
inlineoverrideprotectedvirtualnoexcept

Reimplemented from amrex::MLLinOpT< MF >.

◆ update()

template<typename MF >
void amrex::MLABecLaplacianT< MF >::update ( )
overridevirtual

Average coefficients and enforce boundary-provided adjustments when needed.

Reimplemented from amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLTensorOp.

Member Data Documentation

◆ m_a_coeffs

template<typename MF >
Vector<Vector<MF> > amrex::MLABecLaplacianT< MF >::m_a_coeffs

◆ m_a_scalar

template<typename MF >
RT amrex::MLABecLaplacianT< MF >::m_a_scalar = std::numeric_limits<RT>::quiet_NaN()

◆ m_acoef_set

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::m_acoef_set = false

◆ m_b_coeffs

template<typename MF >
Vector<Vector<Array<MF,3> > > amrex::MLABecLaplacianT< MF >::m_b_coeffs

◆ m_b_scalar

template<typename MF >
RT amrex::MLABecLaplacianT< MF >::m_b_scalar = std::numeric_limits<RT>::quiet_NaN()

◆ m_is_singular

template<typename MF >
Vector<int> amrex::MLABecLaplacianT< MF >::m_is_singular
protected

◆ m_scalars_set

template<typename MF >
bool amrex::MLABecLaplacianT< MF >::m_scalars_set = false

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