Block-Structured AMR Software Framework
amrex_temp::MLLinOpTemp Class Reference

#include <AMReX_MLLinOp_temp.H>

Inheritance diagram for amrex_temp::MLLinOpTemp:
amrex::MLLinOp

Public Types

using Container = amrex::Array< amrex::MultiFab, 3 >
 In this example, there are 3 edge based MultiFabs. More...
 
- Public Types inherited from amrex::MLLinOp
enum class  BCMode { Homogeneous , Inhomogeneous }
 
enum class  StateMode { Solution , Correction }
 
enum class  Location { FaceCenter , FaceCentroid , CellCenter , CellCentroid }
 
using BCType = LinOpBCType
 

Public Member Functions

 MLLinOpTemp ()
 
virtual ~MLLinOpTemp ()
 
 MLLinOpTemp (const MLLinOpTemp &)=delete
 
 MLLinOpTemp (MLLinOpTemp &&)=delete
 
MLLinOpTempoperator= (const MLLinOpTemp &)=delete
 
MLLinOpTempoperator= (MLLinOpTemp &&)=delete
 
 MLLinOpTemp (const amrex::Vector< amrex::Geometry > &a_geom, const amrex::Vector< amrex::BoxArray > &a_grids, const amrex::Vector< amrex::DistributionMapping > &a_dmap, const amrex::LPInfo &a_info=amrex::LPInfo(), const amrex::Vector< amrex::FabFactory< amrex::FArrayBox > const * > &a_factory={})
 
void define (const amrex::Vector< amrex::Geometry > &a_geom, const amrex::Vector< amrex::BoxArray > &a_grids, const amrex::Vector< amrex::DistributionMapping > &a_dmap, const amrex::LPInfo &a_info=amrex::LPInfo(), const amrex::Vector< amrex::FabFactory< amrex::FArrayBox > const * > &a_factory={})
 
virtual amrex::BottomSolver getDefaultBottomSolver () const override
 Return the default solver at the bottom of MG cycles. By default, MLLinOp uses a BiCGStab solver implemented in AMReX::MLCGSolver. However, it only supports a single MultiFab. Since our data type is different, we use a smoother instead. In the future we can try to generalize MLCGSolver. More...
 
virtual amrex::Any AnyMake (int amrlev, int mglev, amrex::IntVect const &ng) const override
 Make data container (e.g., MultiFabs stored in Any) for given level. More...
 
virtual amrex::Any AnyMakeCoarseMG (int amrlev, int mglev, amrex::IntVect const &ng) const override
 Make data container with coarsened BoxArray and DistributionMapping of the give MG level. More...
 
virtual amrex::Any AnyMakeCoarseAmr (int famrlev, amrex::IntVect const &ng) const override
 Make data container with coarsened BoxArray and DistributionMapping of the given AMR level. More...
 
virtual amrex::Any AnyMakeAlias (amrex::Any const &a) const override
 Make an alias of the given Any without deepcopying. More...
 
virtual amrex::IntVect AnyGrowVect (amrex::Any const &a) const override
 Retuen the number of ghost cells in the given Any. More...
 
virtual void AnyCopy (amrex::Any &dst, amrex::Any const &src, amrex::IntVect const &ng) const override
 Copy data from source Any to destination Any. More...
 
virtual void AnyAdd (amrex::Any &dst, amrex::Any const &src, amrex::IntVect const &ng) const override
 Add data from source Any to destination Any. More...
 
virtual void AnySetToZero (amrex::Any &a) const override
 Set the given Any to zero. More...
 
virtual void AnySetBndryToZero (amrex::Any &a) const override
 Set boundary (i.e., ghost cells) the given Any to zero. More...
 
virtual void AnyParallelCopy (amrex::Any &dst, amrex::Any const &src, amrex::IntVect const &src_nghost, amrex::IntVect const &dst_nghost, amrex::Periodicity const &period=amrex::Periodicity::NonPeriodic()) const override
 ParallelCopy from source Any ot destination Any. More...
 
virtual amrex::Real AnyNormInf (amrex::Any &a) const override
 Return the infinity norm of the given Any. More...
 
virtual amrex::Real AnyNormInfMask (int amrlev, amrex::Any const &a, bool local) const override
 Return the infinity norm of the masked region of the given Any. More...
 
