1#ifndef AMREX_MLALAPLACIAN_H_
2#define AMREX_MLALAPLACIAN_H_
3#include <AMReX_Config.H>
6#include <AMReX_MLALap_K.H>
25 using FAB =
typename MF::fab_type;
26 using RT =
typename MF::value_type;
81 [[nodiscard]]
int getNComp ()
const override {
return m_ncomp; }
91 [[nodiscard]]
bool isSingular (
int amrlev) const final {
return m_is_singular[amrlev]; }
95 void Fapply (
int amrlev,
int mglev, MF& out,
const MF& in)
const final;
97 void Fsmooth (
int amrlev,
int mglev, MF& sol,
const MF& rhs,
int redblack)
const final;
106 int face_only=0) const final;
109 void normalize (
int amrlev,
int mglev, MF& mf) const final;
116 [[nodiscard]] MF
const*
getACoeffs (
int amrlev,
int mglev)
const final
117 {
return &(m_a_coeffs[amrlev][mglev]); }
122 [[nodiscard]] std::unique_ptr<MLLinOpT<MF>>
makeNLinOp (
int )
const final {
123 amrex::Abort(
"MLALaplacian::makeNLinOp: Not implemented");
124 return std::unique_ptr<MLLinOpT<MF>>{};
145 bool m_needs_update =
true;
147 RT m_a_scalar = std::numeric_limits<RT>::quiet_NaN();
148 RT m_b_scalar = std::numeric_limits<RT>::quiet_NaN();
155 void updateSingularFlag ();
158template <
typename MF>
167 define(a_geom, a_grids, a_dmap, a_info, a_factory);
170template <
typename MF>
182 const int ncomp = this->getNComp();
184 m_a_coeffs.resize(this->m_num_amr_levels);
185 for (
int amrlev = 0; amrlev < this->m_num_amr_levels; ++amrlev)
187 m_a_coeffs[amrlev].resize(this->m_num_mg_levels[amrlev]);
188 for (
int mglev = 0; mglev < this->m_num_mg_levels[amrlev]; ++mglev)
190 m_a_coeffs[amrlev][mglev].define(this->m_grids[amrlev][mglev],
191 this->m_dmap[amrlev][mglev], ncomp, 0);
196template <
typename MF>
199template <
typename MF>
207 for (
int amrlev = 0; amrlev < this->m_num_amr_levels; ++amrlev)
209 m_a_coeffs[amrlev][0].setVal(
RT(0.0));
212 m_needs_update =
true;
215template <
typename MF>
219 const int ncomp = this->getNComp();
220 m_a_coeffs[amrlev][0].LocalCopy(alpha, 0, 0, ncomp,
IntVect(0));
221 m_needs_update =
true;
224template <
typename MF>
228 BL_PROFILE(
"MLALaplacian::averageDownCoeffs()");
230 for (
int amrlev = this->m_num_amr_levels-1; amrlev > 0; --amrlev)
232 auto& fine_a_coeffs = m_a_coeffs[amrlev];
234 averageDownCoeffsSameAmrLevel(amrlev, fine_a_coeffs);
235 averageDownCoeffsToCoarseAmrLevel(amrlev);
238 averageDownCoeffsSameAmrLevel(0, m_a_coeffs[0]);
241template <
typename MF>
245 const int ncomp = this->getNComp();
246 const int nmglevs = a.
size();
247 for (
int mglev = 1; mglev < nmglevs; ++mglev)
249 if (m_a_scalar ==
RT(0.0))
251 a[mglev].setVal(
RT(0.0));
255 AMREX_ASSERT(amrlev == 0 || !this->hasHiddenDimension());
256 IntVect ratio = (amrlev > 0) ?
IntVect(this->mg_coarsen_ratio) : this->mg_coarsen_ratio_vec[mglev-1];
262template <
typename MF>
266 const int ncomp = this->getNComp();
267 auto& fine_a_coeffs = m_a_coeffs[flev ].back();
268 auto& crse_a_coeffs = m_a_coeffs[flev-1].front();
270 if (m_a_scalar !=
RT(0.0)) {
277template <
typename MF>
281 m_is_singular.clear();
282 m_is_singular.resize(this->m_num_amr_levels,
false);
283 auto itlo = std::ranges::find(this->m_lobc[0], BCType::Dirichlet);
284 auto ithi = std::ranges::find(this->m_hibc[0], BCType::Dirichlet);
285 if (itlo == this->m_lobc[0].
end() && ithi == this->m_hibc[0].
end())
287 for (
int alev = 0; alev < this->m_num_amr_levels; ++alev)
289 if (this->m_domain_covered[alev])
291 if (m_a_scalar == RT(0.0))
293 m_is_singular[alev] =
true;
299 RT asum = m_a_coeffs[alev].back().sum(0,
IntVect(0));
300 RT amax = m_a_coeffs[alev].back().norminf(0,1,
IntVect(0));
301 m_is_singular[alev] = (std::abs(asum) <= amax * RT(1.e-12));
307 if (!m_is_singular[0] && this->m_needs_coarse_data_for_bc &&
308 this->m_coarse_fine_bc_type == BCType::Neumann)
310 bool lev0_a_is_zero =
false;
311 if (m_a_scalar == RT(0.0)) {
312 lev0_a_is_zero =
true;
314 RT asum = m_a_coeffs[0].back().sum(0,
IntVect(0));
315 RT amax = m_a_coeffs[0].back().norminf(0,1,
IntVect(0));
316 lev0_a_is_zero = std::abs(asum) <= amax * RT(1.e-12);
319 if (lev0_a_is_zero) {
320 auto bbox = this->m_grids[0][0].minimalBox();
321 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
322 if (this->m_lobc[0][idim] == BCType::Dirichlet) {
325 if (this->m_hibc[0][idim] == BCType::Dirichlet) {
329 if (this->m_geom[0][0].Domain().contains(bbox)) {
330 m_is_singular[0] =
true;
336template <
typename MF>
340 BL_PROFILE(
"MLALaplacian::prepareForSolve()");
343 updateSingularFlag();
344 m_needs_update =
false;
347template <
typename MF>
353 updateSingularFlag();
354 m_needs_update =
false;
357template <
typename MF>
363 const int ncomp = this->getNComp();
365 const MF& acoef = m_a_coeffs[amrlev][mglev];
369 RT(this->m_geom[amrlev][mglev].InvCellSize(1)),
370 RT(this->m_geom[amrlev][mglev].InvCellSize(2)))};
371#if (AMREX_SPACEDIM < 3)
372 const RT dx =
RT(this->m_geom[amrlev][mglev].CellSize(0));
373 const RT probxlo =
RT(this->m_geom[amrlev][mglev].ProbLo(0));
376#if (AMREX_SPACEDIM == 3)
378 this->get_d1(dxinv[0], dxinv[1], dxinv[2])};
381 const RT ascalar = m_a_scalar;
382 const RT bscalar = m_b_scalar;
385#pragma omp parallel if (Gpu::notInLaunchRegion())
389 const Box& bx = mfi.tilebox();
390 const auto& xfab = in.array(mfi);
391 const auto& yfab = out.array(mfi);
392 const auto& afab = acoef.array(mfi);
394#if (AMREX_SPACEDIM != 3)
395 if (this->m_has_metric_term) {
398 mlalap_adotx_m(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, dx, probxlo, ncomp);
403 mlalap_adotx(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, ncomp);
407 if (this->hasHiddenDimension()) {
408 Box const& bx2d = this->compactify(bx);
409 const auto& xfab2d = this->compactify(xfab);
410 const auto& yfab2d = this->compactify(yfab);
411 const auto& afab2d = this->compactify(afab);
414 TwoD::mlalap_adotx(tbx2d, yfab2d, xfab2d, afab2d, dhinv, ascalar, bscalar, ncomp);
419 mlalap_adotx(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, ncomp);
426template <
typename MF>
432 const int ncomp = this->getNComp();
434 const MF& acoef = m_a_coeffs[amrlev][mglev];
438 RT(this->m_geom[amrlev][mglev].InvCellSize(1)),
439 RT(this->m_geom[amrlev][mglev].InvCellSize(2)))};
440#if (AMREX_SPACEDIM < 3)
441 const RT dx =
RT(this->m_geom[amrlev][mglev].CellSize(0));
442 const RT probxlo =
RT(this->m_geom[amrlev][mglev].ProbLo(0));
445#if (AMREX_SPACEDIM == 3)
447 this->get_d1(dxinv[0], dxinv[1], dxinv[2])};
450 const RT ascalar = m_a_scalar;
451 const RT bscalar = m_b_scalar;
454#pragma omp parallel if (Gpu::notInLaunchRegion())
458 const Box& bx = mfi.tilebox();
459 const auto& fab = mf.array(mfi);
460 const auto& afab = acoef.array(mfi);
462#if (AMREX_SPACEDIM != 3)
463 if (this->m_has_metric_term) {
466 mlalap_normalize_m(tbx, fab, afab, dxinv, ascalar, bscalar, dx, probxlo, ncomp);
471 mlalap_normalize(tbx, fab, afab, dxinv, ascalar, bscalar, ncomp);
475 if (this->hasHiddenDimension()) {
476 Box const& bx2d = this->compactify(bx);
477 const auto& fab2d = this->compactify(fab);
478 const auto& afab2d = this->compactify(afab);
481 TwoD::mlalap_normalize(tbx2d, fab2d, afab2d, dhinv, ascalar, bscalar, ncomp);
486 mlalap_normalize(tbx, fab, afab, dxinv, ascalar, bscalar, ncomp);
493template <
typename MF>
499 const int ncomp = this->getNComp();
501 const MF& acoef = m_a_coeffs[amrlev][mglev];
502 const auto& undrrelxr = this->m_undrrelxr[amrlev][mglev];
503 const auto& maskvals = this->m_maskvals [amrlev][mglev];
507 const auto& f0 = undrrelxr[oitr()]; ++oitr;
508 const auto& f1 = undrrelxr[oitr()]; ++oitr;
509#if (AMREX_SPACEDIM > 1)
510 const auto& f2 = undrrelxr[oitr()]; ++oitr;
511 const auto& f3 = undrrelxr[oitr()]; ++oitr;
512#if (AMREX_SPACEDIM > 2)
513 const auto& f4 = undrrelxr[oitr()]; ++oitr;
514 const auto& f5 = undrrelxr[oitr()]; ++oitr;
520#if (AMREX_SPACEDIM > 1)
523#if (AMREX_SPACEDIM > 2)
529 const Real* dxinv = this->m_geom[amrlev][mglev].InvCellSize();
531 const RT dhy = m_b_scalar*
RT(dxinv[1]*dxinv[1]);,
532 const RT dhz = m_b_scalar*
RT(dxinv[2]*dxinv[2]););
534#if (AMREX_SPACEDIM == 3)
535 RT dh0 = this->get_d0(dhx, dhy, dhz);
536 RT dh1 = this->get_d1(dhx, dhy, dhz);
539#if (AMREX_SPACEDIM < 3)
540 const RT dx =
RT(this->m_geom[amrlev][mglev].CellSize(0));
541 const RT probxlo =
RT(this->m_geom[amrlev][mglev].ProbLo(0));
544 const RT alpha = m_a_scalar;
550#pragma omp parallel if (Gpu::notInLaunchRegion())
554 const auto& m0 = mm0.
array(mfi);
555 const auto& m1 = mm1.
array(mfi);
556#if (AMREX_SPACEDIM > 1)
557 const auto& m2 = mm2.
array(mfi);
558 const auto& m3 = mm3.
array(mfi);
559#if (AMREX_SPACEDIM > 2)
560 const auto& m4 = mm4.
array(mfi);
561 const auto& m5 = mm5.
array(mfi);
565 const Box& tbx = mfi.tilebox();
566 const Box& vbx = mfi.validbox();
567 const auto& solnfab = sol.array(mfi);
568 const auto& rhsfab = rhs.array(mfi);
569 const auto& afab = acoef.array(mfi);
571 const auto& f0fab = f0.array(mfi);
572 const auto& f1fab = f1.array(mfi);
573#if (AMREX_SPACEDIM > 1)
574 const auto& f2fab = f2.array(mfi);
575 const auto& f3fab = f3.array(mfi);
576#if (AMREX_SPACEDIM > 2)
577 const auto& f4fab = f4.array(mfi);
578 const auto& f5fab = f5.array(mfi);
582#if (AMREX_SPACEDIM == 1)
583 if (this->m_has_metric_term) {
586 mlalap_gsrb_m(thread_box, solnfab, rhsfab, alpha, dhx,
596 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx,
600 vbx, redblack, ncomp);
606#if (AMREX_SPACEDIM == 2)
607 if (this->m_has_metric_term) {
610 mlalap_gsrb_m(thread_box, solnfab, rhsfab, alpha, dhx, dhy,
622 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx, dhy,
628 vbx, redblack, ncomp);
633#if (AMREX_SPACEDIM == 3)
634 if (this->hasHiddenDimension()) {
635 Box const& tbx_2d = this->compactify(tbx);
636 Box const& vbx_2d = this->compactify(vbx);
637 const auto& solnfab_2d = this->compactify(solnfab);
638 const auto& rhsfab_2d = this->compactify(rhsfab);
639 const auto& afab_2d = this->compactify(afab);
640 const auto& f0fab_2d = this->compactify(this->get_d0(f0fab,f1fab,f2fab));
641 const auto& f1fab_2d = this->compactify(this->get_d1(f0fab,f1fab,f2fab));
642 const auto& f2fab_2d = this->compactify(this->get_d0(f3fab,f4fab,f5fab));
643 const auto& f3fab_2d = this->compactify(this->get_d1(f3fab,f4fab,f5fab));
644 const auto& m0_2d = this->compactify(this->get_d0(m0,m1,m2));
645 const auto& m1_2d = this->compactify(this->get_d1(m0,m1,m2));
646 const auto& m2_2d = this->compactify(this->get_d0(m3,m4,m5));
647 const auto& m3_2d = this->compactify(this->get_d1(m3,m4,m5));
650 TwoD::mlalap_gsrb(thread_box, solnfab_2d, rhsfab_2d, alpha, dh0, dh1,
656 vbx_2d, redblack, ncomp);
661 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx, dhy, dhz,
669 vbx, redblack, ncomp);
676template <
typename MF>
684 const int ncomp = this->getNComp();
687 const Real* dxinv = this->m_geom[amrlev][mglev].InvCellSize();
690 const auto& fyarr = flux[1]->array();,
691 const auto& fzarr = flux[2]->array(););
692 const auto& solarr = sol.array();
694#if (AMREX_SPACEDIM != 3)
695 const RT dx =
RT(this->m_geom[amrlev][mglev].CellSize(0));
696 const RT probxlo =
RT(this->m_geom[amrlev][mglev].ProbLo(0));
699#if (AMREX_SPACEDIM == 3)
701 if (this->hiddenDirection() != 0) {
702 RT fac = m_b_scalar *
RT(dxinv[0]);
707 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
710 flux[0]->template setVal<RunOn::Device>(
RT(0.0));
712 if (this->hiddenDirection() != 1) {
713 RT fac = m_b_scalar *
RT(dxinv[1]);
718 mlalap_flux_yface(tbox, fyarr, solarr, fac, blen, ncomp);
721 flux[1]->template setVal<RunOn::Device>(
RT(0.0));
723 if (this->hiddenDirection() != 2) {
724 RT fac = m_b_scalar *
RT(dxinv[2]);
729 mlalap_flux_zface(tbox, fzarr, solarr, fac, blen, ncomp);
732 flux[2]->template setVal<RunOn::Device>(
RT(0.0));
735 if (this->hiddenDirection() != 0) {
736 RT fac = m_b_scalar *
RT(dxinv[0]);
740 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
743 flux[0]->template setVal<RunOn::Device>(
RT(0.0));
745 if (this->hiddenDirection() != 1) {
746 RT fac = m_b_scalar *
RT(dxinv[1]);
750 mlalap_flux_y(tbox, fyarr, solarr, fac, ncomp);
753 flux[1]->template setVal<RunOn::Device>(
RT(0.0));
755 if (this->hiddenDirection() != 2) {
756 RT fac = m_b_scalar *
RT(dxinv[2]);
760 mlalap_flux_z(tbox, fzarr, solarr, fac, ncomp);
763 flux[2]->template setVal<RunOn::Device>(
RT(0.0));
766#elif (AMREX_SPACEDIM == 2)
768 if (this->hiddenDirection() != 0) {
769 RT fac = m_b_scalar *
RT(dxinv[0]);
772 if (this->m_has_metric_term) {
775 mlalap_flux_xface_m(tbox, fxarr, solarr, fac, blen, dx, probxlo, ncomp);
780 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
784 flux[0]->template setVal<RunOn::Device>(
RT(0.0));
786 if (this->hiddenDirection() != 1) {
787 RT fac = m_b_scalar *
RT(dxinv[1]);
790 if (this->m_has_metric_term) {
793 mlalap_flux_yface_m(tbox, fyarr, solarr, fac, blen, dx, probxlo, ncomp);
798 mlalap_flux_yface(tbox, fyarr, solarr, fac, blen, ncomp);
802 flux[1]->template setVal<RunOn::Device>(
RT(0.0));
805 if (this->hiddenDirection() != 0) {
806 RT fac = m_b_scalar *
RT(dxinv[0]);
808 if (this->m_has_metric_term) {
811 mlalap_flux_x_m(tbox, fxarr, solarr, fac, dx, probxlo, ncomp);
816 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
820 flux[0]->template setVal<RunOn::Device>(
RT(0.0));
822 if (this->hiddenDirection() != 1) {
823 RT fac = m_b_scalar *
RT(dxinv[1]);
825 if (this->m_has_metric_term) {
828 mlalap_flux_y_m(tbox, fyarr, solarr, fac, dx, probxlo, ncomp);
833 mlalap_flux_y(tbox, fyarr, solarr, fac, ncomp);
837 flux[1]->template setVal<RunOn::Device>(
RT(0.0));
842 RT fac = m_b_scalar *
RT(dxinv[0]);
845 if (this->m_has_metric_term) {
848 mlalap_flux_xface_m(tbox, fxarr, solarr, fac, blen, dx, probxlo, ncomp);
853 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
857 RT fac = m_b_scalar *
RT(dxinv[0]);
859 if (this->m_has_metric_term) {
862 mlalap_flux_x_m(tbox, fxarr, solarr, fac, dx, probxlo, ncomp);
867 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
#define BL_PROFILE(a)
Definition AMReX_BLProfiler.H:562
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
#define AMREX_GPU_LAUNCH_HOST_DEVICE_LAMBDA_RANGE(TN, TI, block)
Definition AMReX_GpuLaunchMacrosC.nolint.H:4
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
__host__ __device__ IntVectND< dim > length() const noexcept
Return the length of the BoxND.
Definition AMReX_Box.H:167
Abstract factory interface for creating, aliasing, and destroying FAB objects.
Definition AMReX_FabFactory.H:73
Iterator for looping ever tiles and boxes of amrex::FabArray based containers.
Definition AMReX_MFIter.H:88
Box tilebox() const noexcept
Return the tile Box at the current index.
Definition AMReX_MFIter.cpp:389
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition AMReX_MFIter.H:176
Multi-component ALaplacian (a scalar plus optional spatial a coeffs).
Definition AMReX_MLALaplacian.H:22
RT getAScalar() const final
Scalar alpha applied to the a term.
Definition AMReX_MLALaplacian.H:112
MLALaplacianT< MF > & operator=(const MLALaplacianT< MF > &)=delete
MLALaplacianT(const MLALaplacianT< MF > &)=delete
void averageDownCoeffsToCoarseAmrLevel(int flev)
Average a coefficients from fine AMR level flev to flev-1.
Definition AMReX_MLALaplacian.H:264
~MLALaplacianT() override
typename MF::fab_type FAB
Definition AMReX_MLALaplacian.H:25
void setScalars(RT a, RT b) noexcept
Set constant scalars a and b in a \phi - b \nabla^2 \phi.
Definition AMReX_MLALaplacian.H:201
void FFlux(int amrlev, const MFIter &mfi, const Array< FAB *, 3 > &flux, const FAB &sol, Location, int face_only=0) const final
Produce face fluxes on AMR level amrlev for the tilebox described by mfi using sol,...
Definition AMReX_MLALaplacian.H:678
void update() override
Update for reuse.
Definition AMReX_MLALaplacian.H:349
bool isBottomSingular() const final
Shortcut for the coarsest level singular flag.
Definition AMReX_MLALaplacian.H:93
std::unique_ptr< MLLinOpT< MF > > makeNLinOp(int) const final
Create the NSolve counterpart of this operator with the requested grid size.
Definition AMReX_MLALaplacian.H:122
Array< MF const *, 3 > getBCoeffs(int, int) const final
ALaplacian has no b coefficients; this returns null pointers.
Definition AMReX_MLALaplacian.H:119
MF const * getACoeffs(int amrlev, int mglev) const final
Access the stored a coefficient MultiFab for (amrlev,mglev).
Definition AMReX_MLALaplacian.H:116
void prepareForSolve() final
Complete per-level setup (averaging, singularity flags) before solving.
Definition AMReX_MLALaplacian.H:338
void Fapply(int amrlev, int mglev, MF &out, const MF &in) const final
Apply the ALaplacian to in (writing out) on (amrlev,mglev).
Definition AMReX_MLALaplacian.H:359
void averageDownCoeffs()
Average a coefficients down across all AMR and MG levels.
Definition AMReX_MLALaplacian.H:226
MLALaplacianT(MLALaplacianT< MF > &&)=delete
bool isSingular(int amrlev) const final
True if level amrlev is singular.
Definition AMReX_MLALaplacian.H:91
MLALaplacianT()=default
Construct an empty operator; call define() before use.
void normalize(int amrlev, int mglev, MF &mf) const final
Divide mf by the diagonal of the operator (used by CG-family bottom solvers).
Definition AMReX_MLALaplacian.H:428
void Fsmooth(int amrlev, int mglev, MF &sol, const MF &rhs, int redblack) const final
Run a smoothing sweep on (amrlev,mglev). redblack selects the red (0) or black (1) half of the grid.
Definition AMReX_MLALaplacian.H:495
bool needsUpdate() const override
Does it need update if it's reused?
Definition AMReX_MLALaplacian.H:83
void define(const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={})
Bind the operator to an AMR hierarchy (no overset support).
Definition AMReX_MLALaplacian.H:172
RT getBScalar() const final
Scalar beta applied to the Laplacian term.
Definition AMReX_MLALaplacian.H:114
void averageDownCoeffsSameAmrLevel(int amrlev, Vector< MF > &a)
Average a coefficients down within a single AMR level (fine-to-coarse MG).
Definition AMReX_MLALaplacian.H:243
typename MF::value_type RT
Definition AMReX_MLALaplacian.H:26
int getNComp() const override
Return number of components.
Definition AMReX_MLALaplacian.H:81
void setACoeffs(int amrlev, const MF &alpha)
Provide per-cell a coefficients on AMR level amrlev (stored directly in alpha).
Definition AMReX_MLALaplacian.H:217
typename MLLinOpT< MF >::Location Location
Definition AMReX_MLALaplacian.H:29
Cell-centered operator that exposes ABec Laplacian helpers to derived classes.
Definition AMReX_MLCellABecLap.H:22
void define(const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={})
Describe the AMR hierarchy when overset masks are not required.
Definition AMReX_MLCellABecLap.H:150
void prepareForSolve() override
Standard hook called before MLMG iterates (fixes BC data, etc.).
Definition AMReX_MLCellABecLap.H:309
void update() override
Average coefficients/metrics when marked dirty.
Definition AMReX_MLCellABecLap.H:302
Definition AMReX_MultiMask.H:23
Array4< int const > array(const MFIter &mfi) const noexcept
Return an Array4 view (const) for iterator mfi.
Definition AMReX_MultiMask.H:69
An Iterator over the Orientation of Faces of a Box.
Definition AMReX_Orientation.H:135
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
Long size() const noexcept
Definition AMReX_Vector.H:54
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:80
__host__ __device__ BoxND< dim > surroundingNodes(const BoxND< dim > &b, int dir) noexcept
Return a BoxND with NODE based coordinates in direction dir that encloses BoxND b.
Definition AMReX_Box.H:1582
__host__ __device__ BoxND< dim > bdryLo(const BoxND< dim > &b, int dir, int len=1) noexcept
Return the BoxND of length len on the low boundary of b along coordinate direction dir.
Definition AMReX_Box.H:1715
std::array< T, N > Array
Definition AMReX_Array.H:31
bool notInLaunchRegion() noexcept
Definition AMReX_GpuControl.H:89
Definition AMReX_Amr.cpp:50
void average_down(const MultiFab &S_fine, MultiFab &S_crse, const Geometry &fgeom, const Geometry &cgeom, int scomp, int ncomp, int rr)
Definition AMReX_MultiFabUtil.cpp:359
LinOpBCType
Definition AMReX_LO_BCTYPES.H:27
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
bool TilingIfNotGPU() noexcept
Definition AMReX_MFIter.H:12
void Abort(const std::string &msg)
Print a fatal-error message to stderr and abort execution.
Definition AMReX.cpp:242
__host__ __device__ Dim3 end(BoxND< dim > const &box) noexcept
Return the iterator end coordinate of box as Dim3.
Definition AMReX_Box.H:2257
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:52
Configuration knobs for multilevel linear operators (grid agglomeration, metrics, etc....
Definition AMReX_MLLinOp.H:51
Location
Definition AMReX_MLLinOp.H:119
Definition AMReX_MFIter.H:20
MFItInfo & SetDynamic(bool f) noexcept
Definition AMReX_MFIter.H:43
MFItInfo & EnableTiling(const IntVect &ts=FabArrayBase::mfiter_tile_size) noexcept
Definition AMReX_MFIter.H:31