![]() |
Block-Structured AMR Software Framework
|
Abstract base class for multilevel linear operators used by MLMG and the bottom solvers. More...
#include <AMReX_MLLinOp.H>
Public Types | |
| 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 | |
| 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 |
| virtual void | setLevelBC (int, const MF *, const MF *=nullptr, const MF *=nullptr, const MF *=nullptr)=0 |
| Set boundary conditions for given level. For cell-centered solves only. | |
| 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 | 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 | interpAssign (int amrlev, int fmglev, MF &fine, MF &crse) const |
| Overwrite fine MG level data with interpolated coarse data. | |
| virtual void | interpolationAmr (int famrlev, MF &fine, const MF &crse, IntVect const &nghost) const |
| Interpolation between AMR levels. | |
| 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 | apply (int amrlev, int mglev, MF &out, MF &in, BCMode bc_mode, StateMode s_mode, const MLMGBndryT< MF > *bndry=nullptr) const =0 |
| Apply the linear operator, out = L(in) | |
| virtual void | smooth (int amrlev, int mglev, MF &sol, const MF &rhs, bool skip_fillboundary, int niter) const =0 |
| Smooth. | |
| 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 | solutionResidual (int amrlev, MF &resid, MF &x, const MF &b, const MF *crse_bcdata=nullptr)=0 |
| Compute residual for solution. | |
| virtual void | prepareForFluxes (int amrlev, const MF *crse_bcdata=nullptr) |
| Ensure BC caches are populated before flux extraction. | |
| virtual void | correctionResidual (int amrlev, int mglev, MF &resid, MF &x, const MF &b, BCMode bc_mode, const MF *crse_bcdata=nullptr)=0 |
| Compute residual for the residual-correction form, resid = b - L(x) | |
| 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 void | applyOverset (int amrlev, MF &rhs) const |
| Overset-only hook for zeroing regions covered by masks. | |
| virtual bool | scaleRHS (int amrlev, MF *rhs) const |
| Optionally scale the RHS to fix solvability. | |
| virtual Vector< RT > | getSolvabilityOffset (int amrlev, int mglev, MF const &rhs) const |
| Compute offsets used to enforce solvability (per component). | |
| virtual void | fixSolvabilityByOffset (int amrlev, int mglev, MF &rhs, Vector< RT > const &offset) const |
| Subtract previously computed offsets from the RHS. | |
| virtual void | prepareForSolve ()=0 |
| Finalize coefficients, masks, and BC data before iterative solves. | |
| virtual void | preparePrecond () |
| Prepare auxiliary data used when the operator acts as a preconditioner. | |
| virtual void | setDirichletNodesToZero (int amrlev, int mglev, MF &mf) const |
| Optional hook for masking out Dirichlet nodes or cells prior to GMRES solves; the default is a no-op with a warning. | |
| virtual bool | isSingular (int amrlev) const =0 |
Is it singular on AMR level amrlev? | |
| virtual bool | isBottomSingular () const =0 |
| Is the bottom of the multigrid hierarchy singular? | |
| virtual RT | xdoty (int amrlev, int mglev, const MF &x, const MF &y, bool local) const =0 |
| Dot-product helper used by bottom solvers. | |
| virtual RT | dotProductPrecond (Vector< MF const * > const &x, Vector< MF const * > const &y) const |
| Dot product over the composite AMR hierarchy, excluding cells covered by finer levels. Used when the operator acts as a preconditioner. | |
| virtual RT | norm2Precond (Vector< MF const * > const &x) const |
| L2 norm over the composite AMR hierarchy, excluding cells covered by finer levels. Used when the operator acts as a preconditioner. | |
| 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 | supportNSolve () const |
| Whether this operator supports NSolve. | |
| 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 RT | normInf (int amrlev, MF const &mf, bool local) const =0 |
| Infinity norm helper used by residual reductions. | |
| virtual void | averageDownAndSync (Vector< MF > &sol) const =0 |
| Average the solution hierarchy down (fine to coarse) and synchronize interfaces. | |
| virtual void | avgDownResAmr (int clev, MF &cres, MF const &fres) const |
| 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). | |
Public Attributes | |
| 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 | |
| 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 | 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 > | |
| 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 Attributes | |
| static constexpr int | mg_coarsen_ratio = 2 |
| static constexpr int | mg_box_min_width = 2 |
Friends | |
| template<typename T > | |
| class | MLMGT |
| template<typename T > | |
| class | MLCGSolverT |
| template<typename T > | |
| class | MLPoissonT |
| template<typename T > | |
| class | MLABecLaplacianT |
| template<typename T > | |
| class | GMRESMLMGT |
Abstract base class for multilevel linear operators used by MLMG and the bottom solvers.
Specializations expose domain/AMR metadata, boundary-condition wiring, and hooks for applying the operator and its coarse/fine helpers.
| using amrex::MLLinOpT< MF >::BCMode = LinOpEnumType::BCMode |
| using amrex::MLLinOpT< MF >::BCType = LinOpBCType |
| using amrex::MLLinOpT< MF >::FAB = typename FabDataType<MF>::fab_type |
| using amrex::MLLinOpT< MF >::Location = LinOpEnumType::Location |
| using amrex::MLLinOpT< MF >::MFType = MF |
| using amrex::MLLinOpT< MF >::RT = typename FabDataType<MF>::value_type |
| using amrex::MLLinOpT< MF >::StateMode = LinOpEnumType::StateMode |
|
default |
|
virtualdefault |
|
delete |
|
delete |
|
inlineprotectednoexcept |
Return AMR refinement ratios.
|
inlineprotectednoexcept |
Return AMR refinement ratio at given AMR level.
|
inlineprotectednoexcept |
Return AMR refinement ratio as IntVect (1 in hidden direction)
|
pure virtual |
Apply the linear operator, out = L(in)
| amrlev | AMR level |
| mglev | MG level |
| out | output |
| in | input |
| bc_mode | Is the BC homogeneous or inhomogeneous? |
| s_mode | Are data data solution or correction? |
| bndry | object for handling coarse/fine and physical boundaries |
Implemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Add extra terms introduced when treating inhomogeneous Neumann BC as homogeneous.
| amrlev | AMR level index. |
| rhs | RHS MultiFab updated in place. |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
inlinevirtual |
Apply metric scaling to the RHS on (amrlev,mglev).
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| rhs | Right-hand side updated in place. |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Overset-only hook for zeroing regions covered by masks.
| amrlev | AMR level index. |
| rhs | RHS MultiFab whose covered regions are zeroed. |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
pure virtual |
Average the solution hierarchy down (fine to coarse) and synchronize interfaces.
| sol | Vector of MultiFabs spanning all AMR levels. |
Implemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Average-down data from fine AMR level to coarse AMR level.
| camrlev | coarse AMR level |
| crse_sol | solutoin on coarse AMR level |
| crse_rhs | RHS on coarse AMR level |
| fine_sol | solution on fine AMR level |
| fine_rhs | RHS on fine AMR level |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
virtual |
Average residuals from fine to coarse MG levels (FMG helper).
| clev | Coarse MG level index. |
| cres | Destination coarse residual. |
| fres | Source fine residual. |
|
inlinevirtual |
Called when the operator starts being used as a preconditioner.
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
protectednoexcept |
|
inlinevirtual |
Compute fluxes.
| amrlev | AMR level |
| fluxes | fluxes |
| sol | solution |
| loc | location of the fluxes |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Compute gradients of the solution.
| amrlev | AMR level |
| grad | grad(sol) |
| sol | solution |
| loc | location of the gradients |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Copy an NSolve solution from src to dst.
| dst | Destination MultiFab. |
| src | Source nodal solution. |
Reimplemented in amrex::MLABecLaplacianT< MF >, and amrex::MLPoissonT< MF >.
|
pure virtual |
Compute residual for the residual-correction form, resid = b - L(x)
| amrlev | AMR level |
| mglev | MG level |
| resid | residual |
| x | unknown in the residual-correction form |
| b | RHS in the residual-correction form |
| bc_mode | Is the BC homogeneous or inhomogeneous? |
| crse_bcdata | optional argument providing BC at coarse/fine boundary. |
Implemented in amrex::MLCellLinOpT< MF >.
| void amrex::MLLinOpT< MF >::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.
| a_geom | Per-level geometries. |
| a_grids | Per-level grid layouts. |
| a_dmap | Per-level distribution maps. |
| a_info | LPInfo describing coarsening/agglomeration limits. |
| a_factory | Optional EB-aware factories per level (may be null). |
| eb_limit_coarsening | True to forbid coarsening beyond where EB geometry information is available. |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
virtual |
Dot product over the composite AMR hierarchy, excluding cells covered by finer levels. Used when the operator acts as a preconditioner.
| x | Vector of pointers to fields (one per AMR level). |
| y | Second vector of pointers (same length as x). |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Called when the operator stops being used as a preconditioner.
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlineprotectednoexcept |
|
inlinevirtual |
Subtract previously computed offsets from the RHS.
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| rhs | RHS updated in place. |
| offset | Offsets returned by getSolvabilityOffset(). |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinenoexcept |
Geometry accessor for (amr_lev,mglev).
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlinevirtual |
Reimplemented in amrex::MLNodeLaplacian.
|
inlinevirtual |
Extract embedded-boundary fluxes.
| a_flux | Destination EB flux MultiFabs (one per level). |
| a_sol | Solution hierarchy sampled on EB faces. |
|
inlinenoexcept |
Get the flag for whether the solver should try to make singular problem solvable.
|
inlinevirtual |
Extract per-direction fluxes for each AMR level.
| a_flux | Destination flux arrays (per level, per direction). |
| a_sol | Solution hierarchy supplying the gradients. |
| a_loc | Location where fluxes are evaluated (faces/centroids). |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
inlinevirtual |
Extract fluxes when the operator stores them in single MultiFabs per level.
| a_flux | Destination MultiFabs (one per level). |
| a_sol | Source solutions (one per level). |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
inlinenoexcept |
Get order of interpolation at coarse/fine boundary.
|
inlinevirtual |
Return number of components.
Reimplemented in amrex::MLEBTensorOp, amrex::MLTensorOp, amrex::MLABecLaplacianT< MF >, amrex::MLALaplacianT< MF >, and amrex::MLEBABecLap.
|
inlinevirtual |
|
inlineprotectedvirtual |
Reimplemented in amrex::MLCurlCurl.
|
inlinevirtual |
Compute offsets used to enforce solvability (per component).
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| rhs | Right-hand side examined to compute the offsets. |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
protectednoexcept |
|
inlineprotectednoexcept |
|
protectednoexcept |
|
protectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlinevirtual |
Overwrite fine MG level data with interpolated coarse data.
| amrlev | AMR level |
| fmglev | fine MG level |
| fine | fine MG level data |
| crse | coarse MG level data |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
pure virtual |
Add interpolated coarse MG level data to fine MG level data.
| amrlev | AMR level |
| fmglev | fine MG level |
| crse | coarse data. |
| fine | fine data. |
Implemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Interpolation between AMR levels.
| famrlev | fine AMR level |
| fine | fine level data |
| crse | coarse level data |
| nghost | number of ghost cells |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlineprotectednoexcept |
|
pure virtual |
Is the bottom of the multigrid hierarchy singular?
Implemented in amrex::MLALaplacianT< MF >, amrex::MLEBNodeFDLaplacian, amrex::MLEBTensorOp, amrex::MLNodeABecLaplacian, amrex::MLPoissonT< MF >, amrex::MLTensorOp, amrex::MLABecLaplacianT< MF >, amrex::MLCurlCurl, amrex::MLEBABecLap, and amrex::MLNodeLinOp.
|
inlineprotectednoexcept |
| bool amrex::MLLinOpT< MF >::isMFIterSafe | ( | int | amrlev, |
| int | mglev1, | ||
| int | mglev2 | ||
| ) | const |
Check whether mixing MFIter loops for different MG levels is safe.
| amrlev | AMR level index. |
| mglev1 | First MG level. |
| mglev2 | Second MG level. |
|
pure virtual |
Is it singular on AMR level amrlev?
Implemented in amrex::MLALaplacianT< MF >, amrex::MLPoissonT< MF >, amrex::MLABecLaplacianT< MF >, amrex::MLEBABecLap, amrex::MLNodeLinOp, amrex::MLEBNodeFDLaplacian, amrex::MLEBTensorOp, amrex::MLNodeABecLaplacian, amrex::MLTensorOp, and amrex::MLCurlCurl.
|
inlineprotectednoexcept |
|
protectedvirtual |
Reimplemented in amrex::MLCurlCurl.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Allocate an MF on the next coarser AMR level (famrlev-1) with grow cells ng.
Reimplemented in amrex::MLCurlCurl.
|
protectedvirtual |
Allocate an MF on the next coarser MG level (mglev+1) with grow cells ng.
Reimplemented in amrex::MLCurlCurl.
|
inlineprotectedvirtual |
Reimplemented in amrex::MLEBABecLap, and amrex::MLEBNodeFDLaplacian.
|
inlinevirtual |
Create the NSolve counterpart of this operator with the requested grid size.
| grid_size | Target maximum grid dimension for the nodal hierarchy. |
Reimplemented in amrex::MLPoissonT< MF >, amrex::MLABecLaplacianT< MF >, amrex::MLALaplacianT< MF >, and amrex::MLEBABecLap.
|
inlinevirtual |
Reimplemented in amrex::MLCurlCurl, amrex::MLEBNodeFDLaplacian, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacian, and amrex::MLNodeTensorLaplacian.
|
inlinenoexcept |
Return the number of AMR levels.
|
inlinenoexcept |
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.
|
inlinevirtual |
Does it need update if it's reused?
Reimplemented in amrex::MLEBTensorOp, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacian, amrex::MLTensorOp, amrex::MLABecLaplacianT< MF >, amrex::MLALaplacianT< MF >, amrex::MLCellABecLapT< MF >, amrex::MLCellLinOpT< MF >, amrex::MLCurlCurl, amrex::MLEBABecLap, and amrex::MLEBNodeFDLaplacian.
|
inlinenoexcept |
Return the number of MG levels at given AMR level.
|
virtual |
L2 norm over the composite AMR hierarchy, excluding cells covered by finer levels. Used when the operator acts as a preconditioner.
| x | Vector of pointers to fields (one per AMR level). |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Divide mf by the diagonal component of the operator. Used by the bottom solvers.
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| mf | MultiFab divided in place. |
Reimplemented in amrex::MLALaplacianT< MF >, amrex::MLPoissonT< MF >, and amrex::MLABecLaplacianT< MF >.
|
pure virtual |
Infinity norm helper used by residual reductions.
| amrlev | AMR level index. |
| mf | MultiFab to measure. |
| local | True to skip MPI reductions. |
Implemented in amrex::MLCellLinOpT< MF >.
|
delete |
|
delete |
|
inlinevirtual |
Optional hook invoked after the main solve completes.
| sol | Solution hierarchy (one pointer per AMR level). |
|
inlinevirtual |
Ensure BC caches are populated before flux extraction.
| amrlev | AMR level whose fluxes will be queried. |
| crse_bcdata | Optional coarse data used to seed boundary values. |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
pure virtual |
Finalize coefficients, masks, and BC data before iterative solves.
Implemented in amrex::MLALaplacianT< MF >, amrex::MLEBNodeFDLaplacian, amrex::MLEBTensorOp, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacian, amrex::MLNodeTensorLaplacian, amrex::MLPoissonT< MF >, amrex::MLTensorOp, amrex::MLABecLaplacianT< MF >, amrex::MLCellABecLapT< MF >, amrex::MLCellLinOpT< MF >, amrex::MLCurlCurl, amrex::MLEBABecLap, and amrex::MLNodeLinOp.
|
inlinevirtual |
Prepare auxiliary data used when the operator acts as a preconditioner.
Reimplemented in amrex::MLCurlCurl, and amrex::MLNodeLinOp.
|
inlinevirtual |
Reflux at AMR coarse/fine boundary.
| crse_amrlev | coarse AMR level |
| res | coarse level residual |
| crse_sol | coarse level solution |
| crse_rhs | coarse level RHS |
| fine_res | fine level residual |
| fine_sol | fine level solution |
| fine_rhs | fine level RHS |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
protectedvirtual |
Reimplemented in amrex::MLNodeLaplacian, and amrex::MLNodeLinOp.
|
pure virtual |
Restriction onto coarse MG level.
| amrlev | AMR level |
| cmglev | coarse MG level |
| crse | coarse data. This is the output. |
| fine | fine data. This is the input. Some operators might need to fill ghost cells. This is why it's not a const reference. |
Implemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Optionally scale the RHS to fix solvability.
| amrlev | AMR level receiving the scaling. |
| rhs | RHS pointer (may be null) scaled in place. |
|
noexcept |
|
noexcept |
|
noexcept |
Set coarse/fine boundary conditions. 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 Dirichlet by default. 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. The coarse/fine BC type can be changed to homogeneous Neumann by the bc_type argument. In that case, use nullptr for the crse argument.
| crse | the coarse AMR level data |
| crse_ratio | the coarsening ratio between fine and coarse AMR levels. |
| bc_type | optional. It's Dirichlet by default, and can be Neumann. |
|
noexcept |
|
inlineprotectednoexcept |
|
inlinevirtual |
Optional hook for masking out Dirichlet nodes or cells prior to GMRES solves; the default is a no-op with a warning.
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| mf | MultiFab whose entries are zeroed at Dirichlet locations. |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
noexcept |
Boundary of the whole domain.
This functions must be called, and must be called before other bc functions. This version is for single-component solve or when all the components have the same BC types.
| lobc | lower boundaries |
| hibc | upper boundaries |
| void amrex::MLLinOpT< MF >::setDomainBC | ( | const Vector< Array< BCType, 3 > > & | lobc, |
| const Vector< Array< BCType, 3 > > & | hibc | ||
| ) |
Boundary of the whole domain.
This functions must be called, and must be called before other bc functions. This version is for multi-component solve.
| lobc | lower boundaries |
| hibc | upper boundaries |
|
noexcept |
Set location offsets for the physical domain boundaries.
By default, domain BCs sit exactly on the domain faces. Call this when lower or upper faces are offset by a positive distance (values must be >= 0). Must be invoked before setLevelBC().
| lo_bcloc | Offsets for the lower faces in each coordinate direction. |
| hi_bcloc | Offsets for the upper faces in each coordinate direction. |
|
inlinenoexcept |
Control whether the solver should try to make singular problems solvable.
| o | True (default) enables solvability enforcement; false leaves RHS untouched. |
| void amrex::MLLinOpT< MF >::setLevelBC | ( | int | amrlev, |
| const AMF * | levelbcdata, | ||
| const AMF * | robinbc_a = nullptr, |
||
| const AMF * | robinbc_b = nullptr, |
||
| const AMF * | robinbc_f = nullptr |
||
| ) |
|
pure virtual |
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.
Implemented in amrex::MLCellLinOpT< MF >.
|
inlinenoexcept |
Set order of interpolation at coarse/fine boundary.
| o | Polynomial order (2, 3, or 4). |
|
inlinenoexcept |
Set verbosity.
| v | Verbosity level forwarded to MLMG logs. |
|
pure virtual |
Smooth.
| amrlev | AMR level |
| mglev | MG level |
| sol | unknowns |
| rhs | RHS |
| skip_fillboundary | flag controlling whether ghost cell filling can be skipped. |
| niter | number of (multicolor) smoothing iterations |
Implemented in amrex::MLCellLinOpT< MF >.
|
pure virtual |
Compute residual for solution.
| amrlev | AMR level |
| resid | residual |
| x | solution |
| b | RHS |
| crse_bcdata | optional argument providing BC at coarse/fine boundary. |
Implemented in amrex::MLCellLinOpT< MF >.
|
inlineprotectedvirtualnoexcept |
Reimplemented in amrex::MLCellABecLapT< MF >.
|
inlinevirtual |
Whether this operator supports NSolve.
Reimplemented in amrex::MLPoissonT< MF >, and amrex::MLABecLaplacianT< MF >.
|
inlineprotectedvirtualnoexcept |
Reimplemented in amrex::MLABecLaplacianT< MF >, and amrex::MLEBABecLap.
|
inlinevirtual |
Remove metric scaling previously applied via applyMetricTerm().
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| rhs | Right-hand side updated in place. |
Reimplemented in amrex::MLCellLinOpT< MF >.
|
inlinevirtual |
Undo Neumann contributions stored on the RHS.
| amrlev | AMR level index. |
| rhs | RHS MultiFab modified in place. |
|
inlinevirtual |
Update for reuse.
Reimplemented in amrex::MLEBTensorOp, amrex::MLNodeABecLaplacian, amrex::MLNodeLaplacian, amrex::MLTensorOp, amrex::MLABecLaplacianT< MF >, amrex::MLALaplacianT< MF >, amrex::MLCellABecLapT< MF >, amrex::MLCellLinOpT< MF >, amrex::MLCurlCurl, amrex::MLEBABecLap, and amrex::MLEBNodeFDLaplacian.
|
pure virtual |
Dot-product helper used by bottom solvers.
| amrlev | AMR level index. |
| mglev | Multigrid level index. |
| x | First vector. |
| y | Second vector. |
| local | True to skip MPI reductions. |
Implemented in amrex::MLCellLinOpT< MF >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
first Vector is for amr level and second is mg level
|
protected |
| Vector<Array<BCType, 3> > amrex::MLLinOpT< MF >::m_hibc |
| Vector<Array<BCType, 3> > amrex::MLLinOpT< MF >::m_hibc_orig |
|
protected |
| Vector<Array<BCType, 3> > amrex::MLLinOpT< MF >::m_lobc |
| Vector<Array<BCType, 3> > amrex::MLLinOpT< MF >::m_lobc_orig |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexprprotected |
|
staticconstexprprotected |
|
protected |
|
protected |
|
protected |