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

#include <AMReX_MLNodeLinOp.H>

Inheritance diagram for amrex::MLNodeLinOpT< MF >:
amrex::MLLinOpT< MF > amrex::MLNodeLaplacianT< MF >

Public Types

using FAB = typename MLLinOpT<MF>::FAB
using RT = typename MLLinOpT<MF>::RT
using BCType = typename MLLinOpT<MF>::BCType
using BCMode = typename MLLinOpT<MF>::BCMode
using StateMode = typename MLLinOpT<MF>::StateMode
using Location = typename MLLinOpT<MF>::Location
using CoarseningStrategy = MLNodeLinOpCoarseningStrategy
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

 MLNodeLinOpT ()
 ~MLNodeLinOpT () override=default
 MLNodeLinOpT (const MLNodeLinOpT &)=delete
 MLNodeLinOpT (MLNodeLinOpT &&)=delete
MLNodeLinOpT & operator= (const MLNodeLinOpT &)=delete
MLNodeLinOpT & operator= (MLNodeLinOpT &&)=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_eb_limit_coarsening=-1)
 Bind the nodal operator to an AMR hierarchy.
void setSmoothNumSweeps (int nsweeps) noexcept
 Control how many smoother passes are executed inside each Fsmooth call.
void setLevelBC (int, const MF *, const MF *=nullptr, const MF *=nullptr, const MF *=nullptr) final
 Set boundary conditions for given level. For cell-centered solves only.
void apply (int amrlev, int mglev, MF &out, MF &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MF > *bndry=nullptr) const final
 Apply the nodal operator with the requested BC/state modes.
void smooth (int amrlev, int mglev, MF &sol, const MF &rhs, bool skip_fillboundary, int niter) const override
 Invoke the nodal smoother on (amrlev,mglev).
void solutionResidual (int amrlev, MF &resid, MF &x, const MF &b, const MF *crse_bcdata=nullptr) override
 Residual helper that uses solution BCs and optional coarse data (operates on AMR level amrlev).
void correctionResidual (int amrlev, int mglev, MF &resid, MF &x, const MF &b, BCMode bc_mode, const MF *crse_bcdata=nullptr) override
 Residual helper for correction solves (optionally homogeneous BCs) on (amrlev,mglev).
Vector< RT > getSolvabilityOffset (int amrlev, int mglev, MF const &rhs) const override
 Return component-wise solvability offsets for (amrlev,mglev, rhs).
void fixSolvabilityByOffset (int amrlev, int mglev, MF &rhs, Vector< RT > const &offset) const override
 Subtract offsets produced by getSolvabilityOffset() from rhs.
void prepareForSolve () override
 Prepare BC caches, masks, and metadata prior to solving.
void preparePrecond () override
 Prepare auxiliary data used when the operator acts as a preconditioner.
void setDirichletNodesToZero (int amrlev, int mglev, MF &mf) const override
 Zero Dirichlet nodes in mf before a correction or residual pass.
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?
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 used when the operator acts as a preconditioner.
RT norm2Precond (Vector< MF const * > const &x) const final
 L2 norm used when the operator acts as a preconditioner.
virtual void applyBC (int amrlev, int mglev, MF &phi, BCMode bc_mode, StateMode state_mode, bool skip_fillboundary=false) const
 Apply physical BCs prior to smoothing/apply.
virtual void Fapply (int amrlev, int mglev, MF &out, const MF &in) const =0
 Low-level apply invoked by the base class.
virtual void Fsmooth (int amrlev, int mglev, MF &sol, const MF &rhs) const =0
 Low-level smoother invoked by the base class.
void nodalSync (int amrlev, int mglev, MF &mf) const
 Synchronize nodal values across box/partition boundaries on (amrlev,mglev).
void buildMasks ()
 Build Dirichlet/dot-product masks and determine bottom singularity.
void setOversetMask (int amrlev, const iMultiFab &a_dmask)
 Mark nodes that belong to overset (known) regions.
void applyOverset (int amrlev, MF &mf) const override
 Zero mf at the known nodes of the overset mask.
virtual void fixUpResidualMask (int, iMultiFab &)
RT normInf (int amrlev, MF const &mf, bool local) const override
 Infinity norm helper operating on level amrlev (set local to true to skip MPI reduction).
void avgDownResAmr (int, MF &, MF const &) const final
 Nodal average-down for residuals between AMR levels (no-op here).
