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)
105 const Real t0 = stime[0];
106 const Real t1 = stime[1];
107 const bool interp_in_time = (time != t0 && time != t1 &&
109 const bool use_src1 = (time != t0 && time == t1);
115 if (mf.boxArray() == smf[0]->boxArray() &&
116 mf.DistributionMap() == smf[0]->DistributionMap())
121 fill_dmf = (&mf != smf[0] && &mf != smf[1]) || scomp != dcomp;
123 else if (!interp_in_time)
125 dmf = smf[use_src1 ? 1 : 0];
144 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
145 interp_ghost = physbcf.fp1_src_ghost;
147 interp_ghost.
min(nghost);
158 hull.resize(raii.local_size());
159 if (!mf.empty() && !raii.empty()) {
160 auto const& cpc = mf.getCPC(nghost, raii, src_ghost, geom.
periodicity());
161 for (
auto const& tag : *cpc.m_LocTags) {
162 Box& h = hull[raii.localindex(tag.srcIndex)];
165 for (
auto const& kv : *cpc.m_SndTags) {
166 for (
auto const& tag : kv.second) {
167 Box& h = hull[raii.localindex(tag.srcIndex)];
175 const Real dt = interp_in_time ? (t1-t0) :
Real(1.0);
176 const Real alpha = (t1-time)/dt;
177 const Real beta = (time-t0)/dt;
180#pragma omp parallel if (Gpu::notInLaunchRegion())
184 Box bx = mfi.growntilebox(interp_ghost);
186 const Box& hbx = hull[mfi.LocalIndex()];
187 if (!hbx.
ok()) {
continue; }
190 auto const sfab0 = smf[0]->array(mfi);
191 auto const sfab1 = smf[1]->array(mfi);
192 auto dfab = dmf->array(mfi);
198 dfab(i,j,k,n+destcomp) = alpha*sfab0(i,j,k,n+scomp)
199 + beta*sfab1(i,j,k,n+scomp);
206 dfab(i,j,k,n+destcomp) = sfab1(i,j,k,n+scomp);
213 dfab(i,j,k,n+destcomp) = sfab0(i,j,k,n+scomp);
223 mf.FillBoundary(dcomp, ncomp, nghost, geom.
periodicity());
227 mf.ParallelCopy(*dmf, destcomp, dcomp, ncomp, src_ghost, nghost, geom.
periodicity());
231 amrex::Abort(
"FillPatchSingleLevel: high-order interpolation in time not implemented yet");
234 physbcf(mf, dcomp, ncomp, nghost, time, bcfcomp);
254void FillPatchInterp (MultiFab& mf_fine_patch,
int fcomp, MultiFab
const& mf_crse_patch,
int ccomp,
255 int ncomp,
IntVect const& ng,
const Geometry& cgeom,
const Geometry& fgeom,
257 MFInterpolater* mapper,
const Vector<BCRec>& bcs,
int bcscomp);
259template <FabArrayType MF,
typename Interp>
260requires (!std::is_same_v<Interp, MFInterpolater>)
272#pragma omp parallel if (Gpu::notInLaunchRegion())
278 auto& sfab = mf_crse_patch[mfi];
279 const Box& sbx = sfab.box();
281 auto& dfab = mf_fine_patch[mfi];
285 mapper->interp(sfab, ccomp, dfab, fcomp, ncomp, dbx, ratio,
286 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
291template <FabArrayType MF>
300 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
304 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
311template <FabArrayType MF,
typename iMF,
typename Interp>
312requires (!std::is_same_v<Interp, MFInterpolater>)
315 MF
const& mf_crse_patch,
int crse_comp,
316 MF& mf_refined_patch,
int fine_comp,
317 int ncomp,
const IntVect& ratio,
318 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
319 int bcscomp,
RunOn gpu_or_cpu,
326 auto& sfab = mf_crse_patch[mfi];
327 const Box& sbx = sfab.box();
328 auto& dfab = mf_refined_patch[mfi];
329 Box const& dbx = dfab.box();
330 auto& ifab = solve_mask[mfi];
332 interp->interp_face(sfab,crse_comp,dfab,fine_comp,ncomp,
333 dbx, ratio, ifab, crse_geom, fine_geom,
334 bcr, bcscomp, gpu_or_cpu);
338template <FabArrayType MF,
typename iMF>
341 MF
const& mf_crse_patch,
int crse_comp,
342 MF& mf_refined_patch,
int fine_comp,
343 int ncomp,
const IntVect& ratio,
344 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
345 int bccomp,
RunOn gpu_or_cpu,
350 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
351 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
356 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
357 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
371 template <MultiFabLike MF>
372 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
373 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp, Arena* arena =
nullptr)
375 MF mf_crse_patch(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0,
376 MFInfo().SetArena(arena), *fpc.fact_crse_patch);
377 return mf_crse_patch;
380 template <MultiFabLike MF>
381 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
382 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type, Arena* arena =
nullptr)
384 MF mf_crse_patch(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch,
385 ncomp, 0, MFInfo().SetArena(arena), *fpc.fact_crse_patch);
386 return mf_crse_patch;
389 template <MultiFabLike MF>
390 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
391 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp, Arena* arena =
nullptr)
393 MF mf_fine_patch(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0,
394 MFInfo().SetArena(arena), *fpc.fact_fine_patch);
395 return mf_fine_patch;
398 template <MultiFabLike MF>
399 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
400 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type, Arena* arena =
nullptr)
402 MF mf_fine_patch(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch,
403 ncomp, 0, MFInfo().SetArena(arena), *fpc.fact_fine_patch);
404 return mf_fine_patch;
407 template <MultiFabLike MF>
408 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
409 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio, Arena* arena =
nullptr)
411 MF mf_refined_patch(
amrex::convert(fpc.refinedPatch(ratio), idx_type),
412 fpc.dm_patch, ncomp, 0, MFInfo().SetArena(arena),
413 *fpc.fact_fine_patch);
414 return mf_refined_patch;
417 template <MultiFabLike MF>
418 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
419 MF make_mf_crse_mask (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio, Arena* arena =
nullptr)
422 fpc.dm_patch, ncomp, 0, MFInfo().SetArena(arena),
423 *fpc.fact_fine_patch);
427 template <MultiFabLike MF>
428 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
429 void mf_set_domain_bndry (MF &mf, Geometry
const & geom)
431 mf.setDomainBndry(std::numeric_limits<Real>::quiet_NaN(), geom);
437 template <MultiFabLike MF>
438 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
439 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp, Arena* arena =
nullptr)
441 return MF(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0,
442 MFInfo().SetArena(arena));
445 template <MultiFabLike MF>
446 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
447 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type, Arena* arena =
nullptr)
449 return MF(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch, ncomp, 0,
450 MFInfo().SetArena(arena));
453 template <MultiFabLike MF>
454 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
455 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp, Arena* arena =
nullptr)
457 return MF(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0,
458 MFInfo().SetArena(arena));
461 template <MultiFabLike MF>
462 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
463 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type, Arena* arena =
nullptr)
465 return MF(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch, ncomp, 0,
466 MFInfo().SetArena(arena));
469 template <MultiFabLike MF>
470 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
471 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio, Arena* arena =
nullptr)
473 return MF(
amrex::convert(fpc.refinedPatch(ratio), idx_type), fpc.dm_patch, ncomp, 0,
474 MFInfo().SetArena(arena));
477 template <MultiFabLike MF>
478 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
479 MF make_mf_crse_mask (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio, Arena* arena =
nullptr)
482 MFInfo().SetArena(arena));
485 template <MultiFabLike MF>
486 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
487 void mf_set_domain_bndry (MF &, Geometry
const & )
492 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
494 FillPatchTwoLevels_doit (MF& mf,
IntVect const& nghost,
Real time,
495 const Vector<MF*>& cmf,
const Vector<Real>& ct,
496 const Vector<MF*>& fmf,
const Vector<Real>& ft,
497 int scomp,
int dcomp,
int ncomp,
498 const Geometry& cgeom,
const Geometry& fgeom,
499 BC& cbc,
int cbccomp,
500 BC& fbc,
int fbccomp,
503 const Vector<BCRec>& bcs,
int bcscomp,
504 const PreInterpHook& pre_interp,
505 const PostInterpHook& post_interp,
506 EB2::IndexSpace
const* index_space,
507 bool return_error_code =
false)
511 int success_code = return_error_code ? 0 : -1;
512 int failure_code = 1;
514 if (nghost.max() > 0 || mf.getBDKey() != fmf[0]->getBDKey())
516 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
522 + mf.ixType().nodeCentered(1),
523 + mf.ixType().nodeCentered(2) ) == 1 )
525 if ( !
dynamic_cast<Interpolater*
>(mapper) ){
526 amrex::Abort(
"This interpolater has not yet implemented a version for face-based data");
531 mf.DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
542 if ( ! fpc.ba_crse_patch.empty())
544 if (return_error_code) {
546 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
551 MF mf_crse_patch = make_mf_crse_patch<MF> (fpc, ncomp, mf.boxArray().ixType(),
The_Async_Arena());
556 MF mf_refined_patch = make_mf_refined_patch<MF> (fpc, ncomp, mf.boxArray().ixType(), ratio,
The_Async_Arena());
557 auto solve_mask = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf.boxArray().ixType(), ratio,
The_Async_Arena());
559 mf_set_domain_bndry(mf_crse_patch, cgeom);
560 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
561 cbc.fp1_src_ghost = cbc.cghost;
564 cgeom, cbc, cbccomp);
566 mf_set_domain_bndry(mf_refined_patch, fgeom);
567 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
568 fbc.fp1_src_ghost =
IntVect(0);
571 fgeom, fbc, fbccomp);
575 ncomp, nghost, MFInfo().SetAlloc(
false) );
576 MF mf_solution(
amrex::coarsen(mf_refined_patch.boxArray(), ratio), mf_refined_patch.DistributionMap(),
577 ncomp, 0, MFInfo().SetAlloc(
false) );
581 cgeom.periodicity());
583 solve_mask.setVal(1);
584 solve_mask.setVal(0, mask_cpc, 0, ncomp);
586 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
588 InterpFace(mapper, mf_crse_patch, 0, mf_refined_patch, 0, ncomp,
589 ratio, solve_mask, cgeom, fgeom, bcscomp,
RunOn::Gpu, bcs);
591 detail::call_interp_hook(post_interp, mf_refined_patch, 0, ncomp);
593 bool aliasing =
false;
594 for (
auto const& fmf_a : fmf) {
595 aliasing = aliasing || (&mf == fmf_a);
598 mf.ParallelCopyToGhost(mf_refined_patch, 0, dcomp, ncomp,
601 mf.ParallelCopy(mf_refined_patch, 0, dcomp, ncomp,
615 if ( ! fpc.ba_crse_patch.empty())
617 if (return_error_code) {
618 BoxArray
const& cba = cmf[0]->boxArray();
619 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
624 MF mf_crse_patch = make_mf_crse_patch<MF>(fpc, ncomp,
The_Async_Arena());
625 mf_set_domain_bndry (mf_crse_patch, cgeom);
627 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
628 cbc.fp1_src_ghost = cbc.cghost;
632 MF mf_fine_patch = make_mf_fine_patch<MF>(fpc, ncomp,
The_Async_Arena());
634 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
637 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
638 if (fgeom.isPeriodic(i)) {
639 fdomain_g.grow(i, nghost[i]);
641 if constexpr (std::is_same_v
642 <BC, PhysBCFunctUseCoarseGhost>) {
643 fdomain_g.grow(i, fbc.nghost_outside_domain[i]);
648 ncomp,
IntVect(0), cgeom, fgeom,
649 fdomain_g, ratio, mapper, bcs, bcscomp);
651 detail::call_interp_hook(post_interp, mf_fine_patch, 0, ncomp);
653 mf.ParallelCopy(mf_fine_patch, 0, dcomp, ncomp,
IntVect{0}, nghost);
658 if constexpr(std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
659 fbc.fp1_src_ghost =
IntVect(0);
662 fgeom, fbc, fbccomp);
667 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
672 int scomp,
int dcomp,
int ncomp,
673 const Geometry& cgeom,
const Geometry& fgeom,
679 const PreInterpHook& pre_interp,
680 const PostInterpHook& post_interp,
681 EB2::IndexSpace
const* index_space)
683 BL_PROFILE(
"FillPatchTwoLevels (Array<MF*>)");
685 using FAB =
typename MF::FABType::value_type;
686 using iFAB =
typename iMultiFab::FABType::value_type;
689 && mf[1]->ixType().nodeCentered(1),
690 && mf[2]->ixType().nodeCentered(2)));
705 if (nghost.max() > 0 || mf[0]->getBDKey() != fmf[0][0]->getBDKey())
707 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
713 fmf[0][0]->
DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
722 if ( !fpc.ba_crse_patch.empty() )
728 for (
int d=0; d<AMREX_SPACEDIM; ++d)
731 mf_refined_patch[d] = make_mf_refined_patch<MF> (fpc, ncomp, mf[d]->
boxArray().ixType(), ratio,
The_Async_Arena());
732 solve_mask[d] = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf[d]->
boxArray().ixType(), ratio,
The_Async_Arena());
734 mf_set_domain_bndry(mf_crse_patch[d], cgeom);
735 Vector<MF*> cmf_time;
736 for (
const auto & mfab : cmf)
737 { cmf_time.push_back(mfab[d]); }
740 cgeom, cbc[d], cbccomp[d]);
742 mf_set_domain_bndry(mf_refined_patch[d], fgeom);
743 Vector<MF*> fmf_time;
744 for (
const auto & mfab : fmf)
745 { fmf_time.push_back(mfab[d]); }
748 fgeom, fbc[d], fbccomp[d]);
753 ncomp, nghost, MFInfo().SetAlloc(
false) );
755 ncomp, 0, MFInfo().SetAlloc(
false) );
759 cgeom.periodicity());
761 solve_mask[d].setVal(1);
762 solve_mask[d].setVal(0, mask_cpc, 0, ncomp);
769#pragma omp parallel if (cc && Gpu::notInLaunchRegion() )
772 Vector<Array<BCRec, AMREX_SPACEDIM> > bcr(ncomp);
773 for (MFIter mfi(mf_refined_patch[0]); mfi.isValid(); ++mfi)
776 &(mf_crse_patch[1][mfi]),
777 &(mf_crse_patch[2][mfi]) )};
779 &(mf_refined_patch[1][mfi]),
780 &(mf_refined_patch[2][mfi]) )};
782 &(solve_mask[1][mfi]),
783 &(solve_mask[2][mfi]) )};
788 for (
int d=0; d<AMREX_SPACEDIM; ++d)
790 Vector<BCRec> bcr_d(ncomp);
793 bcscomp[d],0,ncomp,bcs[d],bcr_d);
795 for (
int n=0; n<ncomp; ++n)
796 { bcr[n][d] = bcr_d[n]; }
799 pre_interp(sfab, sbx_cc, 0, ncomp);
801 mapper->interp_arr(sfab, 0, dfab, 0, ncomp, dbx_cc, ratio, mfab,
802 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
804 post_interp(dfab, dbx_cc, 0, ncomp);
808 for (
int d=0; d<AMREX_SPACEDIM; ++d)
810 bool aliasing =
false;
811 for (
auto const& fmf_a : fmf) {
812 aliasing = aliasing || (mf[d] == fmf_a[d]);
815 mf[d]->ParallelCopyToGhost(mf_refined_patch[d], 0, dcomp, ncomp,
818 mf[d]->ParallelCopy(mf_refined_patch[d], 0, dcomp, ncomp,
825 for (
int d=0; d<AMREX_SPACEDIM; ++d)
827 Vector<MF*> fmf_time;
828 for (
auto const& ffab : fmf)
829 { fmf_time.push_back(ffab[d]); }
832 fgeom, fbc[d], fbccomp[d]);
839template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
844 int scomp,
int dcomp,
int ncomp,
846 BC& cbc,
int cbccomp,
847 BC& fbc,
int fbccomp,
851 const PreInterpHook& pre_interp,
852 const PostInterpHook& post_interp)
859 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
860 scomp,dcomp,ncomp,cgeom,fgeom,
861 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
862 pre_interp,post_interp,index_space);
865template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
870 int scomp,
int dcomp,
int ncomp,
872 BC& cbc,
int cbccomp,
873 BC& fbc,
int fbccomp,
877 const PreInterpHook& pre_interp,
878 const PostInterpHook& post_interp)
886 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
887 scomp,dcomp,ncomp,cgeom,fgeom,
888 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
889 pre_interp,post_interp,index_space);
892template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
897 int scomp,
int dcomp,
int ncomp,
904 const PreInterpHook& pre_interp,
905 const PostInterpHook& post_interp)
913 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
914 scomp,dcomp,ncomp,cgeom,fgeom,
915 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
916 pre_interp,post_interp,index_space);
919template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
924 int scomp,
int dcomp,
int ncomp,
931 const PreInterpHook& pre_interp,
932 const PostInterpHook& post_interp)
944 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
945 scomp,dcomp,ncomp,cgeom,fgeom,
946 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
947 pre_interp,post_interp,index_space);
950template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
955 int scomp,
int dcomp,
int ncomp,
962 const PreInterpHook& pre_interp,
963 const PostInterpHook& post_interp)
975 detail::FillPatchTwoLevels_doit(mf,mf[0]->
nGrowVect(),time,cmf,ct,fmf,ft,
976 scomp,dcomp,ncomp,cgeom,fgeom,
977 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
978 pre_interp,post_interp,index_space);
982template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
988 int scomp,
int dcomp,
int ncomp,
990 BC& cbc,
int cbccomp,
991 BC& fbc,
int fbccomp,
995 const PreInterpHook& pre_interp,
996 const PostInterpHook& post_interp)
998 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
999 scomp,dcomp,ncomp,cgeom,fgeom,
1000 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1001 pre_interp,post_interp,&index_space);
1004template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1010 int scomp,
int dcomp,
int ncomp,
1012 BC& cbc,
int cbccomp,
1013 BC& fbc,
int fbccomp,
1017 const PreInterpHook& pre_interp,
1018 const PostInterpHook& post_interp)
1020 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
1021 scomp,dcomp,ncomp,cgeom,fgeom,
1022 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1023 pre_interp,post_interp,&index_space);
1027template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1030 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1032 BC& cbc,
int cbccomp,
1033 BC& fbc,
int fbccomp,
1037 const PreInterpHook& pre_interp,
1038 const PostInterpHook& post_interp)
1046 InterpFromCoarseLevel(mf,mf.nGrowVect(),time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
1047 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1048 pre_interp,post_interp);
1051template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1061 const PreInterpHook& pre_interp,
1062 const PostInterpHook& post_interp)
1065 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1066 pre_interp,post_interp);
1069template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1072 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1074 BC& cbc,
int cbccomp,
1075 BC& fbc,
int fbccomp,
1079 const PreInterpHook& pre_interp,
1080 const PostInterpHook& post_interp)
1088 InterpFromCoarseLevel(mf,nghost,time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
1089 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1090 pre_interp,post_interp);
1093template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1097 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1099 BC& cbc,
int cbccomp,
1100 BC& fbc,
int fbccomp,
1104 const PreInterpHook& pre_interp,
1105 const PostInterpHook& post_interp)
1109 using FAB =
typename MF::FABType::value_type;
1113 const BoxArray& ba = mf.boxArray();
1121 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1123 fdomain_g.
grow(i, nghost[i]);
1125 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1126 fdomain_g.
grow(i, fbc.nghost_outside_domain[i]);
1132 IntVect send_ghost(0), recv_ghost(0);
1133 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1135 send_ghost = fbc.cghost;
1136 recv_ghost = fbc.src_ghost;
1140 for (
int i = 0, N = ba.
size(); i < N; ++i)
1144 ba_crse_patch.
set(i, coarsener.
doit(bx));
1160 detail::mf_set_domain_bndry (mf_crse_patch, cgeom);
1163 mf_crse_patch.ParallelCopy(cmf, scomp, 0, ncomp, send_ghost, recv_ghost,
1166 cbc(mf_crse_patch, 0, ncomp, mf_crse_patch.nGrowVect(), time, cbccomp);
1168 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
1170 FillPatchInterp(mf, dcomp, mf_crse_patch, 0, ncomp, nghost, cgeom, fgeom, fdomain_g,
1171 ratio, mapper, bcs, bcscomp);
1174#pragma omp parallel if (Gpu::notInLaunchRegion())
1178 FAB& dfab = mf[mfi];
1179 Box dfab_bx = dfab.box();
1180 dfab_bx.
grow(nghost-mf.nGrowVect());
1181 const Box& dbx = dfab_bx & fdomain_g;
1183 post_interp(dfab, dbx, dcomp, ncomp);
1186 fbc(mf, dcomp, ncomp, nghost, time, fbccomp);
1189template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1199 const PreInterpHook& pre_interp,
1200 const PostInterpHook& post_interp)
1204 using FAB =
typename MF::FABType::value_type;
1205 using iFAB =
typename iMultiFab::FABType::value_type;
1208 const BoxArray& ba = mf[0]->boxArray();
1212 && mf[1]->ixType().nodeCentered(1),
1213 && mf[2]->ixType().nodeCentered(2)));
1228 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1229 if (nghost[d] % ratio[d] != 0) {
1230 nghost_adj[d] += ratio[d] - (nghost[d] % ratio[d]);
1235 int dcomp_adj = dcomp;
1237 if (! nghost.
allGE(nghost_adj)) {
1238 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1239 mf_temp[d] = std::make_unique<MF>(mf[d]->
boxArray(),
1241 mf_local[d] = mf_temp[d].get();
1249 Box fdomain_g(fdomain);
1250 for (
int d = 0; d < AMREX_SPACEDIM; ++d) {
1252 fdomain_g.
grow(d,nghost_adj[d]);
1259 for (
int i = 0, N = ba.
size(); i < N; ++i)
1263 ba_crse_patch.
set(i, coarsener.
doit(bx));
1268 for (
int d = 0; d<AMREX_SPACEDIM; ++d)
1270 IndexType typ = mf[d]->boxArray().ixType();
1275 mf_crse_patch[d].define(ba_crse_idxed, dm, ncomp, 0,
MFInfo().SetArena(
The_Async_Arena()), *crse_factory);
1279 detail::mf_set_domain_bndry(mf_crse_patch[d], cgeom);
1281 mf_crse_patch[d].ParallelCopy(*(cmf[d]), scomp, 0, ncomp, cgeom.
periodicity());
1282 cbc[d](mf_crse_patch[d], 0, ncomp, mf_crse_patch[d].nGrowVect(), time, cbccomp);
1285 int idummy1=0, idummy2=0;
1287#pragma omp parallel if (Gpu::notInLaunchRegion())
1298 &(mf_crse_patch[1][mfi]),
1299 &(mf_crse_patch[2][mfi]) )};
1301 &(*mf_local[1])[mfi],
1302 &(*mf_local[2])[mfi] )};
1308 const Box& dbx_cc = dfab_cc & fdomain_g;
1310 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1316 bcscomp,0,ncomp,bcs[d],bcr_d);
1318 for (
int n=0; n<ncomp; ++n)
1319 { bcr[n][d] = bcr_d[n]; }
1322 pre_interp(sfab, sbx_cc, 0, ncomp);
1324 mapper->interp_arr(sfab, 0, dfab, dcomp_adj, ncomp, dbx_cc, ratio, mfab,
1325 cgeom, fgeom, bcr, idummy1, idummy2,
RunOn::Gpu);
1327 post_interp(dfab, dbx_cc, dcomp_adj, ncomp);
1331 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1333 if (mf[d] != mf_local[d]) {
1334 amrex::Copy(*mf[d], *mf_local[d], 0, dcomp, ncomp, nghost);
1337 fbc[d](*mf[d], dcomp, ncomp, nghost, time, fbccomp);
1341template <FabArrayType MF,
typename Interp>
1344 IntVect const& nghost_outside_domain,
1345 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1347 const IntVect& ratio, Interp* mapper,
1352 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1356template <FabArrayType MF>
1360 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
1368template <FabArrayType MF,
typename Interp>
1374 int scomp,
int dcomp,
int ncomp,
1376 const IntVect& ratio, Interp* mapper,
1382 FillPatchTwoLevels(mf, nghost, time, cmf, ct, fmf, ft, scomp, dcomp, ncomp,
1383 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1387template <FabArrayType MF,
typename BC,
typename Interp>
1391 int scomp,
int dcomp,
int ncomp,
1406 auto get_clayout = [&] () -> std::tuple<BoxArray,BoxArray,DistributionMapping>
1411 BoxArray const& ba = mf.boxArray();
1412 auto const& typ = ba.
ixType();
1413 std::map<int,Vector<Box>> extra_boxes_map;
1416 for (
int i = 0, N =
int(ba.
size()); i < N; ++i) {
1417 Box const& cbox = mapper->CoarseBox(
amrex::grow(ba[i],nghost),ratio[level-1]);
1419 Box gdomain = geom[level-1].growNonPeriodicDomain(cbox.
length());
1422 auto& extra_boxes = extra_boxes_map[i];
1423 auto const& pshift = geom[level-1].periodicity().shiftIntVect();
1424 for (
auto const& piv : pshift) {
1427 extra_boxes.push_back(ibox);
1435 if (!extra_boxes_map.empty()) {
1437 auto& lbox = cbl2.
data();
1440 for (
auto const& [i, vb] : extra_boxes_map) {
1442 for (
int j = 1, nj =
int(vb.size()); j < nj; ++j) {
1443 lbox.push_back(vb[j]);
1444 procmap2.push_back(dm[i]);
1451 return std::make_tuple(
BoxArray(std::move(cbl)), cba2, dm2);
1462 level <
int(bc.
size()) &&
1463 level <
int(ratio.
size()+1));
1467 }
else if (level >=
int(smf.size()))
1469 auto const& [ba1, ba2, dm2] = get_clayout();
1474 mf.DistributionMap(), {0,0,0},
1492 MF* p_mf_inside = (ba2.empty()) ? &cmf1 : &cmf2;
1494 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1495 if (&cmf1 != p_mf_inside) {
1496 cmf1.ParallelCopy(*p_mf_inside, geom[level-1].periodicity());
1498 Box domain_g = geom[level].growPeriodicDomain(nghost);
1499 domain_g.
convert(mf.ixType());
1500 FillPatchInterp(mf, dcomp, cmf1, 0, ncomp, nghost, geom[level-1], geom[level],
1501 domain_g, ratio[level-1], mapper, bcr, bcrcomp);
1504 int error_code = detail::FillPatchTwoLevels_doit(mf, nghost, time,
1505 smf[level-1], st[level-1],
1506 smf[level ], st[level ],
1507 scomp, dcomp, ncomp,
1508 geom[level-1], geom[level],
1509 bc[level-1], bccomp,
1511 ratio[level-1], mapper, bcr, bcrcomp,
1512 hook, hook, index_space,
true);
1513 if (error_code == 0) {
return; }
1515 auto const& [ba1, ba2, dm2] = get_clayout();
1521 mf.DistributionMap(), {0,0,0},
1523 cmf_tmp.define(ba1, mf.DistributionMap(), ncomp, 0,
MFInfo().SetArena(
The_Async_Arena()), *factory);
1541 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1547 for (
auto const*
p : fmf) {
1551 for (
auto& a : fmf_raii) {
1556 detail::FillPatchTwoLevels_doit(mf, nghost, time,
1560 geom[level-1], geom[level],
1561 bc[level-1], bccomp,
1563 ratio[level-1], mapper, bcr, bcrcomp,
1564 hook, hook, index_space);
#define BL_PROFILE(a)
Definition AMReX_BLProfiler.H:593
#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
while parser_exe_t p
Definition AMReX_Parser_Exe_Body.H:33
#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:1269
static bool SameRefs(const BoxArray &lhs, const BoxArray &rhs)
whether two BoxArrays share the same data
Definition AMReX_BoxArray.H:1252
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:897
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
__host__ __device__ bool ok() const noexcept
Return true if high bounds are >= low bounds and the index type is valid.
Definition AMReX_Box.H:229
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:55
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:2116
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:87
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:246
Periodicity periodicity() const noexcept
Return the Periodicity based on the length of the domain.
Definition AMReX_Geometry.H:426
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition AMReX_Geometry.H:399
__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
Definition AMReX_IndexType.H:160
__host__ __device__ constexpr int min() const noexcept
minimum (no absolute values) value
Definition AMReX_IntVect.H:331
__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:549
__host__ static __device__ constexpr IntVectND< dim > TheZeroVector() noexcept
Definition AMReX_IntVect.H:778
__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:499
Definition AMReX_InterpBase.H:39
Definition AMReX_InterpBase.H:22
Box doit(const Box &fine) const override
Apply the coarse-box logic to the supplied fine box.
Definition AMReX_InterpBase.cpp:12
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: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
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:240
__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:1632
__host__ __device__ BoxND< dim > minBox(const BoxND< dim > &b1, const BoxND< dim > &b2) noexcept
Return the minimal BoxND containing both b1 and b2.
Definition AMReX_Box.H:1923
__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:1471
__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:1550
__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:1328
std::array< T, N > Array
Definition AMReX_Array.H:31
Arena * The_Async_Arena()
Definition AMReX_Arena.cpp:849
__host__ __device__ bool almostEqual(T x, T y, int ulp=2)
Definition AMReX_Algorithm.H:140
const IndexSpace * TopIndexSpaceIfPresent() noexcept
Return the top IndexSpace if one has been built (nullptr otherwise).
Definition AMReX_EB2.cpp:99
int TeamSize() noexcept
Definition AMReX_ParallelDescriptor.H:310
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:273
void Copy(FabArray< DFAB > &dst, FabArray< SFAB > const &src, int srccomp, int dstcomp, int numcomp, int nghost)
Definition AMReX_FabArray.H:219
@ F
Definition AMReX_Order.H:7
BoxArray const & boxArray(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.boxArray().
Definition AMReX_FabArrayBase.cpp:3038
DistributionMapping const & DistributionMap(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.DistributionMap().
Definition AMReX_FabArrayBase.cpp:3043
RunOn
Definition AMReX_GpuControl.H:65
@ Gpu
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
@ basic
EBCellFlag.
Definition AMReX_EBSupport.H:16
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:314
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
IndexTypeND< 3 > IndexType
IndexType is an alias for amrex::IndexTypeND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:41
IntVect nGrowVect(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.nGrowVect().
Definition AMReX_FabArrayBase.cpp:3033
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:1029
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
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:239
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:841
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:1389
FabArray memory allocation information.
Definition AMReX_FabArray.H:73
Definition AMReX_FillPatchUtil.H:39