1#ifndef AMREX_FillPatchUtil_I_H_
2#define AMREX_FillPatchUtil_I_H_
3#include <AMReX_Config.H>
10template <
typename F,
typename MF>
11auto call_interp_hook (
F const& f, MF& mf,
int icomp,
int ncomp)
12 ->
decltype(f(mf[0],
Box(),icomp,ncomp))
15#pragma omp parallel if (Gpu::notInLaunchRegion())
17 for (MFIter mfi(mf); mfi.isValid(); ++mfi) {
19 const Box& dbx = dfab.box();
20 f(dfab, dbx, icomp, ncomp);
24template <
typename F,
typename MF>
25auto call_interp_hook (
F const& f, MF& mf,
int icomp,
int ncomp)
26 ->
decltype(f(mf,icomp,ncomp))
34template <
typename Interp>
38 int ratio_max = ratio[0];
39#if (AMREX_SPACEDIM > 1)
40 ratio_max = std::max(ratio_max, ratio[1]);
42#if (AMREX_SPACEDIM == 3)
43 ratio_max = std::max(ratio_max, ratio[2]);
47 const IntVect& nbuf = blocking_factor / ratio_max;
55 fine_box.
refine(ratio_max);
57 const Box& fine_box_coarsened = mapper->CoarseBox(fine_box, ratio_max);
58 return crse_box.
contains(fine_box_coarsened);
61template <FabArrayType MF,
typename BC>
65 int scomp,
int dcomp,
int ncomp,
67 BC& physbcf,
int bcfcomp)
70 geom, physbcf, bcfcomp);
73template <FabArrayType MF,
typename BC>
77 int scomp,
int dcomp,
int ncomp,
79 BC& physbcf,
int bcfcomp)
84 (scomp+ncomp <= smf[0]->nComp()) &&
85 (dcomp+ncomp <= mf.nComp()) &&
87 nghost.
allLE(mf.nGrowVect()));
90 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
91 src_ghost = physbcf.fp1_src_ghost;
96 if (&mf == smf[0] && scomp == dcomp) {
97 mf.FillBoundary(dcomp, ncomp, nghost, geom.
periodicity());
99 mf.ParallelCopy(*smf[0], scomp, dcomp, ncomp, src_ghost, nghost, geom.
periodicity());
102 else if (smf.
size() == 2)
109 if (mf.boxArray() == smf[0]->boxArray() &&
110 mf.DistributionMap() == smf[0]->DistributionMap())
117 MFInfo(), smf[0]->Factory());
124 if ((dmf != smf[0] && dmf != smf[1]) || scomp != dcomp)
127 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
128 interp_ghost = physbcf.fp1_src_ghost;
130 interp_ghost.
min(nghost);
134#pragma omp parallel if (Gpu::notInLaunchRegion())
138 const Box& bx = mfi.growntilebox(interp_ghost);
139 const Real t0 = stime[0];
140 const Real t1 = stime[1];
141 auto const sfab0 = smf[0]->array(mfi);
142 auto const sfab1 = smf[1]->array(mfi);
143 auto dfab = dmf->array(mfi);
149 dfab(i,j,k,n+destcomp) = sfab0(i,j,k,n+scomp);
156 dfab(i,j,k,n+destcomp) = sfab1(i,j,k,n+scomp);
161 Real alpha = (t1-time)/(t1-t0);
165 dfab(i,j,k,n+destcomp) = alpha*sfab0(i,j,k,n+scomp)
166 +
beta*sfab1(i,j,k,n+scomp);
173 dfab(i,j,k,n+destcomp) = sfab0(i,j,k,n+scomp);
183 mf.FillBoundary(dcomp, ncomp, nghost, geom.
periodicity());
187 mf.ParallelCopy(*dmf, 0, dcomp, ncomp, src_ghost, nghost, geom.
periodicity());
191 amrex::Abort(
"FillPatchSingleLevel: high-order interpolation in time not implemented yet");
194 physbcf(mf, dcomp, ncomp, nghost, time, bcfcomp);
214void FillPatchInterp (MultiFab& mf_fine_patch,
int fcomp, MultiFab
const& mf_crse_patch,
int ccomp,
215 int ncomp,
IntVect const& ng,
const Geometry& cgeom,
const Geometry& fgeom,
217 MFInterpolater* mapper,
const Vector<BCRec>& bcs,
int bcscomp);
219template <FabArrayType MF,
typename Interp>
220requires (!std::is_same_v<Interp, MFInterpolater>)
232#pragma omp parallel if (Gpu::notInLaunchRegion())
238 auto& sfab = mf_crse_patch[mfi];
239 const Box& sbx = sfab.box();
241 auto& dfab = mf_fine_patch[mfi];
245 mapper->interp(sfab, ccomp, dfab, fcomp, ncomp, dbx, ratio,
246 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
251template <FabArrayType MF>
260 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
264 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
271template <FabArrayType MF,
typename iMF,
typename Interp>
272requires (!std::is_same_v<Interp, MFInterpolater>)
275 MF
const& mf_crse_patch,
int crse_comp,
276 MF& mf_refined_patch,
int fine_comp,
277 int ncomp,
const IntVect& ratio,
278 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
279 int bcscomp,
RunOn gpu_or_cpu,
286 auto& sfab = mf_crse_patch[mfi];
287 const Box& sbx = sfab.box();
288 auto& dfab = mf_refined_patch[mfi];
289 Box const& dbx = dfab.box();
290 auto& ifab = solve_mask[mfi];
292 interp->interp_face(sfab,crse_comp,dfab,fine_comp,ncomp,
293 dbx, ratio, ifab, crse_geom, fine_geom,
294 bcr, bcscomp, gpu_or_cpu);
298template <FabArrayType MF,
typename iMF>
301 MF
const& mf_crse_patch,
int crse_comp,
302 MF& mf_refined_patch,
int fine_comp,
303 int ncomp,
const IntVect& ratio,
304 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
305 int bccomp,
RunOn gpu_or_cpu,
310 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
311 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
316 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
317 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
331 template <MultiFabLike MF>
332 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
333 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
335 MF mf_crse_patch(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0, MFInfo(),
336 *fpc.fact_crse_patch);
337 return mf_crse_patch;
340 template <MultiFabLike MF>
341 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
342 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
344 MF mf_crse_patch(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch,
345 ncomp, 0, MFInfo(), *fpc.fact_crse_patch);
346 return mf_crse_patch;
349 template <MultiFabLike MF>
350 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
351 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
353 MF mf_fine_patch(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0, MFInfo(),
354 *fpc.fact_fine_patch);
355 return mf_fine_patch;
358 template <MultiFabLike MF>
359 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
360 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
362 MF mf_fine_patch(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch,
363 ncomp, 0, MFInfo(), *fpc.fact_fine_patch);
364 return mf_fine_patch;
367 template <MultiFabLike MF>
368 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
369 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
372 fpc.dm_patch, ncomp, 0, MFInfo(), *fpc.fact_fine_patch);
373 return mf_refined_patch;
376 template <MultiFabLike MF>
377 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
378 MF make_mf_crse_mask (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
381 fpc.dm_patch, ncomp, 0, MFInfo(), *fpc.fact_fine_patch);
385 template <MultiFabLike MF>
386 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
387 void mf_set_domain_bndry (MF &mf, Geometry
const & geom)
389 mf.setDomainBndry(std::numeric_limits<Real>::quiet_NaN(), geom);
395 template <MultiFabLike MF>
396 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
397 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
399 return MF(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0);
402 template <MultiFabLike MF>
403 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
404 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
406 return MF(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch, ncomp, 0);
409 template <MultiFabLike MF>
410 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
411 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
413 return MF(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0);
416 template <MultiFabLike MF>
417 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
418 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
420 return MF(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch, ncomp, 0);
423 template <MultiFabLike MF>
424 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
425 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
430 template <MultiFabLike MF>
431 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
432 MF make_mf_crse_mask (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
437 template <MultiFabLike MF>
438 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
439 void mf_set_domain_bndry (MF &, Geometry
const & )
444 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
446 FillPatchTwoLevels_doit (MF& mf,
IntVect const& nghost,
Real time,
447 const Vector<MF*>& cmf,
const Vector<Real>& ct,
448 const Vector<MF*>& fmf,
const Vector<Real>& ft,
449 int scomp,
int dcomp,
int ncomp,
450 const Geometry& cgeom,
const Geometry& fgeom,
451 BC& cbc,
int cbccomp,
452 BC& fbc,
int fbccomp,
455 const Vector<BCRec>& bcs,
int bcscomp,
456 const PreInterpHook& pre_interp,
457 const PostInterpHook& post_interp,
458 EB2::IndexSpace
const* index_space,
459 bool return_error_code =
false)
463 int success_code = return_error_code ? 0 : -1;
464 int failure_code = 1;
466 if (nghost.max() > 0 || mf.getBDKey() != fmf[0]->getBDKey())
468 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
474 + mf.ixType().nodeCentered(1),
475 + mf.ixType().nodeCentered(2) ) == 1 )
477 if ( !
dynamic_cast<Interpolater*
>(mapper) ){
478 amrex::Abort(
"This interpolater has not yet implemented a version for face-based data");
483 mf.DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
494 if ( ! fpc.ba_crse_patch.empty())
496 if (return_error_code) {
498 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
503 MF mf_crse_patch = make_mf_crse_patch<MF> (fpc, ncomp, mf.boxArray().ixType());
508 MF mf_refined_patch = make_mf_refined_patch<MF> (fpc, ncomp, mf.boxArray().ixType(), ratio);
509 auto solve_mask = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf.boxArray().ixType(), ratio);
511 mf_set_domain_bndry(mf_crse_patch, cgeom);
512 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
513 cbc.fp1_src_ghost = cbc.cghost;
516 cgeom, cbc, cbccomp);
518 mf_set_domain_bndry(mf_refined_patch, fgeom);
519 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
520 fbc.fp1_src_ghost =
IntVect(0);
523 fgeom, fbc, fbccomp);
527 ncomp, nghost, MFInfo().SetAlloc(
false) );
528 MF mf_solution(
amrex::coarsen(mf_refined_patch.boxArray(), ratio), mf_refined_patch.DistributionMap(),
529 ncomp, 0, MFInfo().SetAlloc(
false) );
533 cgeom.periodicity());
535 solve_mask.setVal(1);
536 solve_mask.setVal(0, mask_cpc, 0, ncomp);
538 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
540 InterpFace(mapper, mf_crse_patch, 0, mf_refined_patch, 0, ncomp,
541 ratio, solve_mask, cgeom, fgeom, bcscomp,
RunOn::Gpu, bcs);
543 detail::call_interp_hook(post_interp, mf_refined_patch, 0, ncomp);
545 bool aliasing =
false;
546 for (
auto const& fmf_a : fmf) {
547 aliasing = aliasing || (&mf == fmf_a);
550 mf.ParallelCopyToGhost(mf_refined_patch, 0, dcomp, ncomp,
553 mf.ParallelCopy(mf_refined_patch, 0, dcomp, ncomp,
567 if ( ! fpc.ba_crse_patch.empty())
569 if (return_error_code) {
570 BoxArray
const& cba = cmf[0]->boxArray();
571 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
576 MF mf_crse_patch = make_mf_crse_patch<MF>(fpc, ncomp);
577 mf_set_domain_bndry (mf_crse_patch, cgeom);
579 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
580 cbc.fp1_src_ghost = cbc.cghost;
584 MF mf_fine_patch = make_mf_fine_patch<MF>(fpc, ncomp);
586 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
589 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
590 if (fgeom.isPeriodic(i)) {
591 fdomain_g.grow(i, nghost[i]);
593 if constexpr (std::is_same_v
594 <BC, PhysBCFunctUseCoarseGhost>) {
595 fdomain_g.grow(i, fbc.nghost_outside_domain[i]);
600 ncomp,
IntVect(0), cgeom, fgeom,
601 fdomain_g, ratio, mapper, bcs, bcscomp);
603 detail::call_interp_hook(post_interp, mf_fine_patch, 0, ncomp);
605 mf.ParallelCopy(mf_fine_patch, 0, dcomp, ncomp,
IntVect{0}, nghost);
610 if constexpr(std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
611 fbc.fp1_src_ghost =
IntVect(0);
614 fgeom, fbc, fbccomp);
619 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
621 FillPatchTwoLevels_doit (Array<MF*, AMREX_SPACEDIM>
const& mf,
IntVect const& nghost,
Real time,
622 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
623 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
624 int scomp,
int dcomp,
int ncomp,
625 const Geometry& cgeom,
const Geometry& fgeom,
626 Array<BC, AMREX_SPACEDIM>& cbc,
const Array<int, AMREX_SPACEDIM>& cbccomp,
627 Array<BC, AMREX_SPACEDIM>& fbc,
const Array<int, AMREX_SPACEDIM>& fbccomp,
630 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
const Array<int, AMREX_SPACEDIM>& bcscomp,
631 const PreInterpHook& pre_interp,
632 const PostInterpHook& post_interp,
633 EB2::IndexSpace
const* index_space)
635 BL_PROFILE(
"FillPatchTwoLevels (Array<MF*>)");
637 using FAB =
typename MF::FABType::value_type;
638 using iFAB =
typename iMultiFab::FABType::value_type;
641 && mf[1]->ixType().nodeCentered(1),
642 && mf[2]->ixType().nodeCentered(2)));
657 if (nghost.max() > 0 || mf[0]->getBDKey() != fmf[0][0]->getBDKey())
659 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
665 fmf[0][0]->
DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
674 if ( !fpc.ba_crse_patch.empty() )
676 Array<MF, AMREX_SPACEDIM> mf_crse_patch;
677 Array<MF, AMREX_SPACEDIM> mf_refined_patch;
678 Array<iMultiFab, AMREX_SPACEDIM> solve_mask;
680 for (
int d=0; d<AMREX_SPACEDIM; ++d)
682 mf_crse_patch[d] = make_mf_crse_patch<MF> (fpc, ncomp, mf[d]->
boxArray().ixType());
683 mf_refined_patch[d] = make_mf_refined_patch<MF> (fpc, ncomp, mf[d]->
boxArray().ixType(), ratio);
684 solve_mask[d] = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf[d]->
boxArray().ixType(), ratio);
686 mf_set_domain_bndry(mf_crse_patch[d], cgeom);
687 Vector<MF*> cmf_time;
688 for (
const auto & mfab : cmf)
689 { cmf_time.push_back(mfab[d]); }
692 cgeom, cbc[d], cbccomp[d]);
694 mf_set_domain_bndry(mf_refined_patch[d], fgeom);
695 Vector<MF*> fmf_time;
696 for (
const auto & mfab : fmf)
697 { fmf_time.push_back(mfab[d]); }
700 fgeom, fbc[d], fbccomp[d]);
705 ncomp, nghost, MFInfo().SetAlloc(
false) );
707 ncomp, 0, MFInfo().SetAlloc(
false) );
711 cgeom.periodicity() );
713 solve_mask[d].setVal(1);
714 solve_mask[d].setVal(0, mask_cpc, 0, ncomp);
721#pragma omp parallel if (cc && Gpu::notInLaunchRegion() )
724 Vector<Array<BCRec, AMREX_SPACEDIM> > bcr(ncomp);
725 for (MFIter mfi(mf_refined_patch[0]); mfi.isValid(); ++mfi)
727 Array<FAB*, AMREX_SPACEDIM> sfab{
AMREX_D_DECL( &(mf_crse_patch[0][mfi]),
728 &(mf_crse_patch[1][mfi]),
729 &(mf_crse_patch[2][mfi]) )};
730 Array<FAB*, AMREX_SPACEDIM> dfab{
AMREX_D_DECL( &(mf_refined_patch[0][mfi]),
731 &(mf_refined_patch[1][mfi]),
732 &(mf_refined_patch[2][mfi]) )};
733 Array<iFAB*, AMREX_SPACEDIM> mfab{
AMREX_D_DECL( &(solve_mask[0][mfi]),
734 &(solve_mask[1][mfi]),
735 &(solve_mask[2][mfi]) )};
740 for (
int d=0; d<AMREX_SPACEDIM; ++d)
742 Vector<BCRec> bcr_d(ncomp);
745 bcscomp[d],0,ncomp,bcs[d],bcr_d);
747 for (
int n=0; n<ncomp; ++n)
748 { bcr[n][d] = bcr_d[n]; }
751 pre_interp(sfab, sbx_cc, 0, ncomp);
753 mapper->interp_arr(sfab, 0, dfab, 0, ncomp, dbx_cc, ratio, mfab,
754 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
756 post_interp(dfab, dbx_cc, 0, ncomp);
760 for (
int d=0; d<AMREX_SPACEDIM; ++d)
762 bool aliasing =
false;
763 for (
auto const& fmf_a : fmf) {
764 aliasing = aliasing || (mf[d] == fmf_a[d]);
767 mf[d]->ParallelCopyToGhost(mf_refined_patch[d], 0, dcomp, ncomp,
770 mf[d]->ParallelCopy(mf_refined_patch[d], 0, dcomp, ncomp,
777 for (
int d=0; d<AMREX_SPACEDIM; ++d)
779 Vector<MF*> fmf_time;
780 for (
auto const& ffab : fmf)
781 { fmf_time.push_back(ffab[d]); }
784 fgeom, fbc[d], fbccomp[d]);
791template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
796 int scomp,
int dcomp,
int ncomp,
798 BC& cbc,
int cbccomp,
799 BC& fbc,
int fbccomp,
803 const PreInterpHook& pre_interp,
804 const PostInterpHook& post_interp)
811 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
812 scomp,dcomp,ncomp,cgeom,fgeom,
813 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
814 pre_interp,post_interp,index_space);
817template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
822 int scomp,
int dcomp,
int ncomp,
824 BC& cbc,
int cbccomp,
825 BC& fbc,
int fbccomp,
829 const PreInterpHook& pre_interp,
830 const PostInterpHook& post_interp)
838 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
839 scomp,dcomp,ncomp,cgeom,fgeom,
840 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
841 pre_interp,post_interp,index_space);
844template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
849 int scomp,
int dcomp,
int ncomp,
856 const PreInterpHook& pre_interp,
857 const PostInterpHook& post_interp)
865 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
866 scomp,dcomp,ncomp,cgeom,fgeom,
867 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
868 pre_interp,post_interp,index_space);
871template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
876 int scomp,
int dcomp,
int ncomp,
883 const PreInterpHook& pre_interp,
884 const PostInterpHook& post_interp)
896 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
897 scomp,dcomp,ncomp,cgeom,fgeom,
898 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
899 pre_interp,post_interp,index_space);
902template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
907 int scomp,
int dcomp,
int ncomp,
914 const PreInterpHook& pre_interp,
915 const PostInterpHook& post_interp)
927 detail::FillPatchTwoLevels_doit(mf,mf[0]->
nGrowVect(),time,cmf,ct,fmf,ft,
928 scomp,dcomp,ncomp,cgeom,fgeom,
929 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
930 pre_interp,post_interp,index_space);
934template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
940 int scomp,
int dcomp,
int ncomp,
942 BC& cbc,
int cbccomp,
943 BC& fbc,
int fbccomp,
947 const PreInterpHook& pre_interp,
948 const PostInterpHook& post_interp)
950 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
951 scomp,dcomp,ncomp,cgeom,fgeom,
952 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
953 pre_interp,post_interp,&index_space);
956template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
962 int scomp,
int dcomp,
int ncomp,
964 BC& cbc,
int cbccomp,
965 BC& fbc,
int fbccomp,
969 const PreInterpHook& pre_interp,
970 const PostInterpHook& post_interp)
972 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
973 scomp,dcomp,ncomp,cgeom,fgeom,
974 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
975 pre_interp,post_interp,&index_space);
979template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
982 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
984 BC& cbc,
int cbccomp,
985 BC& fbc,
int fbccomp,
989 const PreInterpHook& pre_interp,
990 const PostInterpHook& post_interp)
998 InterpFromCoarseLevel(mf,mf.nGrowVect(),time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
999 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1000 pre_interp,post_interp);
1003template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1013 const PreInterpHook& pre_interp,
1014 const PostInterpHook& post_interp)
1017 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1018 pre_interp,post_interp);
1021template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1024 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1026 BC& cbc,
int cbccomp,
1027 BC& fbc,
int fbccomp,
1031 const PreInterpHook& pre_interp,
1032 const PostInterpHook& post_interp)
1040 InterpFromCoarseLevel(mf,nghost,time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
1041 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1042 pre_interp,post_interp);
1045template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1049 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1051 BC& cbc,
int cbccomp,
1052 BC& fbc,
int fbccomp,
1056 const PreInterpHook& pre_interp,
1057 const PostInterpHook& post_interp)
1061 using FAB =
typename MF::FABType::value_type;
1065 const BoxArray& ba = mf.boxArray();
1073 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1075 fdomain_g.
grow(i, nghost[i]);
1077 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1078 fdomain_g.
grow(i, fbc.nghost_outside_domain[i]);
1084 IntVect send_ghost(0), recv_ghost(0);
1085 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1086 mf_crse_patch.define(
amrex::coarsen(ba,ratio), dm, ncomp, fbc.src_ghost);
1087 send_ghost = fbc.cghost;
1088 recv_ghost = fbc.src_ghost;
1092 for (
int i = 0, N = ba.
size(); i < N; ++i)
1096 ba_crse_patch.
set(i, coarsener.
doit(bx));
1106 mf_crse_patch.define(ba_crse_patch, dm, ncomp, 0,
MFInfo(), *factory);
1110 mf_crse_patch.define(ba_crse_patch, dm, ncomp, 0);
1112 detail::mf_set_domain_bndry (mf_crse_patch, cgeom);
1115 mf_crse_patch.ParallelCopy(cmf, scomp, 0, ncomp, send_ghost, recv_ghost,
1118 cbc(mf_crse_patch, 0, ncomp, mf_crse_patch.nGrowVect(), time, cbccomp);
1120 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
1122 FillPatchInterp(mf, dcomp, mf_crse_patch, 0, ncomp, nghost, cgeom, fgeom, fdomain_g,
1123 ratio, mapper, bcs, bcscomp);
1126#pragma omp parallel if (Gpu::notInLaunchRegion())
1130 FAB& dfab = mf[mfi];
1131 Box dfab_bx = dfab.box();
1132 dfab_bx.
grow(nghost-mf.nGrowVect());
1133 const Box& dbx = dfab_bx & fdomain_g;
1135 post_interp(dfab, dbx, dcomp, ncomp);
1138 fbc(mf, dcomp, ncomp, nghost, time, fbccomp);
1141template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1151 const PreInterpHook& pre_interp,
1152 const PostInterpHook& post_interp)
1156 using FAB =
typename MF::FABType::value_type;
1157 using iFAB =
typename iMultiFab::FABType::value_type;
1160 const BoxArray& ba = mf[0]->boxArray();
1164 && mf[1]->ixType().nodeCentered(1),
1165 && mf[2]->ixType().nodeCentered(2)));
1180 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1181 if (nghost[d] % ratio[d] != 0) {
1182 nghost_adj[d] += ratio[d] - (nghost[d] % ratio[d]);
1187 int dcomp_adj = dcomp;
1189 if (! nghost.
allGE(nghost_adj)) {
1190 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1191 mf_temp[d] = std::make_unique<MF>(mf[d]->
boxArray(),
1193 mf_local[d] = mf_temp[d].get();
1201 Box fdomain_g(fdomain);
1202 for (
int d = 0; d < AMREX_SPACEDIM; ++d) {
1204 fdomain_g.
grow(d,nghost_adj[d]);
1211 for (
int i = 0, N = ba.
size(); i < N; ++i)
1215 ba_crse_patch.
set(i, coarsener.
doit(bx));
1220 for (
int d = 0; d<AMREX_SPACEDIM; ++d)
1227 mf_crse_patch[d].define(ba_crse_idxed, dm, ncomp, 0,
MFInfo(), *crse_factory);
1229 mf_crse_patch[d].define(ba_crse_idxed, dm, ncomp, 0);
1231 detail::mf_set_domain_bndry(mf_crse_patch[d], cgeom);
1233 mf_crse_patch[d].ParallelCopy(*(cmf[d]), scomp, 0, ncomp, cgeom.
periodicity());
1234 cbc[d](mf_crse_patch[d], 0, ncomp, mf_crse_patch[d].nGrowVect(), time, cbccomp);
1237 int idummy1=0, idummy2=0;
1239#pragma omp parallel if (Gpu::notInLaunchRegion())
1250 &(mf_crse_patch[1][mfi]),
1251 &(mf_crse_patch[2][mfi]) )};
1253 &(*mf_local[1])[mfi],
1254 &(*mf_local[2])[mfi] )};
1260 const Box& dbx_cc = dfab_cc & fdomain_g;
1262 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1268 bcscomp,0,ncomp,bcs[d],bcr_d);
1270 for (
int n=0; n<ncomp; ++n)
1271 { bcr[n][d] = bcr_d[n]; }
1274 pre_interp(sfab, sbx_cc, 0, ncomp);
1276 mapper->interp_arr(sfab, 0, dfab, dcomp_adj, ncomp, dbx_cc, ratio, mfab,
1277 cgeom, fgeom, bcr, idummy1, idummy2,
RunOn::Gpu);
1279 post_interp(dfab, dbx_cc, dcomp_adj, ncomp);
1283 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1285 if (mf[d] != mf_local[d]) {
1286 amrex::Copy(*mf[d], *mf_local[d], 0, dcomp, ncomp, nghost);
1289 fbc[d](*mf[d], dcomp, ncomp, nghost, time, fbccomp);
1293template <FabArrayType MF,
typename Interp>
1296 IntVect const& nghost_outside_domain,
1297 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1299 const IntVect& ratio, Interp* mapper,
1304 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1308template <FabArrayType MF>
1312 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
1320template <FabArrayType MF,
typename Interp>
1326 int scomp,
int dcomp,
int ncomp,
1328 const IntVect& ratio, Interp* mapper,
1334 FillPatchTwoLevels(mf, nghost, time, cmf, ct, fmf, ft, scomp, dcomp, ncomp,
1335 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1339template <FabArrayType MF,
typename BC,
typename Interp>
1343 int scomp,
int dcomp,
int ncomp,
1358 auto get_clayout = [&] () -> std::tuple<BoxArray,BoxArray,DistributionMapping>
1363 BoxArray const& ba = mf.boxArray();
1364 auto const& typ = ba.
ixType();
1365 std::map<int,Vector<Box>> extra_boxes_map;
1368 for (
int i = 0, N =
int(ba.
size()); i < N; ++i) {
1369 Box const& cbox = mapper->CoarseBox(
amrex::grow(ba[i],nghost),ratio[level-1]);
1371 Box gdomain = geom[level-1].growNonPeriodicDomain(cbox.
length());
1374 auto& extra_boxes = extra_boxes_map[i];
1375 auto const& pshift = geom[level-1].periodicity().shiftIntVect();
1376 for (
auto const& piv : pshift) {
1379 extra_boxes.push_back(ibox);
1387 if (!extra_boxes_map.empty()) {
1389 auto& lbox = cbl2.
data();
1392 for (
auto const& [i, vb] : extra_boxes_map) {
1394 for (
int j = 1, nj =
int(vb.size()); j < nj; ++j) {
1395 lbox.push_back(vb[j]);
1396 procmap2.push_back(dm[i]);
1403 return std::make_tuple(
BoxArray(std::move(cbl)), cba2, dm2);
1414 level <
int(bc.
size()) &&
1415 level <
int(ratio.
size()+1));
1419 }
else if (level >=
int(smf.size()))
1421 auto const& [ba1, ba2, dm2] = get_clayout();
1426 mf.DistributionMap(), {0,0,0},
1428 cmf1.define(ba1, mf.DistributionMap(), ncomp, 0,
MFInfo(), *factory);
1433 cmf2.define(ba2, dm2, ncomp, 0,
MFInfo(), *factory2);
1438 cmf1.define(ba1, mf.DistributionMap(), ncomp, 0);
1440 cmf2.define(ba2, dm2, ncomp, 0);
1444 MF* p_mf_inside = (ba2.empty()) ? &cmf1 : &cmf2;
1446 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1447 if (&cmf1 != p_mf_inside) {
1448 cmf1.ParallelCopy(*p_mf_inside, geom[level-1].periodicity());
1450 Box domain_g = geom[level].growPeriodicDomain(nghost);
1451 domain_g.
convert(mf.ixType());
1452 FillPatchInterp(mf, dcomp, cmf1, 0, ncomp, nghost, geom[level-1], geom[level],
1453 domain_g, ratio[level-1], mapper, bcr, bcrcomp);
1456 int error_code = detail::FillPatchTwoLevels_doit(mf, nghost, time,
1457 smf[level-1], st[level-1],
1458 smf[level ], st[level ],
1459 scomp, dcomp, ncomp,
1460 geom[level-1], geom[level],
1461 bc[level-1], bccomp,
1463 ratio[level-1], mapper, bcr, bcrcomp,
1464 hook, hook, index_space,
true);
1465 if (error_code == 0) {
return; }
1467 auto const& [ba1, ba2, dm2] = get_clayout();
1473 mf.DistributionMap(), {0,0,0},
1475 cmf_tmp.define(ba1, mf.DistributionMap(), ncomp, 0,
MFInfo(), *factory);
1480 cmf_tmp.define(ba2, dm2, ncomp, 0,
MFInfo(), *factory);
1486 cmf_tmp.define(ba1, mf.DistributionMap(), ncomp, 0);
1488 cmf_tmp.define(ba2, dm2, ncomp, 0);
1493 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1499 for (
auto const* p : fmf) {
1503 for (
auto& a : fmf_raii) {
1508 detail::FillPatchTwoLevels_doit(mf, nghost, time,
1512 geom[level-1], geom[level],
1513 bc[level-1], bccomp,
1515 ratio[level-1], mapper, bcr, bcrcomp,
1516 hook, hook, index_space);
#define BL_PROFILE(a)
Definition AMReX_BLProfiler.H:562
#define AMREX_ALWAYS_ASSERT_WITH_MESSAGE(EX, MSG)
Definition AMReX_BLassert.H:49
#define BL_ASSERT(EX)
Definition AMReX_BLassert.H:39
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
#define AMREX_ALWAYS_ASSERT(EX)
Definition AMReX_BLassert.H:50
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D(...)
Definition AMReX_GpuLaunchMacrosC.nolint.H:111
GpuArray< Real, 3 > beta
Definition AMReX_MLEBNodeFDLaplacian.cpp:1099
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Reference-counted collection of Boxes.
Definition AMReX_BoxArray.H:681
IndexType ixType() const noexcept
Return index type of this BoxArray.
Definition AMReX_BoxArray.H:1268
static bool SameRefs(const BoxArray &lhs, const BoxArray &rhs)
whether two BoxArrays share the same data
Definition AMReX_BoxArray.H:1251
Long size() const noexcept
Return the number of boxes in the BoxArray.
Definition AMReX_BoxArray.H:758
void set(int i, const Box &ibox)
Set element i to ibox if no coarsening transformer is active.
Definition AMReX_BoxArray.cpp:894
A list of Boxes sharing a common IndexType.
Definition AMReX_BoxList.H:109
Vector< Box > & data() noexcept
Returns a reference to the Vector<Box>.
Definition AMReX_BoxList.H:373
void reserve(std::size_t n)
Reserve storage for at least n Boxes.
Definition AMReX_BoxList.H:148
void push_back(const Box &bn)
Append a Box to this BoxList.
Definition AMReX_BoxList.H:151
__host__ __device__ BoxND & grow(int i) noexcept
Grow in all directions by i cells (negative shrinks).
Definition AMReX_Box.H:668
__host__ __device__ IntVectND< dim > length() const noexcept
Return the length of the BoxND.
Definition AMReX_Box.H:167
__host__ __device__ BoxND & convert(IndexTypeND< dim > typ) noexcept
Convert the BoxND from the current type into the argument type. This may change the BoxND coordinates...
Definition AMReX_Box.H:1008
__host__ __device__ bool contains(const IntVectND< dim > &p) const noexcept
Return true if argument is contained within BoxND.
Definition AMReX_Box.H:233
__host__ __device__ IndexTypeND< dim > ixType() const noexcept
Return the indexing type.
Definition AMReX_Box.H:148
__host__ __device__ BoxND & refine(int ref_ratio) noexcept
Refine BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio...
Definition AMReX_Box.H:730
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:51
const Vector< int > & ProcessorMap() const noexcept
Returns a constant reference to the mapping of boxes in the underlying BoxArray to the CPU that holds...
Definition AMReX_DistributionMapping.cpp:49
Definition AMReX_EB2.H:28
static const FPinfo & TheFPinfo(const FabArrayBase &srcfa, const FabArrayBase &dstfa, const IntVect &dstng, const BoxConverter &coarsener, const Geometry &fgeom, const Geometry &cgeom, const EB2::IndexSpace *)
Definition AMReX_FabArrayBase.cpp:2074
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:85
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:244
Periodicity periodicity() const noexcept
Return the Periodicity based on the length of the domain.
Definition AMReX_Geometry.H:424
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition AMReX_Geometry.H:397
__host__ __device__ constexpr CellIndex ixType(int dir) const noexcept
Returns the CellIndex in direction dir.
Definition AMReX_IndexType.H:117
__host__ static __device__ constexpr IndexTypeND< dim > TheNodeType() noexcept
This static member function returns an IndexTypeND object of value IndexTypeND::NODE....
Definition AMReX_IndexType.H:160
__host__ __device__ constexpr int min() const noexcept
minimum (no absolute values) value
Definition AMReX_IntVect.H:324
__host__ __device__ constexpr bool allGE(const IntVectND< dim > &rhs) const noexcept
Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a str...
Definition AMReX_IntVect.H:542
__host__ static __device__ constexpr IntVectND< dim > TheZeroVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:771
__host__ __device__ constexpr bool allLE(const IntVectND< dim > &rhs) const noexcept
Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict...
Definition AMReX_IntVect.H:492
Definition AMReX_InterpBase.H:34
Definition AMReX_InterpBase.H:20
Box doit(const Box &fine) const override
Apply the coarse-box logic to the supplied fine box.
Definition AMReX_InterpBase.cpp:10
Virtual base class for interpolaters.
Definition AMReX_Interpolater.H:32
Definition AMReX_MFInterpolater.H:20
Iterator for looping ever tiles and boxes of amrex::FabArray based containers.
Definition AMReX_MFIter.H:88
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition AMReX_MFIter.H:176
Definition AMReX_PhysBCFunct.H:127
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
std::unique_ptr< EBFArrayBoxFactory > makeEBFabFactory(const Geometry &a_geom, const BoxArray &a_ba, const DistributionMapping &a_dm, const Vector< int > &a_ngrow, EBSupport a_support)
Definition AMReX_EBFabFactory.cpp:301
__host__ __device__ BoxND< dim > convert(const BoxND< dim > &b, const IntVectND< dim > &typ) noexcept
Return a copy of b converted to the nodal flags typ.
Definition AMReX_Box.H:1630
__host__ __device__ BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b coarsened by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1469
__host__ __device__ BoxND< dim > shift(const BoxND< dim > &b, int dir, int nzones) noexcept
Return a copy of b shifted by nzones cells in direction dir.
Definition AMReX_Box.H:1548
__host__ __device__ BoxND< dim > grow(const BoxND< dim > &b, int i) noexcept
Return a copy of b grown uniformly by i cells in every direction.
Definition AMReX_Box.H:1326
__host__ __device__ BoxND< dim > refine(const BoxND< dim > &b, int ref_ratio) noexcept
Return a copy of b refined by the isotropic ratio ref_ratio.
Definition AMReX_Box.H:1510
std::array< T, N > Array
Definition AMReX_Array.H:31
__host__ __device__ bool almostEqual(T x, T y, int ulp=2)
Definition AMReX_Algorithm.H:139
const IndexSpace * TopIndexSpaceIfPresent() noexcept
Return the top IndexSpace if one has been built (nullptr otherwise).
Definition AMReX_EB2.cpp:93
Definition AMReX_Amr.cpp:50
@ make_alias
Definition AMReX_MakeType.H:7
__host__ __device__ void ignore_unused(const Ts &...)
No-op helper that marks variables as intentionally unused.
Definition AMReX.H:259
void Copy(FabArray< DFAB > &dst, FabArray< SFAB > const &src, int srccomp, int dstcomp, int numcomp, int nghost)
Definition AMReX_FabArray.H:192
BoxArray const & boxArray(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.boxArray().
Definition AMReX_FabArrayBase.cpp:2870
DistributionMapping const & DistributionMap(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.DistributionMap().
Definition AMReX_FabArrayBase.cpp:2875
RunOn
Definition AMReX_GpuControl.H:65
bool ProperlyNested(const IntVect &ratio, const IntVect &blocking_factor, int ngrow, const IndexType &boxType, Interp *mapper)
Test if AMR grids are properly nested.
Definition AMReX_FillPatchUtil_I.H:35
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
IndexTypeND< 3 > IndexType
IndexType is an alias for amrex::IndexTypeND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:41
void InterpFace(Interp *interp, MF const &mf_crse_patch, int crse_comp, MF &mf_refined_patch, int fine_comp, int ncomp, const IntVect &ratio, const iMF &solve_mask, const Geometry &crse_geom, const Geometry &fine_geom, int bcscomp, RunOn gpu_or_cpu, const Vector< BCRec > &bcs)
Definition AMReX_FillPatchUtil_I.H:274
void FillPatchSingleLevel(MF &mf, IntVect const &nghost, Real time, const Vector< MF * > &smf, const Vector< Real > &stime, int scomp, int dcomp, int ncomp, const Geometry &geom, BC &physbcf, int bcfcomp)
FillPatch with data from the current level.
Definition AMReX_FillPatchUtil_I.H:75
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
IntVect nGrowVect(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.nGrowVect().
Definition AMReX_FabArrayBase.cpp:2865
bool TilingIfNotGPU() noexcept
Definition AMReX_MFIter.H:12
void InterpFromCoarseLevel(MF &mf, Real time, const MF &cmf, int scomp, int dcomp, int ncomp, const Geometry &cgeom, const Geometry &fgeom, BC &cbc, int cbccomp, BC &fbc, int fbccomp, const IntVect &ratio, Interp *mapper, const Vector< BCRec > &bcs, int bcscomp, const PreInterpHook &pre_interp={}, const PostInterpHook &post_interp={})
Fill with interpolation of coarse level data.
Definition AMReX_FillPatchUtil_I.H:981
void setBC(const Box &bx, const Box &domain, int src_comp, int dest_comp, int ncomp, const Vector< BCRec > &bc_dom, Vector< BCRec > &bcr) noexcept
Populate a span of BCRec objects based on a domain record.
Definition AMReX_BCRec.cpp:8
void Abort(const std::string &msg)
Print a fatal-error message to stderr and abort execution.
Definition AMReX.cpp:242
void FillPatchTwoLevels(MF &mf, IntVect const &nghost, Real time, const Vector< MF * > &cmf, const Vector< Real > &ct, const Vector< MF * > &fmf, const Vector< Real > &ft, int scomp, int dcomp, int ncomp, const Geometry &cgeom, const Geometry &fgeom, BC &cbc, int cbccomp, BC &fbc, int fbccomp, const IntVect &ratio, Interp *mapper, const Vector< BCRec > &bcs, int bcscomp, const PreInterpHook &pre_interp={}, const PostInterpHook &post_interp={})
FillPatch with data from the current level and the level below.
Definition AMReX_FillPatchUtil_I.H:793
void FillPatchInterp(MultiFab &mf_fine_patch, int fcomp, MultiFab const &mf_crse_patch, int ccomp, int ncomp, IntVect const &ng, const Geometry &cgeom, const Geometry &fgeom, Box const &dest_domain, const IntVect &ratio, MFInterpolater *mapper, const Vector< BCRec > &bcs, int bcscomp)
Helper that applies a MFInterpolater to fill a fine patch from a coarse patch.
Definition AMReX_FillPatchUtil.cpp:138
void FillPatchNLevels(MF &mf, int level, const IntVect &nghost, Real time, const Vector< Vector< MF * > > &smf, const Vector< Vector< Real > > &st, int scomp, int dcomp, int ncomp, const Vector< Geometry > &geom, Vector< BC > &bc, int bccomp, const Vector< IntVect > &ratio, Interp *mapper, const Vector< BCRec > &bcr, int bcrcomp)
FillPatch with data from AMR levels.
Definition AMReX_FillPatchUtil_I.H:1341
FabArray memory allocation information.
Definition AMReX_FabArray.H:73
Definition AMReX_FillPatchUtil.H:39