void interpolationAmr (int famrlev, MF &fine, const MF &crse, IntVect const &nghost) const override
 Prolong AMR-level data during FMG initialization.
void averageDownAndSync (Vector< MF > &sol) const override
 Average nodal solutions down the AMR hierarchy and synchronize overlaps.
void interpAssign (int amrlev, int fmglev, MF &fine, MF &crse) const override
 Overwrite fine data with the prolongation of coarse data (fine = prolong(crse)).
std::unique_ptr< MLAlgMG > makeAlgMG (int mglev) const override
 Build the algebraic system of MG level mglev of AMR level 0 for the AlgMG solver. Operators that hypre supports implement this.
virtual void fillAlgMatrix (int, MFIter const &, Array4< Long const > const &, Array4< int const > const &, Long *, Long *, Real *) const
 Fill the matrix rows of one box for the algebraic solver.
virtual void fillRHS (int, MFIter const &, Array4< int const > const &, Real *, Array4< Real const > const &) const
 Fill the right-hand side of the rows of one box on MG level mglev.
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 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 BottomSolver getDefaultBottomSolver () const
virtual bool supportCustomBottomSolver () const
 Does this operator provide its own bottom solver (BottomSolver::custom)?
virtual void customBottomSolve (MLMGT< MF > *mlmg, MF &x, const MF &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 bool needsUpdate () const
 Does it need update if it's reused?
virtual void update ()
 Update for reuse.
virtual void restriction (int amrlev, int cmglev, MF &crse, MF &fine) const =0
 Restriction onto coarse MG level.
virtual void interpolation (int amrlev, int fmglev, MF &fine, const MF &crse) const =0
 Add interpolated coarse MG level data to fine MG level data.
virtual void interpCoarseFineSolution (int famrlev, MF &fine_sol, const MF &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 averageDownSolutionRHS (int camrlev, MF &crse_sol, MF &crse_rhs, const MF &fine_sol, const MF &fine_rhs)
 Average-down data from fine AMR level to coarse AMR level.
virtual void normalize (int amrlev, int mglev, MF &mf) const
 Divide mf by the diagonal component of the operator. Used by the bottom solvers.
virtual void prepareForFluxes (int amrlev, const MF *crse_bcdata=nullptr)
 Ensure BC caches are populated before flux extraction.
virtual void reflux (int crse_amrlev, MF &res, const MF &crse_sol, const MF &crse_rhs, MF &fine_res, MF &fine_sol, const MF &fine_rhs) const
 Reflux at AMR coarse/fine boundary.
virtual void compFlux (int amrlev, const Array< MF *, 3 > &fluxes, MF &sol, Location loc) const
 Compute fluxes.
virtual void compGrad (int amrlev, const Array< MF *, 3 > &grad, MF &sol, Location loc) const
 Compute gradients of the solution.
virtual void applyMetricTerm (int amrlev, int mglev, MF &rhs) const
 Apply metric scaling to the RHS on (amrlev,mglev).
virtual void unapplyMetricTerm (int amrlev, int mglev, MF &rhs) const
 Remove metric scaling previously applied via applyMetricTerm().
virtual void unimposeNeumannBC (int amrlev, MF &rhs) const
 Undo Neumann contributions stored on the RHS.
virtual void applyInhomogNeumannTerm (int amrlev, MF &rhs) const
 Add extra terms introduced when treating inhomogeneous Neumann BC as homogeneous.
virtual bool scaleRHS (int amrlev, MF *rhs) const
 Optionally scale the RHS to fix solvability.
virtual std::unique_ptr< MLLinOpT< MF > > makeNLinOp (int grid_size) const
 Create the NSolve counterpart of this operator with the requested grid size.
virtual void getFluxes (const Vector< Array< MF *, 3 > > &a_flux, const Vector< MF * > &a_sol, Location a_loc) const
 Extract per-direction fluxes for each AMR level.
virtual void getFluxes (const Vector< MF * > &a_flux, const Vector< MF * > &a_sol) const
 Extract fluxes when the operator stores them in single MultiFabs per level.
virtual void getEBFluxes (const Vector< MF * > &a_flux, const Vector< MF * > &a_sol) const
 Extract embedded-boundary fluxes.
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 bool supportsMixedPrecision () const
bool isMixedPrecision () const noexcept
 True if this operator has a single precision copy for mixed precision.
virtual void copyNSolveSolution (MF &dst, MF const &src) const
 Copy an NSolve solution from src to dst.
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).
virtual void beginPrecondBC ()
 Called when the operator starts being used as a preconditioner.
virtual void endPrecondBC ()
 Called when the operator stops being used as a preconditioner.
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).