virtual void AnySolutionResidual (int amrlev, amrex::Any &resid, amrex::Any &x, amrex::Any const &b, amrex::Any const *crse_bcdata=nullptr) override
 Compute residual of the original form, r = b - Ax. More...
 
virtual void AnyCorrectionResidual (int amrlev, int mglev, amrex::Any &resid, amrex::Any &x, const amrex::Any &b, MLLinOp::BCMode bc_mode, const amrex::Any *crse_bcdata=nullptr) override
 Compute residual of the residual correction form, r = b - Ax. More...
 
virtual void AnyReflux (int crse_amrlev, amrex::Any &res, const amrex::Any &crse_sol, const amrex::Any &crse_rhs, amrex::Any &fine_res, amrex::Any &fine_sol, const amrex::Any &fine_rhs) override
 Reflux. More...
 
virtual void AnyAvgDownResAmr (int clev, amrex::Any &cres, amrex::Any const &fres) const override
 Average down residual from fine to coarse AMR level. More...
 
virtual void AnyAvgDownResMG (int clev, amrex::Any &cres, amrex::Any const &fres) const override
 Average down residual from fine to coarse MG level. More...
 
virtual void AnySmooth (int amrlev, int mglev, amrex::Any &sol, const amrex::Any &rhs, bool skip_fillboundary=false) const override
 Smooth the given level. More...
 
virtual void AnyRestriction (int amrlev, int cmglev, amrex::Any &crse, amrex::Any &fine) const override
 Restriction from fine to coarse MG level. More...
 
virtual void AnyInterpolationMG (int amrlev, int fmglev, amrex::Any &fine, const amrex::Any &crse) const override
 Add interpolated coarse data onto the fine MG level. More...
 
virtual void AnyInterpAssignMG (int amrlev, int fmglev, amrex::Any &fine, amrex::Any &crse) const override
 Assign (i.e., copy) interpolated coarse data onto the fine MG level. More...
 
virtual void AnyInterpolationAmr (int famrlev, amrex::Any &fine, const amrex::Any &crse, amrex::IntVect const &) const override
 Interpolate data from coarse to fine AMR level. More...
 
virtual void AnyAverageDownSolutionRHS (int camrlev, amrex::Any &crse_sol, amrex::Any &crse_rhs, const amrex::Any &fine_sol, const amrex::Any &fine_rhs) override
 Average down x and b from fine to coarse AMR level. More...
 
virtual void AnyAverageDownAndSync (amrex::Vector< amrex::Any > &sol) const override
 Average down and synchronize AMR data. More...
 
virtual void prepareForSolve () override
 Prepare the solver for MG cycle. More...
 
- Public Member Functions inherited from amrex::MLLinOp
 MLLinOp ()
 
virtual ~MLLinOp ()
 
 MLLinOp (const MLLinOp &)=delete
 
 MLLinOp (MLLinOp &&)=delete
 
MLLinOpoperator= (const MLLinOp &)=delete
 
MLLinOpoperator= (MLLinOp &&)=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< FArrayBox > const * > &a_factory, bool eb_limit_coarsening=true)
 
virtual std::string name () const
 
void setDomainBC (const Array< BCType, AMREX_SPACEDIM > &lobc, const Array< BCType, AMREX_SPACEDIM > &hibc) noexcept
 Boundary of the whole domain. This functions must be called, and must be called before other bc functions. More...
 
void setDomainBC (const Vector< Array< BCType, AMREX_SPACEDIM > > &lobc, const Vector< Array< BCType, AMREX_SPACEDIM > > &hibc) noexcept
 
void setDomainBCLoc (const Array< Real, AMREX_SPACEDIM > &lo_bcloc, const Array< Real, AMREX_SPACEDIM > &hi_bcloc) noexcept
 
bool needsCoarseDataForBC () const noexcept
 Needs coarse data for bc? If the lowest level grids does not cover the entire domain, coarse level data are needed for supplying Dirichlet bc at coarse/fine boundary, even when the domain bc is not Dirichlet. More...
 
