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];
112 if (mf.boxArray() == smf[0]->boxArray() &&
113 mf.DistributionMap() == smf[0]->DistributionMap())
118 fill_dmf = (&mf != smf[0] && &mf != smf[1]) || scomp != dcomp;
122 dmf = smf[(time != t0 && time == t1) ? 1 : 0];
141 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
142 interp_ghost = physbcf.fp1_src_ghost;
144 interp_ghost.
min(nghost);
155 hull.resize(raii.local_size());
156 if (!mf.empty() && !raii.empty()) {
157 auto const& cpc = mf.getCPC(nghost, raii, src_ghost, geom.
periodicity());
158 for (
auto const& tag : *cpc.m_LocTags) {
159 Box& h = hull[raii.localindex(tag.srcIndex)];
162 for (
auto const& kv : *cpc.m_SndTags) {
163 for (
auto const& tag : kv.second) {
164 Box& h = hull[raii.localindex(tag.srcIndex)];
172#pragma omp parallel if (Gpu::notInLaunchRegion())
176 Box bx = mfi.growntilebox(interp_ghost);
178 const Box& hbx = hull[mfi.LocalIndex()];
179 if (!hbx.
ok()) {
continue; }
182 auto const sfab0 = smf[0]->array(mfi);
183 auto const sfab1 = smf[1]->array(mfi);
184 auto dfab = dmf->array(mfi);
190 dfab(i,j,k,n+destcomp) = sfab0(i,j,k,n+scomp);
197 dfab(i,j,k,n+destcomp) = sfab1(i,j,k,n+scomp);
202 Real alpha = (t1-time)/(t1-t0);
203 Real beta = (time-t0)/(t1-t0);
206 dfab(i,j,k,n+destcomp) = alpha*sfab0(i,j,k,n+scomp)
207 + beta*sfab1(i,j,k,n+scomp);
214 dfab(i,j,k,n+destcomp) = sfab0(i,j,k,n+scomp);
224 mf.FillBoundary(dcomp, ncomp, nghost, geom.
periodicity());
228 mf.ParallelCopy(*dmf, destcomp, dcomp, ncomp, src_ghost, nghost, geom.
periodicity());
232 amrex::Abort(
"FillPatchSingleLevel: high-order interpolation in time not implemented yet");
235 physbcf(mf, dcomp, ncomp, nghost, time, bcfcomp);
255void FillPatchInterp (MultiFab& mf_fine_patch,
int fcomp, MultiFab
const& mf_crse_patch,
int ccomp,
256 int ncomp,
IntVect const& ng,
const Geometry& cgeom,
const Geometry& fgeom,
258 MFInterpolater* mapper,
const Vector<BCRec>& bcs,
int bcscomp);
260template <FabArrayType MF,
typename Interp>
261requires (!std::is_same_v<Interp, MFInterpolater>)
273#pragma omp parallel if (Gpu::notInLaunchRegion())
279 auto& sfab = mf_crse_patch[mfi];
280 const Box& sbx = sfab.box();
282 auto& dfab = mf_fine_patch[mfi];
286 mapper->interp(sfab, ccomp, dfab, fcomp, ncomp, dbx, ratio,
287 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
292template <FabArrayType MF>
301 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
305 ncomp, ng, cgeom, fgeom, dest_domain, ratio,
312template <FabArrayType MF,
typename iMF,
typename Interp>
313requires (!std::is_same_v<Interp, MFInterpolater>)
316 MF
const& mf_crse_patch,
int crse_comp,
317 MF& mf_refined_patch,
int fine_comp,
318 int ncomp,
const IntVect& ratio,
319 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
320 int bcscomp,
RunOn gpu_or_cpu,
327 auto& sfab = mf_crse_patch[mfi];
328 const Box& sbx = sfab.box();
329 auto& dfab = mf_refined_patch[mfi];
330 Box const& dbx = dfab.box();
331 auto& ifab = solve_mask[mfi];
333 interp->interp_face(sfab,crse_comp,dfab,fine_comp,ncomp,
334 dbx, ratio, ifab, crse_geom, fine_geom,
335 bcr, bcscomp, gpu_or_cpu);
339template <FabArrayType MF,
typename iMF>
342 MF
const& mf_crse_patch,
int crse_comp,
343 MF& mf_refined_patch,
int fine_comp,
344 int ncomp,
const IntVect& ratio,
345 const iMF& solve_mask,
const Geometry& crse_geom,
const Geometry& fine_geom,
346 int bccomp,
RunOn gpu_or_cpu,
351 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
352 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
357 mf_crse_patch, crse_comp,mf_refined_patch, fine_comp,
358 ncomp, ratio, solve_mask, crse_geom, fine_geom, bccomp,
372 template <MultiFabLike MF>
373 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
374 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
376 MF mf_crse_patch(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0, MFInfo(),
377 *fpc.fact_crse_patch);
378 return mf_crse_patch;
381 template <MultiFabLike MF>
382 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
383 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
385 MF mf_crse_patch(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch,
386 ncomp, 0, MFInfo(), *fpc.fact_crse_patch);
387 return mf_crse_patch;
390 template <MultiFabLike MF>
391 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
392 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
394 MF mf_fine_patch(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0, MFInfo(),
395 *fpc.fact_fine_patch);
396 return mf_fine_patch;
399 template <MultiFabLike MF>
400 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
401 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
403 MF mf_fine_patch(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch,
404 ncomp, 0, MFInfo(), *fpc.fact_fine_patch);
405 return mf_fine_patch;
408 template <MultiFabLike MF>
409 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
410 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
413 fpc.dm_patch, ncomp, 0, MFInfo(), *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)
422 fpc.dm_patch, ncomp, 0, MFInfo(), *fpc.fact_fine_patch);
426 template <MultiFabLike MF>
427 requires (std::same_as<typename MF::FABType::value_type, FArrayBox>)
428 void mf_set_domain_bndry (MF &mf, Geometry
const & geom)
430 mf.setDomainBndry(std::numeric_limits<Real>::quiet_NaN(), geom);
436 template <MultiFabLike MF>
437 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
438 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
440 return MF(fpc.ba_crse_patch, fpc.dm_patch, ncomp, 0);
443 template <MultiFabLike MF>
444 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
445 MF make_mf_crse_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
447 return MF(
amrex::convert(fpc.ba_crse_patch, idx_type), fpc.dm_patch, ncomp, 0);
450 template <MultiFabLike MF>
451 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
452 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp)
454 return MF(fpc.ba_fine_patch, fpc.dm_patch, ncomp, 0);
457 template <MultiFabLike MF>
458 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
459 MF make_mf_fine_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type)
461 return MF(
amrex::convert(fpc.ba_fine_patch, idx_type), fpc.dm_patch, ncomp, 0);
464 template <MultiFabLike MF>
465 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
466 MF make_mf_refined_patch (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
471 template <MultiFabLike MF>
472 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
473 MF make_mf_crse_mask (FabArrayBase::FPinfo
const& fpc,
int ncomp,
IndexType idx_type,
IntVect ratio)
478 template <MultiFabLike MF>
479 requires (!std::same_as<typename MF::FABType::value_type, FArrayBox>)
480 void mf_set_domain_bndry (MF &, Geometry
const & )
485 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
487 FillPatchTwoLevels_doit (MF& mf,
IntVect const& nghost,
Real time,
488 const Vector<MF*>& cmf,
const Vector<Real>& ct,
489 const Vector<MF*>& fmf,
const Vector<Real>& ft,
490 int scomp,
int dcomp,
int ncomp,
491 const Geometry& cgeom,
const Geometry& fgeom,
492 BC& cbc,
int cbccomp,
493 BC& fbc,
int fbccomp,
496 const Vector<BCRec>& bcs,
int bcscomp,
497 const PreInterpHook& pre_interp,
498 const PostInterpHook& post_interp,
499 EB2::IndexSpace
const* index_space,
500 bool return_error_code =
false)
504 int success_code = return_error_code ? 0 : -1;
505 int failure_code = 1;
507 if (nghost.max() > 0 || mf.getBDKey() != fmf[0]->getBDKey())
509 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
515 + mf.ixType().nodeCentered(1),
516 + mf.ixType().nodeCentered(2) ) == 1 )
518 if ( !
dynamic_cast<Interpolater*
>(mapper) ){
519 amrex::Abort(
"This interpolater has not yet implemented a version for face-based data");
524 mf.DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
535 if ( ! fpc.ba_crse_patch.empty())
537 if (return_error_code) {
539 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
544 MF mf_crse_patch = make_mf_crse_patch<MF> (fpc, ncomp, mf.boxArray().ixType());
549 MF mf_refined_patch = make_mf_refined_patch<MF> (fpc, ncomp, mf.boxArray().ixType(), ratio);
550 auto solve_mask = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf.boxArray().ixType(), ratio);
552 mf_set_domain_bndry(mf_crse_patch, cgeom);
553 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
554 cbc.fp1_src_ghost = cbc.cghost;
557 cgeom, cbc, cbccomp);
559 mf_set_domain_bndry(mf_refined_patch, fgeom);
560 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
561 fbc.fp1_src_ghost =
IntVect(0);
564 fgeom, fbc, fbccomp);
568 ncomp, nghost, MFInfo().SetAlloc(
false) );
569 MF mf_solution(
amrex::coarsen(mf_refined_patch.boxArray(), ratio), mf_refined_patch.DistributionMap(),
570 ncomp, 0, MFInfo().SetAlloc(
false) );
574 cgeom.periodicity());
576 solve_mask.setVal(1);
577 solve_mask.setVal(0, mask_cpc, 0, ncomp);
579 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
581 InterpFace(mapper, mf_crse_patch, 0, mf_refined_patch, 0, ncomp,
582 ratio, solve_mask, cgeom, fgeom, bcscomp,
RunOn::Gpu, bcs);
584 detail::call_interp_hook(post_interp, mf_refined_patch, 0, ncomp);
586 bool aliasing =
false;
587 for (
auto const& fmf_a : fmf) {
588 aliasing = aliasing || (&mf == fmf_a);
591 mf.ParallelCopyToGhost(mf_refined_patch, 0, dcomp, ncomp,
594 mf.ParallelCopy(mf_refined_patch, 0, dcomp, ncomp,
608 if ( ! fpc.ba_crse_patch.empty())
610 if (return_error_code) {
611 BoxArray
const& cba = cmf[0]->boxArray();
612 if (!cba.contains(fpc.ba_crse_patch,cgeom.periodicity())) {
617 MF mf_crse_patch = make_mf_crse_patch<MF>(fpc, ncomp);
618 mf_set_domain_bndry (mf_crse_patch, cgeom);
620 if constexpr (std::is_same_v<BC,PhysBCFunctUseCoarseGhost>) {
621 cbc.fp1_src_ghost = cbc.cghost;
625 MF mf_fine_patch = make_mf_fine_patch<MF>(fpc, ncomp);
627 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
630 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
631 if (fgeom.isPeriodic(i)) {
632 fdomain_g.grow(i, nghost[i]);
634 if constexpr (std::is_same_v
635 <BC, PhysBCFunctUseCoarseGhost>) {
636 fdomain_g.grow(i, fbc.nghost_outside_domain[i]);
641 ncomp,
IntVect(0), cgeom, fgeom,
642 fdomain_g, ratio, mapper, bcs, bcscomp);
644 detail::call_interp_hook(post_interp, mf_fine_patch, 0, ncomp);
646 mf.ParallelCopy(mf_fine_patch, 0, dcomp, ncomp,
IntVect{0}, nghost);
651 if constexpr(std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
652 fbc.fp1_src_ghost =
IntVect(0);
655 fgeom, fbc, fbccomp);
660 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
665 int scomp,
int dcomp,
int ncomp,
666 const Geometry& cgeom,
const Geometry& fgeom,
672 const PreInterpHook& pre_interp,
673 const PostInterpHook& post_interp,
674 EB2::IndexSpace
const* index_space)
676 BL_PROFILE(
"FillPatchTwoLevels (Array<MF*>)");
678 using FAB =
typename MF::FABType::value_type;
679 using iFAB =
typename iMultiFab::FABType::value_type;
682 && mf[1]->ixType().nodeCentered(1),
683 && mf[2]->ixType().nodeCentered(2)));
698 if (nghost.max() > 0 || mf[0]->getBDKey() != fmf[0][0]->getBDKey())
700 const InterpolaterBoxCoarsener& coarsener = mapper->BoxCoarsener(ratio);
706 fmf[0][0]->
DistributionMap(), ncomp, nghost, MFInfo().SetAlloc(
false) );
715 if ( !fpc.ba_crse_patch.empty() )
721 for (
int d=0; d<AMREX_SPACEDIM; ++d)
723 mf_crse_patch[d] = make_mf_crse_patch<MF> (fpc, ncomp, mf[d]->
boxArray().ixType());
724 mf_refined_patch[d] = make_mf_refined_patch<MF> (fpc, ncomp, mf[d]->
boxArray().ixType(), ratio);
725 solve_mask[d] = make_mf_crse_mask<iMultiFab>(fpc, ncomp, mf[d]->
boxArray().ixType(), ratio);
727 mf_set_domain_bndry(mf_crse_patch[d], cgeom);
728 Vector<MF*> cmf_time;
729 for (
const auto & mfab : cmf)
730 { cmf_time.push_back(mfab[d]); }
733 cgeom, cbc[d], cbccomp[d]);
735 mf_set_domain_bndry(mf_refined_patch[d], fgeom);
736 Vector<MF*> fmf_time;
737 for (
const auto & mfab : fmf)
738 { fmf_time.push_back(mfab[d]); }
741 fgeom, fbc[d], fbccomp[d]);
746 ncomp, nghost, MFInfo().SetAlloc(
false) );
748 ncomp, 0, MFInfo().SetAlloc(
false) );
752 cgeom.periodicity() );
754 solve_mask[d].setVal(1);
755 solve_mask[d].setVal(0, mask_cpc, 0, ncomp);
762#pragma omp parallel if (cc && Gpu::notInLaunchRegion() )
765 Vector<Array<BCRec, AMREX_SPACEDIM> > bcr(ncomp);
766 for (MFIter mfi(mf_refined_patch[0]); mfi.isValid(); ++mfi)
769 &(mf_crse_patch[1][mfi]),
770 &(mf_crse_patch[2][mfi]) )};
772 &(mf_refined_patch[1][mfi]),
773 &(mf_refined_patch[2][mfi]) )};
775 &(solve_mask[1][mfi]),
776 &(solve_mask[2][mfi]) )};
781 for (
int d=0; d<AMREX_SPACEDIM; ++d)
783 Vector<BCRec> bcr_d(ncomp);
786 bcscomp[d],0,ncomp,bcs[d],bcr_d);
788 for (
int n=0; n<ncomp; ++n)
789 { bcr[n][d] = bcr_d[n]; }
792 pre_interp(sfab, sbx_cc, 0, ncomp);
794 mapper->interp_arr(sfab, 0, dfab, 0, ncomp, dbx_cc, ratio, mfab,
795 cgeom, fgeom, bcr, idummy, idummy,
RunOn::Gpu);
797 post_interp(dfab, dbx_cc, 0, ncomp);
801 for (
int d=0; d<AMREX_SPACEDIM; ++d)
803 bool aliasing =
false;
804 for (
auto const& fmf_a : fmf) {
805 aliasing = aliasing || (mf[d] == fmf_a[d]);
808 mf[d]->ParallelCopyToGhost(mf_refined_patch[d], 0, dcomp, ncomp,
811 mf[d]->ParallelCopy(mf_refined_patch[d], 0, dcomp, ncomp,
818 for (
int d=0; d<AMREX_SPACEDIM; ++d)
820 Vector<MF*> fmf_time;
821 for (
auto const& ffab : fmf)
822 { fmf_time.push_back(ffab[d]); }
825 fgeom, fbc[d], fbccomp[d]);
832template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
837 int scomp,
int dcomp,
int ncomp,
839 BC& cbc,
int cbccomp,
840 BC& fbc,
int fbccomp,
844 const PreInterpHook& pre_interp,
845 const PostInterpHook& post_interp)
852 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
853 scomp,dcomp,ncomp,cgeom,fgeom,
854 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
855 pre_interp,post_interp,index_space);
858template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
863 int scomp,
int dcomp,
int ncomp,
865 BC& cbc,
int cbccomp,
866 BC& fbc,
int fbccomp,
870 const PreInterpHook& pre_interp,
871 const PostInterpHook& post_interp)
879 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
880 scomp,dcomp,ncomp,cgeom,fgeom,
881 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
882 pre_interp,post_interp,index_space);
885template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
890 int scomp,
int dcomp,
int ncomp,
897 const PreInterpHook& pre_interp,
898 const PostInterpHook& post_interp)
906 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
907 scomp,dcomp,ncomp,cgeom,fgeom,
908 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
909 pre_interp,post_interp,index_space);
912template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
917 int scomp,
int dcomp,
int ncomp,
924 const PreInterpHook& pre_interp,
925 const PostInterpHook& post_interp)
937 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
938 scomp,dcomp,ncomp,cgeom,fgeom,
939 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
940 pre_interp,post_interp,index_space);
943template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
948 int scomp,
int dcomp,
int ncomp,
955 const PreInterpHook& pre_interp,
956 const PostInterpHook& post_interp)
968 detail::FillPatchTwoLevels_doit(mf,mf[0]->
nGrowVect(),time,cmf,ct,fmf,ft,
969 scomp,dcomp,ncomp,cgeom,fgeom,
970 cbc,cbccomp_arr,fbc,fbccomp_arr,ratio,mapper,bcs,bcscomp_arr,
971 pre_interp,post_interp,index_space);
975template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
981 int scomp,
int dcomp,
int ncomp,
983 BC& cbc,
int cbccomp,
984 BC& fbc,
int fbccomp,
988 const PreInterpHook& pre_interp,
989 const PostInterpHook& post_interp)
991 detail::FillPatchTwoLevels_doit(mf,nghost,time,cmf,ct,fmf,ft,
992 scomp,dcomp,ncomp,cgeom,fgeom,
993 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
994 pre_interp,post_interp,&index_space);
997template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1003 int scomp,
int dcomp,
int ncomp,
1005 BC& cbc,
int cbccomp,
1006 BC& fbc,
int fbccomp,
1010 const PreInterpHook& pre_interp,
1011 const PostInterpHook& post_interp)
1013 detail::FillPatchTwoLevels_doit(mf,mf.nGrowVect(),time,cmf,ct,fmf,ft,
1014 scomp,dcomp,ncomp,cgeom,fgeom,
1015 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1016 pre_interp,post_interp,&index_space);
1020template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1023 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1025 BC& cbc,
int cbccomp,
1026 BC& fbc,
int fbccomp,
1030 const PreInterpHook& pre_interp,
1031 const PostInterpHook& post_interp)
1039 InterpFromCoarseLevel(mf,mf.nGrowVect(),time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
1040 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1041 pre_interp,post_interp);
1044template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1054 const PreInterpHook& pre_interp,
1055 const PostInterpHook& post_interp)
1058 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1059 pre_interp,post_interp);
1062template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1065 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1067 BC& cbc,
int cbccomp,
1068 BC& fbc,
int fbccomp,
1072 const PreInterpHook& pre_interp,
1073 const PostInterpHook& post_interp)
1081 InterpFromCoarseLevel(mf,nghost,time,index_space,cmf,scomp,dcomp,ncomp,cgeom,fgeom,
1082 cbc,cbccomp,fbc,fbccomp,ratio,mapper,bcs,bcscomp,
1083 pre_interp,post_interp);
1086template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1090 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1092 BC& cbc,
int cbccomp,
1093 BC& fbc,
int fbccomp,
1097 const PreInterpHook& pre_interp,
1098 const PostInterpHook& post_interp)
1102 using FAB =
typename MF::FABType::value_type;
1106 const BoxArray& ba = mf.boxArray();
1114 for (
int i = 0; i < AMREX_SPACEDIM; ++i) {
1116 fdomain_g.
grow(i, nghost[i]);
1118 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1119 fdomain_g.
grow(i, fbc.nghost_outside_domain[i]);
1125 IntVect send_ghost(0), recv_ghost(0);
1126 if constexpr (std::is_same_v<BC, PhysBCFunctUseCoarseGhost>) {
1127 mf_crse_patch.define(
amrex::coarsen(ba,ratio), dm, ncomp, fbc.src_ghost);
1128 send_ghost = fbc.cghost;
1129 recv_ghost = fbc.src_ghost;
1133 for (
int i = 0, N = ba.
size(); i < N; ++i)
1137 ba_crse_patch.
set(i, coarsener.
doit(bx));
1147 mf_crse_patch.define(ba_crse_patch, dm, ncomp, 0,
MFInfo(), *factory);
1151 mf_crse_patch.define(ba_crse_patch, dm, ncomp, 0);
1153 detail::mf_set_domain_bndry (mf_crse_patch, cgeom);
1156 mf_crse_patch.ParallelCopy(cmf, scomp, 0, ncomp, send_ghost, recv_ghost,
1159 cbc(mf_crse_patch, 0, ncomp, mf_crse_patch.nGrowVect(), time, cbccomp);
1161 detail::call_interp_hook(pre_interp, mf_crse_patch, 0, ncomp);
1163 FillPatchInterp(mf, dcomp, mf_crse_patch, 0, ncomp, nghost, cgeom, fgeom, fdomain_g,
1164 ratio, mapper, bcs, bcscomp);
1167#pragma omp parallel if (Gpu::notInLaunchRegion())
1171 FAB& dfab = mf[mfi];
1172 Box dfab_bx = dfab.box();
1173 dfab_bx.
grow(nghost-mf.nGrowVect());
1174 const Box& dbx = dfab_bx & fdomain_g;
1176 post_interp(dfab, dbx, dcomp, ncomp);
1179 fbc(mf, dcomp, ncomp, nghost, time, fbccomp);
1182template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
1192 const PreInterpHook& pre_interp,
1193 const PostInterpHook& post_interp)
1197 using FAB =
typename MF::FABType::value_type;
1198 using iFAB =
typename iMultiFab::FABType::value_type;
1201 const BoxArray& ba = mf[0]->boxArray();
1205 && mf[1]->ixType().nodeCentered(1),
1206 && mf[2]->ixType().nodeCentered(2)));
1221 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1222 if (nghost[d] % ratio[d] != 0) {
1223 nghost_adj[d] += ratio[d] - (nghost[d] % ratio[d]);
1228 int dcomp_adj = dcomp;
1230 if (! nghost.
allGE(nghost_adj)) {
1231 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
1232 mf_temp[d] = std::make_unique<MF>(mf[d]->
boxArray(),
1234 mf_local[d] = mf_temp[d].get();
1242 Box fdomain_g(fdomain);
1243 for (
int d = 0; d < AMREX_SPACEDIM; ++d) {
1245 fdomain_g.
grow(d,nghost_adj[d]);
1252 for (
int i = 0, N = ba.
size(); i < N; ++i)
1256 ba_crse_patch.
set(i, coarsener.
doit(bx));
1261 for (
int d = 0; d<AMREX_SPACEDIM; ++d)
1263 IndexType typ = mf[d]->boxArray().ixType();
1268 mf_crse_patch[d].define(ba_crse_idxed, dm, ncomp, 0,
MFInfo(), *crse_factory);
1270 mf_crse_patch[d].define(ba_crse_idxed, dm, ncomp, 0);
1272 detail::mf_set_domain_bndry(mf_crse_patch[d], cgeom);
1274 mf_crse_patch[d].ParallelCopy(*(cmf[d]), scomp, 0, ncomp, cgeom.
periodicity());
1275 cbc[d](mf_crse_patch[d], 0, ncomp, mf_crse_patch[d].nGrowVect(), time, cbccomp);
1278 int idummy1=0, idummy2=0;
1280#pragma omp parallel if (Gpu::notInLaunchRegion())
1291 &(mf_crse_patch[1][mfi]),
1292 &(mf_crse_patch[2][mfi]) )};
1294 &(*mf_local[1])[mfi],
1295 &(*mf_local[2])[mfi] )};
1301 const Box& dbx_cc = dfab_cc & fdomain_g;
1303 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1309 bcscomp,0,ncomp,bcs[d],bcr_d);
1311 for (
int n=0; n<ncomp; ++n)
1312 { bcr[n][d] = bcr_d[n]; }
1315 pre_interp(sfab, sbx_cc, 0, ncomp);
1317 mapper->interp_arr(sfab, 0, dfab, dcomp_adj, ncomp, dbx_cc, ratio, mfab,
1318 cgeom, fgeom, bcr, idummy1, idummy2,
RunOn::Gpu);
1320 post_interp(dfab, dbx_cc, dcomp_adj, ncomp);
1324 for (
int d=0; d<AMREX_SPACEDIM; ++d)
1326 if (mf[d] != mf_local[d]) {
1327 amrex::Copy(*mf[d], *mf_local[d], 0, dcomp, ncomp, nghost);
1330 fbc[d](*mf[d], dcomp, ncomp, nghost, time, fbccomp);
1334template <FabArrayType MF,
typename Interp>
1337 IntVect const& nghost_outside_domain,
1338 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
1340 const IntVect& ratio, Interp* mapper,
1345 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1349template <FabArrayType MF>
1353 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
1361template <FabArrayType MF,
typename Interp>
1367 int scomp,
int dcomp,
int ncomp,
1369 const IntVect& ratio, Interp* mapper,
1375 FillPatchTwoLevels(mf, nghost, time, cmf, ct, fmf, ft, scomp, dcomp, ncomp,
1376 cgeom, fgeom, erfbc, 0, erfbc, 0, ratio, mapper,
1380template <FabArrayType MF,
typename BC,
typename Interp>
1384 int scomp,
int dcomp,
int ncomp,
1399 auto get_clayout = [&] () -> std::tuple<BoxArray,BoxArray,DistributionMapping>
1404 BoxArray const& ba = mf.boxArray();
1405 auto const& typ = ba.
ixType();
1406 std::map<int,Vector<Box>> extra_boxes_map;
1409 for (
int i = 0, N =
int(ba.
size()); i < N; ++i) {
1410 Box const& cbox = mapper->CoarseBox(
amrex::grow(ba[i],nghost),ratio[level-1]);
1412 Box gdomain = geom[level-1].growNonPeriodicDomain(cbox.
length());
1415 auto& extra_boxes = extra_boxes_map[i];
1416 auto const& pshift = geom[level-1].periodicity().shiftIntVect();
1417 for (
auto const& piv : pshift) {
1420 extra_boxes.push_back(ibox);
1428 if (!extra_boxes_map.empty()) {
1430 auto& lbox = cbl2.
data();
1433 for (
auto const& [i, vb] : extra_boxes_map) {
1435 for (
int j = 1, nj =
int(vb.size()); j < nj; ++j) {
1436 lbox.push_back(vb[j]);
1437 procmap2.push_back(dm[i]);
1444 return std::make_tuple(
BoxArray(std::move(cbl)), cba2, dm2);
1455 level <
int(bc.
size()) &&
1456 level <
int(ratio.
size()+1));
1460 }
else if (level >=
int(smf.size()))
1462 auto const& [ba1, ba2, dm2] = get_clayout();
1467 mf.DistributionMap(), {0,0,0},
1469 cmf1.define(ba1, mf.DistributionMap(), ncomp, 0,
MFInfo(), *factory);
1474 cmf2.define(ba2, dm2, ncomp, 0,
MFInfo(), *factory2);
1479 cmf1.define(ba1, mf.DistributionMap(), ncomp, 0);
1481 cmf2.define(ba2, dm2, ncomp, 0);
1485 MF* p_mf_inside = (ba2.empty()) ? &cmf1 : &cmf2;
1487 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1488 if (&cmf1 != p_mf_inside) {
1489 cmf1.ParallelCopy(*p_mf_inside, geom[level-1].periodicity());
1491 Box domain_g = geom[level].growPeriodicDomain(nghost);
1492 domain_g.
convert(mf.ixType());
1493 FillPatchInterp(mf, dcomp, cmf1, 0, ncomp, nghost, geom[level-1], geom[level],
1494 domain_g, ratio[level-1], mapper, bcr, bcrcomp);
1497 int error_code = detail::FillPatchTwoLevels_doit(mf, nghost, time,
1498 smf[level-1], st[level-1],
1499 smf[level ], st[level ],
1500 scomp, dcomp, ncomp,
1501 geom[level-1], geom[level],
1502 bc[level-1], bccomp,
1504 ratio[level-1], mapper, bcr, bcrcomp,
1505 hook, hook, index_space,
true);
1506 if (error_code == 0) {
return; }
1508 auto const& [ba1, ba2, dm2] = get_clayout();
1514 mf.DistributionMap(), {0,0,0},
1516 cmf_tmp.define(ba1, mf.DistributionMap(), ncomp, 0,
MFInfo(), *factory);
1521 cmf_tmp.define(ba2, dm2, ncomp, 0,
MFInfo(), *factory);
1527 cmf_tmp.define(ba1, mf.DistributionMap(), ncomp, 0);
1529 cmf_tmp.define(ba2, dm2, ncomp, 0);
1534 geom, bc, bccomp, ratio, mapper, bcr, bcrcomp);
1540 for (
auto const*
p : fmf) {
1544 for (
auto& a : fmf_raii) {
1549 detail::FillPatchTwoLevels_doit(mf, nghost, time,
1553 geom[level-1], geom[level],
1554 bc[level-1], bccomp,
1556 ratio[level-1], mapper, bcr, bcrcomp,
1557 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: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
__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: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:2075
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: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
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: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: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: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
__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:1512
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:192
@ F
Definition AMReX_Order.H:7
BoxArray const & boxArray(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.boxArray().
Definition AMReX_FabArrayBase.cpp:2990
DistributionMapping const & DistributionMap(FabArrayBase const &fa)
Convenience wrapper that forwards to fa.DistributionMap().
Definition AMReX_FabArrayBase.cpp:2995
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:315
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:2985
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:1022
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:244
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:834
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:1382
FabArray memory allocation information.
Definition AMReX_FabArray.H:73
Definition AMReX_FillPatchUtil.H:39