Static Public Member Functions

static std::unique_ptr< iMultiFab > makeOwnerMask (const BoxArray &ba, const DistributionMapping &dm, const Geometry &geom)
 Build a nodal mask that marks points owned by this rank (used for sync).

Protected Member Functions

void spCopySettings () override
void resizeMultiGrid (int new_size) override
void buildMGHierarchy () override
 Build the MG levels of AMR level 0 below the finest one.
Protected Member Functions inherited from amrex::MLLinOpT< MF >
int spMetricExponent () const noexcept
Vector< Geometry > spGeom (const Vector< Geometry > &a_geom)
LPInfo dpInfo (LPInfo const &a_info) const
template<typename F>
void makeSPLinOp (LPInfo const &a_info, F const &f)
template<template< typename > class Op, typename F>
void spForward (F const &f)
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< MF > > &mf, IntVect const &ng) const
virtual MF make (int amrlev, int mglev, IntVect const &ng) const
virtual MF make (int amrlev, int mglev, IntVect const &ng, MFInfo const &mf_info) const
 As above, with caller-selected allocation metadata for temporary storage.
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 makeCoarseMG (int amrlev, int mglev, IntVect const &ng, MFInfo const &mf_info) const
 As above, with caller-selected allocation metadata for temporary storage.
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 MF 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
void prepareMGHierarchy ()
 Build the deferred MG levels of AMR level 0 once. See supportsAnisotropicCoarsening.
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>
T get_d0 (T const &dx, T const &dy, T const &) const noexcept
template<typename T>
T get_d1 (T const &, T const &dy, T const &dz) const noexcept

Static Protected Member Functions

static GpuArray< RT, 3 > toRT (GpuArray< Real, 3 > const &a) noexcept
 Convert a geometry array to RT.
Static Protected Member Functions inherited from amrex::MLLinOpT< MF >
static RT spScaleFor (RT x) noexcept
 The power of two p with p*x in [0.5,1), or 1 if x is zero or not finite.
static RT spDiagForScale (Vector< RT > const &diag) noexcept

Protected Attributes

std::unique_ptr< iMultiFab > m_owner_mask_top
std::unique_ptr< iMultiFab > m_owner_mask_bottom
Vector< Vector< std::unique_ptr< iMultiFab > > > m_dirichlet_mask
Vector< std::unique_ptr< iMultiFab > > m_cc_fine_mask
Vector< std::unique_ptr< iMultiFab > > m_nd_fine_mask
Vector< std::unique_ptr< LayoutData< int > > > m_has_fine_bndry
MF m_bottom_dot_mask
MF m_coarse_dot_mask
Vector< MF > m_precond_weight_mask
Vector< std::unique_ptr< iMultiFab > > m_norm_fine_mask
CoarseningStrategy m_coarsening_strategy = CoarseningStrategy::RAP
bool m_masks_built = false
bool m_overset_dirichlet_mask = false
int m_smooth_num_sweeps = 2
bool m_in_solution_mode = true
Protected Attributes inherited from amrex::MLLinOpT< MF >
int mg_box_min_width = 2
int mg_domain_min_width = 2
int mg_agg_no_split_direction = -1
bool mg_odd_coarsening = false
bool mg_independent_coarsening = false
LPInfo info
int verbose = 0
std::string print_ident
int maxorder = 3
bool enforceSingularSolvable = true
bool m_mg_deferred = false
 MG levels of AMR level 0 built at first solve.
bool m_mg_built = false
int m_num_amr_levels = 0
Vector< int > m_amr_ref_ratio
Vector< int > m_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< 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_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
std::unique_ptr< MLLinOpT< fMultiFab > > m_sp_linop
int m_sp_linop_count = 0
RT m_sp_scale = RT(1.0)
Real m_sp_length_scale = Real(1.0)

Friends

class HypreMLNodeLap

Additional Inherited Members

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
Static Protected Attributes inherited from amrex::MLLinOpT< MF >
static constexpr int mg_coarsen_ratio = 2
static constexpr bool mixed_precision_capable

Member Typedef Documentation

◆ BCMode

template<typename MF>
using amrex::MLNodeLinOpT< MF >::BCMode = typename MLLinOpT<MF>::BCMode

