1 #ifndef AMREX_FillPatchUtil_H_
2 #define AMREX_FillPatchUtil_H_
3 #include <AMReX_Config.H>
32 template <
typename MFFAB>
35 template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,
int> = 0>
38 template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,
int> = 0>
41 template <class F=MFFAB, std::enable_if_t<IsFabArray<F>::value,
int> = 0>
58 template <
typename Interp>
60 const IndexType& boxType, Interp* mapper);
85 template <
typename MF,
typename BC>
86 std::enable_if_t<IsFabArray<MF>::value>
88 const Vector<MF*>& smf,
const Vector<Real>& stime,
89 int scomp,
int dcomp,
int ncomp,
91 BC& physbcf,
int bcfcomp);
116 template <
typename MF,
typename BC>
117 std::enable_if_t<IsFabArray<MF>::value>
119 const Vector<MF*>& smf,
const Vector<Real>& stime,
120 int scomp,
int dcomp,
int ncomp,
121 const Geometry& geom,
122 BC& physbcf,
int bcfcomp);
162 template <
typename MF,
typename BC,
typename Interp,
163 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
164 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
165 std::enable_if_t<IsFabArray<MF>::value>
167 const Vector<MF*>& cmf,
const Vector<Real>& ct,
168 const Vector<MF*>& fmf,
const Vector<Real>& ft,
169 int scomp,
int dcomp,
int ncomp,
170 const Geometry& cgeom,
const Geometry& fgeom,
171 BC& cbc,
int cbccomp,
172 BC& fbc,
int fbccomp,
175 const Vector<BCRec>& bcs,
int bcscomp,
176 const PreInterpHook& pre_interp = {},
177 const PostInterpHook& post_interp = {});
216 template <
typename MF,
typename BC,
typename Interp,
217 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
218 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
219 std::enable_if_t<IsFabArray<MF>::value>
221 const Vector<MF*>& cmf,
const Vector<Real>& ct,
222 const Vector<MF*>& fmf,
const Vector<Real>& ft,
223 int scomp,
int dcomp,
int ncomp,
224 const Geometry& cgeom,
const Geometry& fgeom,
225 BC& cbc,
int cbccomp,
226 BC& fbc,
int fbccomp,
229 const Vector<BCRec>& bcs,
int bcscomp,
230 const PreInterpHook& pre_interp = {},
231 const PostInterpHook& post_interp = {});
274 template <
typename MF,
typename BC,
typename Interp,
275 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
276 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
277 std::enable_if_t<IsFabArray<MF>::value>
279 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
280 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
281 int scomp,
int dcomp,
int ncomp,
282 const Geometry& cgeom,
const Geometry& fgeom,
283 Array<BC, AMREX_SPACEDIM>& cbc,
const Array<int, AMREX_SPACEDIM>& cbccomp,
284 Array<BC, AMREX_SPACEDIM>& fbc,
const Array<int, AMREX_SPACEDIM>& fbccomp,
287 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
const Array<int, AMREX_SPACEDIM>& bcscomp,
288 const PreInterpHook& pre_interp = {},
289 const PostInterpHook& post_interp = {});
332 template <
typename MF,
typename BC,
typename Interp,
333 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
334 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
335 std::enable_if_t<IsFabArray<MF>::value>
337 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
338 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
339 int scomp,
int dcomp,
int ncomp,
340 const Geometry& cgeom,
const Geometry& fgeom,
341 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
342 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
345 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
346 const PreInterpHook& pre_interp = {},
347 const PostInterpHook& post_interp = {});
389 template <
typename MF,
typename BC,
typename Interp,
390 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
391 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
392 std::enable_if_t<IsFabArray<MF>::value>
394 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
395 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
396 int scomp,
int dcomp,
int ncomp,
397 const Geometry& cgeom,
const Geometry& fgeom,
398 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
399 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
402 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
403 const PreInterpHook& pre_interp = {},
404 const PostInterpHook& post_interp = {});
446 template <
typename MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
447 std::enable_if_t<IsFabArray<MF>::value>
449 const EB2::IndexSpace& index_space,
450 const Vector<MF*>& cmf,
const Vector<Real>& ct,
451 const Vector<MF*>& fmf,
const Vector<Real>& ft,
452 int scomp,
int dcomp,
int ncomp,
453 const Geometry& cgeom,
const Geometry& fgeom,
454 BC& cbc,
int cbccomp,
455 BC& fbc,
int fbccomp,
458 const Vector<BCRec>& bcs,
int bcscomp,
459 const PreInterpHook& pre_interp,
460 const PostInterpHook& post_interp);
500 template <
typename MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
501 std::enable_if_t<IsFabArray<MF>::value>
503 const EB2::IndexSpace& index_space,
504 const Vector<MF*>& cmf,
const Vector<Real>& ct,
505 const Vector<MF*>& fmf,
const Vector<Real>& ft,
506 int scomp,
int dcomp,
int ncomp,
507 const Geometry& cgeom,
const Geometry& fgeom,
508 BC& cbc,
int cbccomp,
509 BC& fbc,
int fbccomp,
512 const Vector<BCRec>& bcs,
int bcscomp,
513 const PreInterpHook& pre_interp,
514 const PostInterpHook& post_interp);
547 template <
typename MF,
typename BC,
typename Interp,
548 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
549 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
550 std::enable_if_t<IsFabArray<MF>::value>
552 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
553 const Geometry& cgeom,
const Geometry& fgeom,
554 BC& cbc,
int cbccomp,
555 BC& fbc,
int fbccomp,
558 const Vector<BCRec>& bcs,
int bcscomp,
559 const PreInterpHook& pre_interp = {},
560 const PostInterpHook& post_interp = {});
591 template <
typename MF,
typename BC,
typename Interp,
592 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
593 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
594 std::enable_if_t<IsFabArray<MF>::value>
596 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
597 const Geometry& cgeom,
const Geometry& fgeom,
598 BC& cbc,
int cbccomp,
599 BC& fbc,
int fbccomp,
602 const Vector<BCRec>& bcs,
int bcscomp,
603 const PreInterpHook& pre_interp = {},
604 const PostInterpHook& post_interp = {});
636 template <
typename MF,
typename BC,
typename Interp,
637 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
638 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
639 std::enable_if_t<IsFabArray<MF>::value>
641 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
642 const Geometry& cgeom,
const Geometry& fgeom,
643 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
644 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
647 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
648 const PreInterpHook& pre_interp = {},
649 const PostInterpHook& post_interp = {});
682 template <
typename MF,
typename BC,
typename Interp,
683 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
684 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
685 std::enable_if_t<IsFabArray<MF>::value>
687 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
688 const Geometry& cgeom,
const Geometry& fgeom,
689 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
690 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
693 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
694 const PreInterpHook& pre_interp = {},
695 const PostInterpHook& post_interp = {});
723 template <
typename MF,
typename Interp>
724 std::enable_if_t<IsFabArray<MF>::value>
726 IntVect const& nghost_outside_domain,
727 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
728 const Geometry& cgeom,
const Geometry& fgeom,
729 const IntVect& ratio, Interp* mapper,
730 const Vector<BCRec>& bcs,
int bcscomp);
754 template <
typename MF>
755 std::enable_if_t<IsFabArray<MF>::value>
757 const Vector<MF*>& smf,
IntVect const& snghost,
758 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
759 const Geometry& geom);
791 template <
typename MF,
typename Interp>
792 std::enable_if_t<IsFabArray<MF>::value>
794 IntVect const& nghost_outside_domain, Real time,
795 const Vector<MF*>& cmf,
const Vector<Real>& ct,
796 const Vector<MF*>& fmf,
const Vector<Real>& ft,
797 int scomp,
int dcomp,
int ncomp,
798 const Geometry& cgeom,
const Geometry& fgeom,
799 const IntVect& ratio, Interp* mapper,
800 const Vector<BCRec>& bcs,
int bcscomp);
806 const Array<MultiFab,AMREX_SPACEDIM>&
crse,
807 Array<MultiFab,AMREX_SPACEDIM>&
fine,
808 const Geometry& cgeom,
const Geometry& fgeom,
812 const Array<MultiFab const*,AMREX_SPACEDIM>&
crse,
813 const Array<MultiFab*,AMREX_SPACEDIM>&
fine,
814 const Geometry& cgeom,
const Geometry& fgeom,
856 template <
typename MF,
typename BC,
typename Interp>
857 std::enable_if_t<IsFabArray<MF>::value>
859 const Vector<Vector<MF*>>& smf,
const Vector<Vector<Real>>& st,
860 int scomp,
int dcomp,
int ncomp,
861 const Vector<Geometry>& geom,
862 Vector<BC>& bc,
int bccomp,
863 const Vector<IntVect>& ratio,
865 const Vector<BCRec>& bcr,
int bcrcomp);
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
Definition: AMReX_Amr.cpp:49
InterpEM_t
Definition: AMReX_FillPatchUtil.H:803
@ InterpB
Definition: AMReX_FillPatchUtil.H:803
@ InterpE
Definition: AMReX_FillPatchUtil.H:803
void InterpCrseFineBndryEMfield(InterpEM_t interp_type, const Array< MultiFab, AMREX_SPACEDIM > &crse, Array< MultiFab, AMREX_SPACEDIM > &fine, const Geometry &cgeom, const Geometry &fgeom, int ref_ratio)
Definition: AMReX_FillPatchUtil.cpp:11
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:33
std::enable_if_t< IsFabArray< MF >::value > 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:73
std::enable_if_t< IsFabArray< MF >::value > 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:796
std::enable_if_t< IsFabArray< MF >::value > 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:984
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
std::enable_if_t< IsFabArray< MF >::value > 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:1308
IndexTypeND< AMREX_SPACEDIM > IndexType
Definition: AMReX_BaseFwd.H:33
std::array< T, N > Array
Definition: AMReX_Array.H:24
Definition: AMReX_FillPatchUtil.H:34
void operator()(MFFAB &, const Box &, int, int) const
Definition: AMReX_FillPatchUtil.H:36