void setCoarseFineBC (const MultiFab *crse, int crse_ratio) noexcept
 For cell-centered solves only: if we want to do a linear solve where the boundary conditions on the coarsest AMR level of the solve come from a coarser level (e.g. the base AMR level of the solve is > 0 and does not cover the entire domain), we must explicitly provide the coarser data. Boundary conditions from a coarser level are always Dirichlet. The MultiFab crse does not need to have ghost cells and is at a coarser resolution than the coarsest AMR level of the solve; it is used to supply (interpolated) boundary conditions for the solve. NOTE: If this is called, it must be called before setLevelBC. If crse is nullptr, then the bc values are assumed to be zero. More...
 
virtual void setLevelBC (int, const MultiFab *, const MultiFab *=nullptr, const MultiFab *=nullptr, const MultiFab *=nullptr)
 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. More...
 
void setVerbose (int v) noexcept
 
void setMaxOrder (int o) noexcept
 
int getMaxOrder () const noexcept
 
void setEnforceSingularSolvable (bool o) noexcept
 
bool getEnforceSingularSolvable () const noexcept
 
virtual int getNComp () const
 
virtual int getNGrow (int=0, int=0) const
 
virtual bool needsUpdate () const
 
virtual void update ()
 
virtual void restriction (int, int, MultiFab &, MultiFab &) const
 
virtual void interpolation (int, int, MultiFab &, const MultiFab &) const
 
virtual void interpAssign (int, int, MultiFab &, MultiFab &) const
 
virtual void averageDownSolutionRHS (int, MultiFab &, MultiFab &, const MultiFab &, const MultiFab &)
 
virtual void apply (int, int, MultiFab &, MultiFab &, BCMode, StateMode, const MLMGBndry *=nullptr) const
 
virtual void smooth (int, int, MultiFab &, const MultiFab &, bool=false) const
 
virtual void normalize (int, int, MultiFab &) const
 
virtual void solutionResidual (int, MultiFab &, MultiFab &, const MultiFab &, const MultiFab *=nullptr)
 
virtual void correctionResidual (int, int, MultiFab &, MultiFab &, const MultiFab &, BCMode, const MultiFab *=nullptr)
 
virtual void reflux (int, MultiFab &, const MultiFab &, const MultiFab &, MultiFab &, MultiFab &, const MultiFab &) const
 
virtual void compFlux (int, const Array< MultiFab *, AMREX_SPACEDIM > &, MultiFab &, Location) const
 
virtual void compGrad (int, const Array< MultiFab *, AMREX_SPACEDIM > &, MultiFab &, Location) const
 
virtual void applyMetricTerm (int, int, Any &) const
 
virtual void unapplyMetricTerm (int, int, MultiFab &) const
 
virtual void unimposeNeumannBC (int, Any &) const
 
virtual void applyInhomogNeumannTerm (int, Any &) const
 
virtual void applyOverset (int, Any &) const
 
virtual void scaleRHS (int, Any &) const
 
virtual Vector< Real > getSolvabilityOffset (int, int, Any const &) const
 
virtual void fixSolvabilityByOffset (int, int, Any &, Vector< Real > const &) const
 
virtual bool isSingular (int) const
 
virtual bool isBottomSingular () const
 
virtual Real xdoty (int, int, const MultiFab &, const MultiFab &, bool) const
 
virtual std::unique_ptr< MLLinOpmakeNLinOp (int) const
 
virtual void getFluxes (const Vector< Array< MultiFab *, AMREX_SPACEDIM > > &, const Vector< MultiFab * > &, Location) const
 
virtual void getFluxes (const Vector< MultiFab * > &, const Vector< MultiFab * > &) const
 
virtual bool supportNSolve () const
 
virtual void copyNSolveSolution (MultiFab &, MultiFab const &) const
 
virtual void AnyCorrectionResidual (int amrlev, int mglev, Any &resid, Any &x, const Any &b, BCMode bc_mode, const Any *crse_bcdata=nullptr)
 
virtual void postSolve (Vector< Any > &sol) const
 
Real MFNormInf (MultiFab const &mf, iMultiFab const *fine_mask, bool local) const
 
bool isMFIterSafe (int amrlev, int mglev1, int mglev2) const
 

Additional Inherited Members

- Static Public Member Functions inherited from amrex::MLLinOp
static void Initialize ()
 
static void Finalize ()
 
- Protected Member Functions inherited from amrex::MLLinOp
int NAMRLevels () const noexcept
 functions More...
 
int NMGLevels (int amrlev) const noexcept
 