◆ BCType

template<typename MF>
using amrex::MLNodeLinOpT< MF >::BCType = typename MLLinOpT<MF>::BCType

◆ CoarseningStrategy

template<typename MF>
using amrex::MLNodeLinOpT< MF >::CoarseningStrategy = MLNodeLinOpCoarseningStrategy

◆ FAB

template<typename MF>
using amrex::MLNodeLinOpT< MF >::FAB = typename MLLinOpT<MF>::FAB

◆ Location

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

◆ RT

template<typename MF>
using amrex::MLNodeLinOpT< MF >::RT = typename MLLinOpT<MF>::RT

◆ StateMode

template<typename MF>
using amrex::MLNodeLinOpT< MF >::StateMode = typename MLLinOpT<MF>::StateMode

Constructor & Destructor Documentation

◆ MLNodeLinOpT() [1/3]

template<typename MF>
amrex::MLNodeLinOpT< MF >::MLNodeLinOpT ( )

◆ ~MLNodeLinOpT()

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

◆ MLNodeLinOpT() [2/3]

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

◆ MLNodeLinOpT() [3/3]

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

Member Function Documentation

◆ apply()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::apply ( int amrlev,
int mglev,
MF & out,
MF & in,
BCMode bc_mode,
StateMode s_mode,
const MLMGBndryT< MF > * bndry = nullptr ) const
finalvirtual

Apply the nodal operator with the requested BC/state modes.

Parameters
amrlevAMR level index.
mglevMultigrid level index.
outDestination MultiFab updated with L(in).
inInput MultiFab.
bc_modeBoundary-condition interpretation (solution vs correction).
s_modeState interpretation (solution or correction).
bndryOptional cached BC data.

Implements amrex::MLLinOpT< MF >.

◆ applyBC()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::applyBC ( int amrlev,
int mglev,
MF & phi,
BCMode bc_mode,
StateMode state_mode,
bool skip_fillboundary = false ) const
virtual

Apply physical BCs prior to smoothing/apply.

Parameters
amrlevAMR level index.
mglevMultigrid level index.
phiMultiFab whose ghost values are set.
bc_modeBoundary-condition interpretation (solution vs correction).
state_modeState interpretation (solution vs correction).
skip_fillboundaryTrue to skip FillBoundary calls.

◆ applyOverset()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::applyOverset ( int amrlev,
MF & mf ) const
overridevirtual

Zero mf at the known nodes of the overset mask.

Reimplemented from amrex::MLLinOpT< MF >.

◆ averageDownAndSync()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::averageDownAndSync ( Vector< MF > & sol) const
overridevirtual

Average nodal solutions down the AMR hierarchy and synchronize overlaps.

Parameters
solVector of nodal MultiFabs spanning all AMR levels.

Implements amrex::MLLinOpT< MF >.

◆ avgDownResAmr()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::avgDownResAmr ( int ,
MF & ,
MF const &  ) const
inlinefinalvirtual

Nodal average-down for residuals between AMR levels (no-op here).

Reimplemented from amrex::MLLinOpT< MF >.

◆ buildMasks()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::buildMasks ( )

Build Dirichlet/dot-product masks and determine bottom singularity.

◆ buildMGHierarchy()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::buildMGHierarchy ( )
overrideprotectedvirtual

Build the MG levels of AMR level 0 below the finest one.

Reimplemented from amrex::MLLinOpT< MF >.

◆ correctionResidual()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::correctionResidual ( int amrlev,
int mglev,
MF & resid,
MF & x,
const MF & b,
BCMode bc_mode,
const MF * crse_bcdata = nullptr )
overridevirtual

Residual helper for correction solves (optionally homogeneous BCs) on (amrlev,mglev).

Implements amrex::MLLinOpT< MF >.

◆ define()

template<typename MF>
void amrex::MLNodeLinOpT< 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_eb_limit_coarsening = -1 )

Bind the nodal operator to an AMR hierarchy.

Parameters
a_geomPer-level geometries.
a_gridsPer-level grids.
a_dmapDistribution mappings.
a_infoLPInfo overrides.
a_factoryOptional nodal factories per level.
a_eb_limit_coarseningTrue to forbid coarsening beyond where EB geometry is available (-1 uses default).

◆ dotProductPrecond()

template<typename MF>
auto amrex::MLNodeLinOpT< MF >::dotProductPrecond ( Vector< MF const * > const & x,
Vector< MF const * > const & y ) const
finalvirtual

