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 template <
typename AMF>
82 requires (!std::same_as<MF,AMF>)
85 [[nodiscard]]
int getNComp ()
const override {
return m_ncomp; }
99 [[nodiscard]]
bool isSingular (
int amrlev)
const final {
return m_is_singular[amrlev]; }
103 void Fapply (
int amrlev,
int mglev, MF& out,
const MF& in)
const final;
105 void Fsmooth (
int amrlev,
int mglev, MF& sol,
const MF& rhs,
int redblack)
const final;
114 int face_only=0) const final;
117 void normalize (
int amrlev,
int mglev, MF& mf) const final;
124 [[nodiscard]] MF
const*
getACoeffs (
int amrlev,
int mglev)
const final
125 {
return &(m_a_coeffs[amrlev][mglev]); }
130 [[nodiscard]] std::unique_ptr<MLLinOpT<MF>>
makeNLinOp (
int )
const final {
131 amrex::Abort(
"MLALaplacian::makeNLinOp: Not implemented");
132 return std::unique_ptr<MLLinOpT<MF>>{};
153 bool m_needs_update =
true;
155 RT m_a_scalar = std::numeric_limits<RT>::quiet_NaN();
156 RT m_b_scalar = std::numeric_limits<RT>::quiet_NaN();
163 void updateSingularFlag ();
170template <
typename MF>
179 define(a_geom, a_grids, a_dmap, a_info, a_factory);
182template <
typename MF>
193 this->
makeSPLinOp(a_info, [&] (
auto const& sp_info) {
194 return std::make_unique<MLALaplacianT<fMultiFab>>
195 (this->
spGeom(a_geom), a_grids, a_dmap, sp_info,
207 m_a_coeffs[amrlev][mglev].define(this->
m_grids[amrlev][mglev],
208 this->
m_dmap[amrlev][mglev], ncomp, 0);
213template <
typename MF>
216template <
typename MF>
226 m_a_coeffs[amrlev][0].setVal(
RT(0.0));
229 m_needs_update =
true;
233template <
typename MF>
238 m_a_coeffs[amrlev][0].LocalCopy(alpha, 0, 0, ncomp,
IntVect(0));
239 m_needs_update =
true;
243template <
typename MF>
244template <
typename AMF>
245requires (!std::same_as<MF,AMF>)
250 m_a_coeffs[amrlev][0].LocalCopy(alpha, 0, 0, ncomp,
IntVect(0));
251 m_needs_update =
true;
255template <
typename MF>
259 BL_PROFILE(
"MLALaplacian::averageDownCoeffs()");
263 auto& fine_a_coeffs = m_a_coeffs[amrlev];
272template <
typename MF>
277 const int nmglevs = a.
size();
278 for (
int mglev = 1; mglev < nmglevs; ++mglev)
280 if (m_a_scalar ==
RT(0.0))
282 a[mglev].setVal(
RT(0.0));
293template <
typename MF>
298 auto& fine_a_coeffs = m_a_coeffs[flev ].back();
299 auto& crse_a_coeffs = m_a_coeffs[flev-1].front();
301 if (m_a_scalar !=
RT(0.0)) {
308template <
typename MF>
310MLALaplacianT<MF>::updateSingularFlag ()
312 m_is_singular.clear();
313 m_is_singular.resize(this->m_num_amr_levels,
false);
314 auto itlo = std::ranges::find(this->m_lobc[0], BCType::Dirichlet);
315 auto ithi = std::ranges::find(this->m_hibc[0], BCType::Dirichlet);
316 if (itlo == this->m_lobc[0].
end() && ithi == this->m_hibc[0].
end())
318 for (
int alev = 0; alev < this->m_num_amr_levels; ++alev)
320 if (this->m_domain_covered[alev])
322 if (m_a_scalar == RT(0.0))
324 m_is_singular[alev] =
true;
330 RT asum = m_a_coeffs[alev].back().sum(0,
IntVect(0));
331 RT amax = m_a_coeffs[alev].back().norminf(0,1,
IntVect(0));
332 m_is_singular[alev] = (std::abs(asum) <= amax * RT(1.e-12));
338 if (!m_is_singular[0] && this->m_needs_coarse_data_for_bc &&
339 this->m_coarse_fine_bc_type == BCType::Neumann)
341 bool lev0_a_is_zero =
false;
342 if (m_a_scalar == RT(0.0)) {
343 lev0_a_is_zero =
true;
345 RT asum = m_a_coeffs[0].back().sum(0,
IntVect(0));
346 RT amax = m_a_coeffs[0].back().norminf(0,1,
IntVect(0));
347 lev0_a_is_zero = std::abs(asum) <= amax * RT(1.e-12);
350 if (lev0_a_is_zero) {
351 auto bbox = this->m_grids[0][0].minimalBox();
352 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
353 if (this->m_lobc[0][idim] == BCType::Dirichlet) {
356 if (this->m_hibc[0][idim] == BCType::Dirichlet) {
360 if (this->m_geom[0][0].Domain().contains(bbox)) {
361 m_is_singular[0] =
true;
367template <
typename MF>
371 BL_PROFILE(
"MLALaplacian::prepareForSolve()");
374 updateSingularFlag();
376 m_needs_update =
false;
379template <
typename MF>
385 updateSingularFlag();
387 m_needs_update =
false;
390template <
typename MF>
392MLALaplacianT<MF>::setSPScale ()
394 this->
template spForward<MLALaplacianT>([&] (
auto* sp) {
398 for (
int alev = 0; alev < this->m_num_amr_levels; ++alev) {
399 for (
int n = 0; n < m_ncomp; ++n) {
400 RT d = std::abs(m_a_scalar) * m_a_coeffs[alev][0].norminf(n, 1,
IntVect(0),
true);
401 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
402 if (idim == this->info.hidden_direction) {
continue; }
403 RT
const dxinv = RT(1.0) / this->m_geom[alev][0].CellSize(idim);
404 d += std::abs(m_b_scalar) * RT(2.0)*dxinv*dxinv;
406 diag[n] = std::max(diag[n], d);
412 RT
const sigma = this->spScaleFor(this->spDiagForScale(diag));
413 auto const lambda =
static_cast<RT
>(this->m_sp_length_scale);
414 this->m_sp_scale = sigma *
static_cast<RT
>(std::pow(lambda, this->spMetricExponent()));
415 sp->setScalars(
static_cast<float>(sigma * m_a_scalar),
416 static_cast<float>(sigma * lambda*lambda * m_b_scalar));
420template <
typename MF>
428 const MF& acoef = m_a_coeffs[amrlev][mglev];
432 RT(this->
m_geom[amrlev][mglev].InvCellSize(1)),
433 RT(this->
m_geom[amrlev][mglev].InvCellSize(2)))};
434#if (AMREX_SPACEDIM < 3)
435 const RT dx =
RT(this->
m_geom[amrlev][mglev].CellSize(0));
436 const RT probxlo =
RT(this->
m_geom[amrlev][mglev].ProbLo(0));
439#if (AMREX_SPACEDIM == 3)
441 this->
get_d1(dxinv[0], dxinv[1], dxinv[2])};
444 const RT ascalar = m_a_scalar;
445 const RT bscalar = m_b_scalar;
448#pragma omp parallel if (Gpu::notInLaunchRegion())
452 const Box& bx = mfi.tilebox();
453 const auto& xfab = in.array(mfi);
454 const auto& yfab = out.array(mfi);
455 const auto& afab = acoef.array(mfi);
457#if (AMREX_SPACEDIM != 3)
461 mlalap_adotx_m(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, dx, probxlo, ncomp);
466 mlalap_adotx(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, ncomp);
477 TwoD::mlalap_adotx(tbx2d, yfab2d, xfab2d, afab2d, dhinv, ascalar, bscalar, ncomp);
482 mlalap_adotx(tbx, yfab, xfab, afab, dxinv, ascalar, bscalar, ncomp);
489template <
typename MF>
497 const MF& acoef = m_a_coeffs[amrlev][mglev];
501 RT(this->
m_geom[amrlev][mglev].InvCellSize(1)),
502 RT(this->
m_geom[amrlev][mglev].InvCellSize(2)))};
503#if (AMREX_SPACEDIM < 3)
504 const RT dx =
RT(this->
m_geom[amrlev][mglev].CellSize(0));
505 const RT probxlo =
RT(this->
m_geom[amrlev][mglev].ProbLo(0));
508#if (AMREX_SPACEDIM == 3)
510 this->
get_d1(dxinv[0], dxinv[1], dxinv[2])};
513 const RT ascalar = m_a_scalar;
514 const RT bscalar = m_b_scalar;
517#pragma omp parallel if (Gpu::notInLaunchRegion())
521 const Box& bx = mfi.tilebox();
522 const auto& fab = mf.array(mfi);
523 const auto& afab = acoef.array(mfi);
525#if (AMREX_SPACEDIM != 3)
529 mlalap_normalize_m(tbx, fab, afab, dxinv, ascalar, bscalar, dx, probxlo, ncomp);
534 mlalap_normalize(tbx, fab, afab, dxinv, ascalar, bscalar, ncomp);
544 TwoD::mlalap_normalize(tbx2d, fab2d, afab2d, dhinv, ascalar, bscalar, ncomp);
549 mlalap_normalize(tbx, fab, afab, dxinv, ascalar, bscalar, ncomp);
556template <
typename MF>
564 const MF& acoef = m_a_coeffs[amrlev][mglev];
565 const auto& undrrelxr = this->
m_undrrelxr[amrlev][mglev];
566 const auto& maskvals = this->
m_maskvals [amrlev][mglev];
570 const auto& f0 = undrrelxr[oitr()]; ++oitr;
571 const auto& f1 = undrrelxr[oitr()]; ++oitr;
572#if (AMREX_SPACEDIM > 1)
573 const auto& f2 = undrrelxr[oitr()]; ++oitr;
574 const auto& f3 = undrrelxr[oitr()]; ++oitr;
575#if (AMREX_SPACEDIM > 2)
576 const auto& f4 = undrrelxr[oitr()]; ++oitr;
577 const auto& f5 = undrrelxr[oitr()]; ++oitr;
583#if (AMREX_SPACEDIM > 1)
586#if (AMREX_SPACEDIM > 2)
592 const Real* dxinv = this->
m_geom[amrlev][mglev].InvCellSize();
594 const RT dhy = m_b_scalar*
RT(dxinv[1]*dxinv[1]);,
595 const RT dhz = m_b_scalar*
RT(dxinv[2]*dxinv[2]););
597#if (AMREX_SPACEDIM == 3)
598 RT dh0 = this->
get_d0(dhx, dhy, dhz);
599 RT dh1 = this->
get_d1(dhx, dhy, dhz);
602#if (AMREX_SPACEDIM < 3)
603 const RT dx =
RT(this->
m_geom[amrlev][mglev].CellSize(0));
604 const RT probxlo =
RT(this->
m_geom[amrlev][mglev].ProbLo(0));
607 const RT alpha = m_a_scalar;
614 const auto& f0ma = f0.const_arrays();
615 const auto& f1ma = f1.const_arrays();
616#if (AMREX_SPACEDIM > 1)
619 const auto& f2ma = f2.const_arrays();
620 const auto& f3ma = f3.const_arrays();
621#if (AMREX_SPACEDIM > 2)
624 const auto& f4ma = f4.const_arrays();
625 const auto& f5ma = f5.const_arrays();
628 const auto& solnma = sol.arrays();
629 const auto& rhsma = rhs.const_arrays();
630 const auto& ama = acoef.const_arrays();
632#if (AMREX_SPACEDIM < 3)
637 Box vbx(ama[box_no]);
638 mlalap_gsrb_m(i,j,k,n, solnma[box_no], rhsma[box_no], alpha,
640 f0ma[box_no], m0ma[box_no],
641 f1ma[box_no], m1ma[box_no],
642#
if (AMREX_SPACEDIM > 1)
643 f2ma[box_no], m2ma[box_no],
644 f3ma[box_no], m3ma[box_no],
646 vbx, redblack, dx, probxlo);
654 Box vbx(ama[box_no]);
655 mlalap_gsrb(i,j,k,n, solnma[box_no], rhsma[box_no], alpha,
657 f0ma[box_no], m0ma[box_no],
658 f1ma[box_no], m1ma[box_no],
659#
if (AMREX_SPACEDIM > 1)
660 f2ma[box_no], m2ma[box_no],
661 f3ma[box_no], m3ma[box_no],
662#
if (AMREX_SPACEDIM > 2)
663 f4ma[box_no], m4ma[box_no],
664 f5ma[box_no], m5ma[box_no],
681#pragma omp parallel if (Gpu::notInLaunchRegion())
685 const auto& m0 = mm0.
array(mfi);
686 const auto& m1 = mm1.
array(mfi);
687#if (AMREX_SPACEDIM > 1)
688 const auto& m2 = mm2.
array(mfi);
689 const auto& m3 = mm3.
array(mfi);
690#if (AMREX_SPACEDIM > 2)
691 const auto& m4 = mm4.
array(mfi);
692 const auto& m5 = mm5.
array(mfi);
696 const Box& tbx = mfi.tilebox();
697 const Box& vbx = mfi.validbox();
698 const auto& solnfab = sol.array(mfi);
699 const auto& rhsfab = rhs.array(mfi);
700 const auto& afab = acoef.array(mfi);
702 const auto& f0fab = f0.array(mfi);
703 const auto& f1fab = f1.array(mfi);
704#if (AMREX_SPACEDIM > 1)
705 const auto& f2fab = f2.array(mfi);
706 const auto& f3fab = f3.array(mfi);
707#if (AMREX_SPACEDIM > 2)
708 const auto& f4fab = f4.array(mfi);
709 const auto& f5fab = f5.array(mfi);
713#if (AMREX_SPACEDIM == 1)
717 mlalap_gsrb_m(thread_box, solnfab, rhsfab, alpha, dhx,
727 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx,
731 vbx, redblack, ncomp);
737#if (AMREX_SPACEDIM == 2)
741 mlalap_gsrb_m(thread_box, solnfab, rhsfab, alpha, dhx, dhy,
753 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx, dhy,
759 vbx, redblack, ncomp);
764#if (AMREX_SPACEDIM == 3)
768 const auto& solnfab_2d = this->
compactify(solnfab);
769 const auto& rhsfab_2d = this->
compactify(rhsfab);
781 TwoD::mlalap_gsrb(thread_box, solnfab_2d, rhsfab_2d, alpha, dh0, dh1,
787 vbx_2d, redblack, ncomp);
792 mlalap_gsrb(thread_box, solnfab, rhsfab, alpha, dhx, dhy, dhz,
800 vbx, redblack, ncomp);
807template <
typename MF>
818 const Real* dxinv = this->
m_geom[amrlev][mglev].InvCellSize();
821 const auto& fyarr = flux[1]->array();,
822 const auto& fzarr = flux[2]->array(););
823 const auto& solarr = sol.array();
825#if (AMREX_SPACEDIM != 3)
826 const RT dx =
RT(this->
m_geom[amrlev][mglev].CellSize(0));
827 const RT probxlo =
RT(this->
m_geom[amrlev][mglev].ProbLo(0));
830#if (AMREX_SPACEDIM == 3)
833 RT fac = m_b_scalar *
RT(dxinv[0]);
838 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
844 RT fac = m_b_scalar *
RT(dxinv[1]);
849 mlalap_flux_yface(tbox, fyarr, solarr, fac, blen, ncomp);
855 RT fac = m_b_scalar *
RT(dxinv[2]);
860 mlalap_flux_zface(tbox, fzarr, solarr, fac, blen, ncomp);
867 RT fac = m_b_scalar *
RT(dxinv[0]);
871 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
877 RT fac = m_b_scalar *
RT(dxinv[1]);
881 mlalap_flux_y(tbox, fyarr, solarr, fac, ncomp);
887 RT fac = m_b_scalar *
RT(dxinv[2]);
891 mlalap_flux_z(tbox, fzarr, solarr, fac, ncomp);
897#elif (AMREX_SPACEDIM == 2)
900 RT fac = m_b_scalar *
RT(dxinv[0]);
906 mlalap_flux_xface_m(tbox, fxarr, solarr, fac, blen, dx, probxlo, ncomp);
911 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
918 RT fac = m_b_scalar *
RT(dxinv[1]);
924 mlalap_flux_yface_m(tbox, fyarr, solarr, fac, blen, dx, probxlo, ncomp);
929 mlalap_flux_yface(tbox, fyarr, solarr, fac, blen, ncomp);
937 RT fac = m_b_scalar *
RT(dxinv[0]);
942 mlalap_flux_x_m(tbox, fxarr, solarr, fac, dx, probxlo, ncomp);
947 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
954 RT fac = m_b_scalar *
RT(dxinv[1]);
959 mlalap_flux_y_m(tbox, fyarr, solarr, fac, dx, probxlo, ncomp);
964 mlalap_flux_y(tbox, fyarr, solarr, fac, ncomp);
973 RT fac = m_b_scalar *
RT(dxinv[0]);
979 mlalap_flux_xface_m(tbox, fxarr, solarr, fac, blen, dx, probxlo, ncomp);
984 mlalap_flux_xface(tbox, fxarr, solarr, fac, blen, ncomp);
988 RT fac = m_b_scalar *
RT(dxinv[0]);
993 mlalap_flux_x_m(tbox, fxarr, solarr, fac, dx, probxlo, ncomp);
998 mlalap_flux_x(tbox, fxarr, solarr, fac, ncomp);
1006#ifdef AMREX_MLMG_HAS_FLOAT
#define BL_PROFILE(a)
Definition AMReX_BLProfiler.H:593
#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_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
#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
Definition AMReX_MLALaplacian.H:120
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:295
~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:218
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:809
void update() override
Update for reuse.
Definition AMReX_MLALaplacian.H:381
bool isBottomSingular() const final
Shortcut for the coarsest level singular flag.
Definition AMReX_MLALaplacian.H:101
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:130
Array< MF const *, 3 > getBCoeffs(int, int) const final
ALaplacian has no b coefficients; this returns null pointers.
Definition AMReX_MLALaplacian.H:127
MF const * getACoeffs(int amrlev, int mglev) const final
Access the stored a coefficient MultiFab for (amrlev,mglev).
Definition AMReX_MLALaplacian.H:124
void prepareForSolve() final
Complete per-level setup (averaging, singularity flags) before solving.
Definition AMReX_MLALaplacian.H:369
MLALaplacianT(const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo(), const Vector< FabFactory< FAB > const * > &a_factory={}, int a_ncomp=1)
Convenience constructor that forwards to define().
Definition AMReX_MLALaplacian.H:171
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:422
LinOpBCType BCType
Definition AMReX_MLALaplacian.H:28
void averageDownCoeffs()
Average a coefficients down across all AMR and MG levels.
Definition AMReX_MLALaplacian.H:257
MLALaplacianT(MLALaplacianT< MF > &&)=delete
bool supportsMixedPrecision() const override
Definition AMReX_MLALaplacian.H:95
bool isSingular(int amrlev) const final
True if level amrlev is singular.
Definition AMReX_MLALaplacian.H:99
MLALaplacianT()=default
Construct an empty operator; call define() before use.
void normalize(int amrlev, int mglev, MultiFab &mf) const final
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:558
bool needsUpdate() const override
Does it need update if it's reused?
Definition AMReX_MLALaplacian.H:87
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:184
RT getBScalar() const final
Scalar beta applied to the Laplacian term.
Definition AMReX_MLALaplacian.H:122
void averageDownCoeffsSameAmrLevel(int amrlev, Vector< MF > &a)
Average a coefficients down within a single AMR level (fine-to-coarse MG).
Definition AMReX_MLALaplacian.H:274
typename MF::value_type RT
Definition AMReX_MLALaplacian.H:26
int getNComp() const override
Return number of components.
Definition AMReX_MLALaplacian.H:85
void setACoeffs(int amrlev, const MF &alpha)
Provide per-cell a coefficients on AMR level amrlev (stored directly in alpha).
Definition AMReX_MLALaplacian.H:235
typename MLLinOpT< MF >::Location Location
Definition AMReX_MLALaplacian.H:29
bool needsUpdate() const override
Does it need update if it's reused?
Definition AMReX_MLCellABecLap.H:75
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:160
void prepareForSolve() override
Standard hook called before MLMG iterates (fixes BC data, etc.).
Definition AMReX_MLCellABecLap.H:323
void update() override
Average coefficients/metrics when marked dirty.
Definition AMReX_MLCellABecLap.H:316
Vector< Vector< BndryRegisterT< MF > > > m_undrrelxr
Definition AMReX_MLCellLinOp.H:509
bool m_has_metric_term
Definition AMReX_MLCellLinOp.H:454
Vector< Vector< Array< MultiMask, 2 *3 > > > m_maskvals
Definition AMReX_MLCellLinOp.H:512
T get_d0(T const &dx, T const &dy, T const &) const noexcept
Definition AMReX_MLLinOp.H:1312
Vector< Geometry > spGeom(const Vector< Geometry > &a_geom)
Definition AMReX_MLLinOp.H:1102
Vector< Vector< BoxArray > > m_grids
Definition AMReX_MLLinOp.H:1008
static constexpr int mg_coarsen_ratio
Definition AMReX_MLLinOp.H:974
Vector< int > m_num_mg_levels
Definition AMReX_MLLinOp.H:995
Vector< Vector< DistributionMapping > > m_dmap
Definition AMReX_MLLinOp.H:1009
bool hasHiddenDimension() const noexcept
Definition AMReX_MLLinOp.H:1293
int hiddenDirection() const noexcept
Definition AMReX_MLLinOp.H:1294
Vector< Vector< Geometry > > m_geom
first Vector is for amr level and second is mg level
Definition AMReX_MLLinOp.H:1007
LPInfo dpInfo(LPInfo const &a_info) const
Definition AMReX_MLLinOp.H:1128
Box compactify(Box const &b) const noexcept
Definition AMReX_MLLinOp.H:2068
Vector< IntVect > mg_coarsen_ratio_vec
Definition AMReX_MLLinOp.H:1004
LinOpEnumType::Location Location
Definition AMReX_MLLinOp.H:174
void makeSPLinOp(LPInfo const &a_info, F const &f)
Definition AMReX_MLLinOp.H:1145
T get_d1(T const &, T const &dy, T const &dz) const noexcept
Definition AMReX_MLLinOp.H:1322
void spForward(F const &f)
Definition AMReX_MLLinOp.H:1185
int m_num_amr_levels
Definition AMReX_MLLinOp.H:992
Definition AMReX_MultiMask.H:23
MultiArray4< int const > const_arrays() const noexcept
Return const multi-array views (alias of arrays()).
Definition AMReX_MultiMask.H:86
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:1584
__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:1717
std::array< T, N > Array
Definition AMReX_Array.H:31
void Max(KeyValuePair< K, V > &vi, MPI_Comm comm)
Definition AMReX_ParallelReduce.H:133
void streamSynchronize() noexcept
Definition AMReX_GpuDevice.H:329
bool inLaunchRegion() noexcept
Definition AMReX_GpuControl.H:88
bool notInLaunchRegion() noexcept
Definition AMReX_GpuControl.H:89
bool inNoSyncRegion() noexcept
Definition AMReX_GpuControl.H:148
MPI_Comm CommunicatorSub() noexcept
sub-communicator for current frame
Definition AMReX_ParallelContext.H:70
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:360
void ParallelForRedBlack(MF const &mf, int redblack, F &&f)
ParallelFor over the red or black points of the valid region of a MultiFab/FabArray.
Definition AMReX_MFParallelFor.H:529
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
LinOpBCType
Definition AMReX_LO_BCTYPES.H:27
MLALaplacianT< MultiFab > MLALaplacian
Definition AMReX_MLALaplacian.H:1010
bool TilingIfNotGPU() noexcept
Definition AMReX_MFIter.H:12
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
void Abort(const std::string &msg)
Print a fatal-error message to stderr and abort execution.
Definition AMReX.cpp:239
__host__ __device__ Dim3 end(BoxND< dim > const &box) noexcept
Return the iterator end coordinate of box as Dim3.
Definition AMReX_Box.H:2259
void setVal(MF &dst, typename MF::value_type val)
dst = val
Definition AMReX_FabArrayUtility.H:2174
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:54
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