const Vector< int > & AMRRefRatio () const noexcept
 
int AMRRefRatio (int amr_lev) const noexcept
 
const GeometryGeom (int amr_lev, int mglev=0) const noexcept
 
FabFactory< FArrayBox > const * Factory (int amr_lev, int mglev=0) const noexcept
 
GpuArray< BCType, AMREX_SPACEDIM > LoBC (int icomp=0) const noexcept
 
GpuArray< BCType, AMREX_SPACEDIM > HiBC (int icomp=0) 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
 
void make (Vector< Vector< Any > > &mf, IntVect const &ng) const
 
virtual std::unique_ptr< FabFactory< FArrayBox > > 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 inherited from amrex::MLLinOp
LPInfo info
 
int verbose = 0
 
int maxorder = 3
 
bool enforceSingularSolvable = true
 
int m_num_amr_levels
 
Vector< intm_amr_ref_ratio
 
Vector< intm_num_mg_levels
 
const MLLinOpm_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 More...
 
Vector< Vector< BoxArray > > m_grids
 
Vector< Vector< DistributionMapping > > m_dmap
 
Vector< Vector< std::unique_ptr< FabFactory< FArrayBox > > > > 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< CommContainerm_raii_comm
 
Vector< Array< BCType, AMREX_SPACEDIM > > m_lobc
 
Vector< Array< BCType, AMREX_SPACEDIM > > m_hibc
 
Vector< Array< BCType, AMREX_SPACEDIM > > m_lobc_orig
 
Vector< Array< BCType, AMREX_SPACEDIM > > m_hibc_orig
 
Array< Real, AMREX_SPACEDIM > m_domain_bloc_lo {{AMREX_D_DECL(0.,0.,0.)}}
 
Array< Real, AMREX_SPACEDIM > m_domain_bloc_hi {{AMREX_D_DECL(0.,0.,0.)}}
 
bool m_needs_coarse_data_for_bc
 
int m_coarse_data_crse_ratio = -1
 
RealVect m_coarse_bc_loc
 
const MultiFabm_coarse_data_for_bc = nullptr
 
- Static Protected Attributes inherited from amrex::MLLinOp
static constexpr int mg_coarsen_ratio = 2
 
static constexpr int mg_box_min_width = 2
 
static constexpr int mg_domain_min_width = 2
 

Member Typedef Documentation

◆ Container

In this example, there are 3 edge based MultiFabs.

Constructor & Destructor Documentation

◆ MLLinOpTemp() [1/4]

amrex_temp::MLLinOpTemp::MLLinOpTemp ( )
inline

◆ ~MLLinOpTemp()

virtual amrex_temp::MLLinOpTemp::~MLLinOpTemp ( )
inlinevirtual

◆ MLLinOpTemp() [2/4]

amrex_temp::MLLinOpTemp::MLLinOpTemp ( const MLLinOpTemp )
delete

◆ MLLinOpTemp() [3/4]

amrex_temp::MLLinOpTemp::MLLinOpTemp ( MLLinOpTemp &&  )
delete

◆ MLLinOpTemp() [4/4]

amrex_temp::MLLinOpTemp::MLLinOpTemp ( const amrex::Vector< amrex::Geometry > &  a_geom,
const amrex::Vector< amrex::BoxArray > &  a_grids,
const amrex::Vector< amrex::DistributionMapping > &  a_dmap,
const amrex::LPInfo a_info = amrex::LPInfo(),
const amrex::Vector< amrex::FabFactory< amrex::FArrayBox > const * > &  a_factory = {} 
)
inline

Member Function Documentation

◆ AnyAdd()

virtual void amrex_temp::MLLinOpTemp::AnyAdd ( amrex::Any dst,
amrex::Any const &  src,
amrex::IntVect const &  ng 
) const
inlineoverridevirtual

Add data from source Any to destination Any.

Parameters
dstdestination Any.
srcsource Any.
ngnumber of ghost cells included in the operation.

Reimplemented from amrex::MLLinOp.

◆ AnyAverageDownAndSync()

virtual void amrex_temp::MLLinOpTemp::AnyAverageDownAndSync ( amrex::Vector< amrex::Any > &  sol) const
inlineoverridevirtual

Average down and synchronize AMR data.