Dot product used when the operator acts as a preconditioner.

Reimplemented from amrex::MLLinOpT< MF >.

◆ Fapply()

template<typename MF>
virtual void amrex::MLNodeLinOpT< MF >::Fapply ( int amrlev,
int mglev,
MF & out,
const MF & in ) const
pure virtual

Low-level apply invoked by the base class.

Parameters
amrlevAMR level index.
mglevMultigrid level index.
outDestination MultiFab receiving L(in).
inSource MultiFab.

Implemented in amrex::MLEBNodeFDLaplacian, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacianT< MF >, amrex::MLNodeLaplacianT< MultiFab >, and amrex::MLNodeTensorLaplacian.

◆ fillAlgMatrix()

template<typename MF>
virtual void amrex::MLNodeLinOpT< MF >::fillAlgMatrix ( int ,
MFIter const & ,
Array4< Long const > const & ,
Array4< int const > const & ,
Long * ,
Long * ,
Real *  ) const
inlinevirtual

Fill the matrix rows of one box for the algebraic solver.

Same packed layout as the Hypre version: ncols[lid] entries per row, diagonal first, neighbors without a row dropped. The MG level is on AMR level 0. Global row ids are numeric_limits<Long>::max() and local ids negative where there is no row.

Reimplemented in amrex::MLEBNodeFDLaplacian, amrex::MLNodeLaplacianT< MF >, amrex::MLNodeLaplacianT< MultiFab >, and amrex::MLNodeTensorLaplacian.

◆ fillRHS()

template<typename MF>
virtual void amrex::MLNodeLinOpT< MF >::fillRHS ( int ,
MFIter const & ,
Array4< int const > const & ,
Real * ,
Array4< Real const > const &  ) const
inlinevirtual

Fill the right-hand side of the rows of one box on MG level mglev.

Reimplemented in amrex::MLEBNodeFDLaplacian, amrex::MLNodeLaplacianT< MF >, amrex::MLNodeLaplacianT< MultiFab >, and amrex::MLNodeTensorLaplacian.

◆ fixSolvabilityByOffset()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::fixSolvabilityByOffset ( int amrlev,
int mglev,
MF & rhs,
Vector< RT > const & offset ) const
overridevirtual

Subtract offsets produced by getSolvabilityOffset() from rhs.

Reimplemented from amrex::MLLinOpT< MF >.

◆ fixUpResidualMask()

template<typename MF>
virtual void amrex::MLNodeLinOpT< MF >::fixUpResidualMask ( int ,
iMultiFab &  )
inlinevirtual

◆ Fsmooth()

template<typename MF>
virtual void amrex::MLNodeLinOpT< MF >::Fsmooth ( int amrlev,
int mglev,
MF & sol,
const MF & rhs ) const
pure virtual

Low-level smoother invoked by the base class.

Parameters
amrlevAMR level index.
mglevMultigrid level index.
solCorrection updated in place.
rhsRight-hand side for the smoother.

Implemented in amrex::MLEBNodeFDLaplacian, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacianT< MF >, amrex::MLNodeLaplacianT< MultiFab >, and amrex::MLNodeTensorLaplacian.

◆ getSolvabilityOffset()

template<typename MF>
auto amrex::MLNodeLinOpT< MF >::getSolvabilityOffset ( int amrlev,
int mglev,
MF const & rhs ) const
overridevirtual

Return component-wise solvability offsets for (amrlev,mglev, rhs).

Reimplemented from amrex::MLLinOpT< MF >.

◆ interpAssign()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::interpAssign ( int amrlev,
int fmglev,
MF & fine,
MF & crse ) const
overridevirtual

Overwrite fine data with the prolongation of coarse data (fine = prolong(crse)).

Parameters
amrlevAMR level index.
fmglevFine MG level index.
fineDestination fine MultiFab (overwritten in place).
crseSource coarse MultiFab (its ghost cells may be modified).

Reimplemented from amrex::MLLinOpT< MF >.

◆ interpolationAmr()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::interpolationAmr ( int famrlev,
MF & fine,
const MF & crse,
IntVect const & nghost ) const
overridevirtual

Prolong AMR-level data during FMG initialization.

Parameters
famrlevFine AMR level index.
fineDestination MultiFab.
crseSource coarse MultiFab.
nghostGrow cells to fill.