Synchronize the data on each level. That is the nodal data in the same MultiFab needs to be synchronized. This function also needs to average down the data from fine to coarse AMR levels.

Parameters
soldata on all AMR levels.

Implements amrex::MLLinOp.

◆ AnyAverageDownSolutionRHS()

virtual void amrex_temp::MLLinOpTemp::AnyAverageDownSolutionRHS ( int  camrlev,
amrex::Any crse_sol,
amrex::Any crse_rhs,
const amrex::Any fine_sol,
const amrex::Any fine_rhs 
)
inlineoverridevirtual

Average down x and b from fine to coarse AMR level.

This is called before V-cycle to make data on AMR levels consistent.

Parameters
camrlevcoarse AMR level. The fine level is camrlev+1.
crse_solx on coarse level.
crse_rhsb on coarse level.
fine_solx on fine level.
fine_rhsb on fine level.

Reimplemented from amrex::MLLinOp.

◆ AnyAvgDownResAmr()

virtual void amrex_temp::MLLinOpTemp::AnyAvgDownResAmr ( int  clev,
amrex::Any cres,
amrex::Any const &  fres 
) const
inlineoverridevirtual

Average down residual from fine to coarse AMR level.

Parameters
clevcoarse ARR level.
crescoarse level residual.
fresfine level residual.

Implements amrex::MLLinOp.

◆ AnyAvgDownResMG()

virtual void amrex_temp::MLLinOpTemp::AnyAvgDownResMG ( int  clev,
amrex::Any cres,
amrex::Any const &  fres 
) const
inlineoverridevirtual

Average down residual from fine to coarse MG level.

This is only needed for MG F-cycle, and we don't need to implement this for V-cycle.

Parameters
clevcoarse MG level.
crescoarse level residual.
fresfine level residual.

Reimplemented from amrex::MLLinOp.

◆ AnyCopy()

virtual void amrex_temp::MLLinOpTemp::AnyCopy ( amrex::Any dst,
amrex::Any const &  src,
amrex::IntVect const &  ng 
) const
inlineoverridevirtual

Copy data from source Any to destination Any.

Parameters
dstdestination Any.
srcsource Any.
ngnumber of ghost cells included in the operation.

Reimplemented from amrex::MLLinOp.

◆ AnyCorrectionResidual()

virtual void amrex_temp::MLLinOpTemp::AnyCorrectionResidual ( int  amrlev,
int  mglev,
amrex::Any resid,
amrex::Any x,
const amrex::Any b,
MLLinOp::BCMode  bc_mode,
const amrex::Any crse_bcdata = nullptr 
)
inlineoverridevirtual

Compute residual of the residual correction form, r = b - Ax.

Parameters
amrlevAMR level.
residresidual of the residual correction form.
xthe correction.
bthe RHS for the residual correction form (i.e., the residual of the original form.
bc_modeis either Homogeneous or Inhomogeneous.
crse_bcdataprovides inhomogenous Dirichlet BC at AMR coarse/fine interface. It's ignored for homogeneous Dirichlet BC.

◆ AnyGrowVect()

virtual amrex::IntVect amrex_temp::MLLinOpTemp::AnyGrowVect ( amrex::Any const &  a) const
inlineoverridevirtual

Retuen the number of ghost cells in the given Any.

Parameters
aan Any object.

Reimplemented from amrex::MLLinOp.

◆ AnyInterpAssignMG()

virtual void amrex_temp::MLLinOpTemp::AnyInterpAssignMG ( int  amrlev,
int  fmglev,
amrex::Any fine,
amrex::Any crse 
) const
inlineoverridevirtual

Assign (i.e., copy) interpolated coarse data onto the fine MG level.

Note that it's an ASSIGN operation. This is used in MG F-cycle, and does not need to be implemented for V-cycle.

Parameters
amrlevAMR level.
fmglevfine MG level. The coarse MG level is fmglev+1.
finefine MG level data.
crsecoarse MG level data.

Reimplemented from amrex::MLLinOp.

◆ AnyInterpolationAmr()

virtual void amrex_temp::MLLinOpTemp::AnyInterpolationAmr ( int  famrlev,
amrex::Any fine,
const amrex::Any crse,
amrex::IntVect const &   
) const
inlineoverridevirtual

Interpolate data from coarse to fine AMR level.

Parameters
famrlevfine AMR level. The coarse AMR level is famrlev-1.
finedata on fine AMR level.
crsedata on coarse AMR level.

Implements amrex::MLLinOp.

◆ AnyInterpolationMG()

virtual void amrex_temp::MLLinOpTemp::AnyInterpolationMG ( int  amrlev,
int  fmglev,
amrex::Any fine,
const amrex::Any crse 
) const
inlineoverridevirtual

Add interpolated coarse data onto the fine MG level.

Note that it's an ADD operation.

Parameters
amrlevAMR level.
fmglevfine MG level. The coarse MG level is fmglev+1.
finefine MG level data.
crsecoarse MG level data.

Reimplemented from amrex::MLLinOp.

◆ AnyMake()

virtual amrex::Any amrex_temp::MLLinOpTemp::AnyMake ( int  amrlev,
int  mglev,
amrex::IntVect const &  ng 
) const
inlineoverridevirtual

Make data container (e.g., MultiFabs stored in Any) for given level.

Parameters
amrlevAMR level. Note that the lowest level is always 0.
mglevMG level. Note that mglev+1 is one level coarser than mglev.
ngnumber of ghost cells.

Reimplemented from amrex::MLLinOp.

◆ AnyMakeAlias()

virtual amrex::Any amrex_temp::MLLinOpTemp::AnyMakeAlias ( amrex::Any const &  a) const
inlineoverridevirtual

Make an alias of the given Any without deepcopying.

Parameters
aan Any object.

Reimplemented from amrex::MLLinOp.

◆ AnyMakeCoarseAmr()

virtual amrex::Any amrex_temp::MLLinOpTemp::AnyMakeCoarseAmr ( int  famrlev,
amrex::IntVect const &  ng 
) const
inlineoverridevirtual

Make data container with coarsened BoxArray and DistributionMapping of the given AMR level.

Parameters
famrlevAMR level. The coarser AMR level is famrlev-1.
ngnumber of ghost cells.

Reimplemented from amrex::MLLinOp.

◆ AnyMakeCoarseMG()

virtual amrex::Any amrex_temp::MLLinOpTemp::AnyMakeCoarseMG ( int  amrlev,
int  mglev,
amrex::IntVect const &  ng 
) const
inlineoverridevirtual

Make data container with coarsened BoxArray and DistributionMapping of the give MG level.

Parameters
amrlevAMR level. Note that the lowest level is always 0.
mglevMG level. The coarser level is mglev+1.
ngnumber of ghost cells.

Reimplemented from amrex::MLLinOp.

◆ AnyNormInf()

virtual amrex::Real amrex_temp::MLLinOpTemp::AnyNormInf ( amrex::Any a) const
inlineoverridevirtual

Return the infinity norm of the given Any.

Parameters
aan Any object.

Reimplemented from amrex::MLLinOp.

◆ AnyNormInfMask()

virtual amrex::Real amrex_temp::MLLinOpTemp::AnyNormInfMask ( int  amrlev,
amrex::Any const &  a,
bool  local 
) const
inlineoverridevirtual

Return the infinity norm of the masked region of the given Any.

For a composite solve with multiple AMR levels, the region covered by finer AMR levels are not included in the operation.

\parame amrlev AMR level.

Parameters
aan Any object. \parame local determines if the reduction is local (i.e., no MPI communication) or not.

Implements amrex::MLLinOp.

◆ AnyParallelCopy()

virtual void amrex_temp::MLLinOpTemp::AnyParallelCopy ( amrex::Any dst,
amrex::Any const &  src,
amrex::IntVect const &  src_nghost,
amrex::IntVect const &  dst_nghost,
amrex::Periodicity const &  period = amrex::Periodicity::NonPeriodic() 
) const
inlineoverridevirtual

ParallelCopy from source Any ot destination Any.

Parameters
dstdestination Any.
srcsource Any.
src_nghostnumber of ghost cells in the source included in the operation.
dst_nghostnumber of ghost cells in the destination included in the operation.
periodPeriodicity.

Reimplemented from amrex::MLLinOp.

◆ AnyReflux()

virtual void amrex_temp::MLLinOpTemp::AnyReflux ( int  crse_amrlev,
amrex::Any res,
const amrex::Any crse_sol,
const amrex::Any crse_rhs,
amrex::Any fine_res,
amrex::Any fine_sol,
const amrex::Any fine_rhs 
)
inlineoverridevirtual

Reflux.

This modifies the coarse level residual at the coarse/fine interface.

Parameters
crse_amrlevcoarse AMR level.
rescoarse level residual.
crse_solcoarse level x.
crse_rhscoarse level b.
fine_resfine level residual. This may not be needed depending on the coarse/fine stencil.
fine_solfine level x.
fine_rhsfine level b.

Reimplemented from amrex::MLLinOp.

◆ AnyRestriction()

virtual void amrex_temp::MLLinOpTemp::AnyRestriction ( int  amrlev,
int  cmglev,
amrex::Any crse,
amrex::Any fine 
) const
inlineoverridevirtual

Restriction from fine to coarse MG level.

Parameters
amrlevAMR level.
cmglevcoarse MG level. The fine MG level is cmglev-1.
crsecoarse data.
finefine data. This is not const& because we may need to fill its ghost cells.

Reimplemented from amrex::MLLinOp.

◆ AnySetBndryToZero()

virtual void amrex_temp::MLLinOpTemp::AnySetBndryToZero ( amrex::Any a) const
inlineoverridevirtual

Set boundary (i.e., ghost cells) the given Any to zero.

Parameters
aan Any object.

Reimplemented from amrex::MLLinOp.

◆ AnySetToZero()

virtual void amrex_temp::MLLinOpTemp::AnySetToZero ( amrex::Any a) const
inlineoverridevirtual

Set the given Any to zero.

Parameters
aan Any object.

Reimplemented from amrex::MLLinOp.

◆ AnySmooth()

virtual void amrex_temp::MLLinOpTemp::AnySmooth ( int  amrlev,
int  mglev,
amrex::Any sol,
const amrex::Any rhs,
bool  skip_fillboundary = false 
) const
inlineoverridevirtual

Smooth the given level.

Parameters
amrlevAMR level. Note that the lowest level is always 0.
mglevMG level. Note that mglev+1 is one level coarser than mglev.
solx
rhsb
skip_fillboundarya flag for if we need to fill ghost cells in this function.

Reimplemented from amrex::MLLinOp.

◆ AnySolutionResidual()

virtual void amrex_temp::MLLinOpTemp::AnySolutionResidual ( int  amrlev,
amrex::Any resid,
amrex::Any x,
amrex::Any const &  b,
amrex::Any const *  crse_bcdata = nullptr 
)
inlineoverridevirtual

Compute residual of the original form, r = b - Ax.

Parameters
amrlevAMR level
residresidual
xthe solution x
bthe RHS b
crse_bcdataprovides Dirichlet BC at AMR coarse/fine interface. It's a nullptr for single level solve.

Reimplemented from amrex::MLLinOp.

◆ define()

void amrex_temp::MLLinOpTemp::define ( const amrex::Vector< amrex::Geometry > &  a_geom,
const amrex::Vector< amrex::BoxArray > &  a_grids,
const amrex::Vector< amrex::DistributionMapping > &  a_dmap,
const amrex::LPInfo a_info = amrex::LPInfo(),
const amrex::Vector< amrex::FabFactory< amrex::FArrayBox > const * > &  a_factory = {} 
)
inline

◆ getDefaultBottomSolver()

virtual amrex::BottomSolver amrex_temp::MLLinOpTemp::getDefaultBottomSolver ( ) const
inlineoverridevirtual

Return the default solver at the bottom of MG cycles. By default, MLLinOp uses a BiCGStab solver implemented in AMReX::MLCGSolver. However, it only supports a single MultiFab. Since our data type is different, we use a smoother instead. In the future we can try to generalize MLCGSolver.

Reimplemented from amrex::MLLinOp.

◆ operator=() [1/2]

MLLinOpTemp& amrex_temp::MLLinOpTemp::operator= ( const MLLinOpTemp )
delete

◆ operator=() [2/2]

MLLinOpTemp& amrex_temp::MLLinOpTemp::operator= ( MLLinOpTemp &&  )
delete

◆ prepareForSolve()

virtual void amrex_temp::MLLinOpTemp::prepareForSolve ( )
inlineoverridevirtual

Prepare the solver for MG cycle.

Implements amrex::MLLinOp.


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