Reimplemented from amrex::MLLinOpT< MF >.

◆ isBottomSingular()

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

Is the bottom of the multigrid hierarchy singular?

Implements amrex::MLLinOpT< MF >.

◆ isSingular()

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

Is it singular on AMR level amrlev?

Implements amrex::MLLinOpT< MF >.

◆ makeAlgMG()

template<typename MF>
std::unique_ptr< MLAlgMG > amrex::MLNodeLinOpT< MF >::makeAlgMG ( int mglev) const
nodiscardoverridevirtual

Build the algebraic system of MG level mglev of AMR level 0 for the AlgMG solver. Operators that hypre supports implement this.

Reimplemented from amrex::MLLinOpT< MF >.

◆ makeOwnerMask()

template<typename MF>
std::unique_ptr< iMultiFab > amrex::MLNodeLinOpT< MF >::makeOwnerMask ( const BoxArray & ba,
const DistributionMapping & dm,
const Geometry & geom )
static

Build a nodal mask that marks points owned by this rank (used for sync).

Parameters
baGrid layout on the current level.
dmDistribution mapping describing MPI ownership.
geomGeometry describing periodicity/domain info.

◆ nodalSync()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::nodalSync ( int amrlev,
int mglev,
MF & mf ) const

Synchronize nodal values across box/partition boundaries on (amrlev,mglev).

◆ norm2Precond()

template<typename MF>
auto amrex::MLNodeLinOpT< MF >::norm2Precond ( Vector< MF const * > const & x) const
finalvirtual

L2 norm used when the operator acts as a preconditioner.

Reimplemented from amrex::MLLinOpT< MF >.

◆ normInf()

template<typename MF>
auto amrex::MLNodeLinOpT< MF >::normInf ( int amrlev,
MF const & mf,
bool local ) const
overridevirtual

Infinity norm helper operating on level amrlev (set local to true to skip MPI reduction).

Implements amrex::MLLinOpT< MF >.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ prepareForSolve()

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

Prepare BC caches, masks, and metadata prior to solving.

Implements amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLNodeTensorLaplacian.

◆ preparePrecond()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::preparePrecond ( )
overridevirtual

Prepare auxiliary data used when the operator acts as a preconditioner.

Reimplemented from amrex::MLLinOpT< MF >.

◆ resizeMultiGrid()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::resizeMultiGrid ( int new_size)
overrideprotectedvirtual

Reimplemented from amrex::MLLinOpT< MF >.

◆ setDirichletNodesToZero()

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

Zero Dirichlet nodes in mf before a correction or residual pass.

Reimplemented from amrex::MLLinOpT< MF >.

◆ setLevelBC()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::setLevelBC ( int ,
const MF * ,
const MF * = nullptr,
const MF * = nullptr,
const MF * = nullptr )
inlinefinalvirtual

Set boundary conditions for given level. For cell-centered solves only.

This must be called for each level. Argument levelbcdata is used to supply Dirichlet or Neumann bc at the physical domain; if those data are homogeneous we can pass nullptr instead of levelbcdata. Regardless, this function must be called. If used, the MultiFab levelbcdata must have one ghost cell. Only the data outside the physical domain will be used. It is assumed that the data in those ghost cells outside the domain live exactly on the face of the physical domain. Argument amrlev is relative level such that the lowest to the solver is always 0. The optional arguments robinbc_[a|b|f] provide Robin boundary condition a*phi + b*dphi/dn = f. Note that d./dn is d./dx at the upper boundary and -d./dx at the lower boundary, for Robin BC. However, for inhomogeneous Neumann BC, the value in leveldata is assumed to be d./dx.

Implements amrex::MLLinOpT< MF >.

◆ setOversetMask()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::setOversetMask ( int amrlev,
const iMultiFab & a_dmask )

Mark nodes that belong to overset (known) regions.

Parameters
amrlevAMR level index.
a_dmaskMask with 1 = unknown node, 0 = known/covered node.

◆ setSmoothNumSweeps()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::setSmoothNumSweeps ( int nsweeps)
inlinenoexcept

Control how many smoother passes are executed inside each Fsmooth call.

Used only by the host Gauss-Seidel sweeps of MLNodeLaplacian and MLNodeABecLaplacian; ignored elsewhere.

Parameters
nsweepsNumber of smoothing sweeps per Fsmooth invocation.

◆ smooth()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::smooth ( int amrlev,
int mglev,
MF & sol,
const MF & rhs,
bool skip_fillboundary,
int niter ) const
overridevirtual

Invoke the nodal smoother on (amrlev,mglev).

Parameters
amrlevAMR level index.
mglevMultigrid level index.
solCorrection updated in place.
rhsRight-hand side for the smoother.
skip_fillboundaryTrue to assume ghost nodes are already filled.
niterNumber of smoothing sweeps to perform.

Implements amrex::MLLinOpT< MF >.

Reimplemented in amrex::MLNodeTensorLaplacian.

◆ solutionResidual()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::solutionResidual ( int amrlev,
MF & resid,
MF & x,
const MF & b,
const MF * crse_bcdata = nullptr )
overridevirtual

Residual helper that uses solution BCs and optional coarse data (operates on AMR level amrlev).

Implements amrex::MLLinOpT< MF >.

◆ spCopySettings()

template<typename MF>
void amrex::MLNodeLinOpT< MF >::spCopySettings ( )
inlineoverrideprotectedvirtual

Mixed precision: give a new single precision copy the settings made on this operator before define, which define keeps.

Reimplemented from amrex::MLLinOpT< MF >.

◆ toRT()

template<typename MF>
GpuArray< RT, 3 > amrex::MLNodeLinOpT< MF >::toRT ( GpuArray< Real, 3 > const & a)
inlinestaticnodiscardprotectednoexcept

Convert a geometry array to RT.

◆ xdoty()

template<typename MF>
auto amrex::MLNodeLinOpT< MF >::xdoty ( int amrlev,
int mglev,
const MF & x,
const MF & y,
bool local ) const
finalvirtual

Dot-product helper.

Implements amrex::MLLinOpT< MF >.

◆ HypreMLNodeLap

template<typename MF>
friend class HypreMLNodeLap
friend

Member Data Documentation

◆ m_bottom_dot_mask

template<typename MF>
MF amrex::MLNodeLinOpT< MF >::m_bottom_dot_mask
protected

◆ m_cc_fine_mask

template<typename MF>
Vector<std::unique_ptr<iMultiFab> > amrex::MLNodeLinOpT< MF >::m_cc_fine_mask
protected

◆ m_coarse_dot_mask

template<typename MF>
MF amrex::MLNodeLinOpT< MF >::m_coarse_dot_mask
protected

◆ m_coarsening_strategy

template<typename MF>
CoarseningStrategy amrex::MLNodeLinOpT< MF >::m_coarsening_strategy = CoarseningStrategy::RAP
protected

◆ m_dirichlet_mask

template<typename MF>
Vector<Vector<std::unique_ptr<iMultiFab> > > amrex::MLNodeLinOpT< MF >::m_dirichlet_mask
protected

◆ m_has_fine_bndry

template<typename MF>
Vector<std::unique_ptr<LayoutData<int> > > amrex::MLNodeLinOpT< MF >::m_has_fine_bndry
protected

◆ m_in_solution_mode

template<typename MF>
bool amrex::MLNodeLinOpT< MF >::m_in_solution_mode = true
mutableprotected

◆ m_masks_built

template<typename MF>
bool amrex::MLNodeLinOpT< MF >::m_masks_built = false
protected

◆ m_nd_fine_mask

template<typename MF>
Vector<std::unique_ptr<iMultiFab> > amrex::MLNodeLinOpT< MF >::m_nd_fine_mask
protected

◆ m_norm_fine_mask

template<typename MF>
Vector<std::unique_ptr<iMultiFab> > amrex::MLNodeLinOpT< MF >::m_norm_fine_mask
protected

◆ m_overset_dirichlet_mask

template<typename MF>
bool amrex::MLNodeLinOpT< MF >::m_overset_dirichlet_mask = false
protected

◆ m_owner_mask_bottom

template<typename MF>
std::unique_ptr<iMultiFab> amrex::MLNodeLinOpT< MF >::m_owner_mask_bottom
protected

◆ m_owner_mask_top

template<typename MF>
std::unique_ptr<iMultiFab> amrex::MLNodeLinOpT< MF >::m_owner_mask_top
protected

◆ m_precond_weight_mask

template<typename MF>
Vector<MF> amrex::MLNodeLinOpT< MF >::m_precond_weight_mask
protected

◆ m_smooth_num_sweeps

template<typename MF>
int amrex::MLNodeLinOpT< MF >::m_smooth_num_sweeps = 2
protected

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