1#ifndef AMREX_FillPatchUtil_H_
2#define AMREX_FillPatchUtil_H_
3#include <AMReX_Config.H>
37 template <
typename MFFAB>
40 template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,
int> = 0>
43 template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,
int> = 0>
46 template <class F=MFFAB, std::enable_if_t<IsFabArray<F>::value,
int> = 0>
63 template <
typename Interp>
65 const IndexType& boxType, Interp* mapper);
90 template <
typename MF,
typename BC>
91 std::enable_if_t<IsFabArray<MF>::value>
93 const Vector<MF*>& smf,
const Vector<Real>& stime,
94 int scomp,
int dcomp,
int ncomp,
96 BC& physbcf,
int bcfcomp);
121 template <
typename MF,
typename BC>
122 std::enable_if_t<IsFabArray<MF>::value>
124 const Vector<MF*>& smf,
const Vector<Real>& stime,
125 int scomp,
int dcomp,
int ncomp,
126 const Geometry& geom,
127 BC& physbcf,
int bcfcomp);
167 template <
typename MF,
typename BC,
typename Interp,
168 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
169 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
170 std::enable_if_t<IsFabArray<MF>::value>
172 const Vector<MF*>& cmf,
const Vector<Real>& ct,
173 const Vector<MF*>& fmf,
const Vector<Real>& ft,
174 int scomp,
int dcomp,
int ncomp,
175 const Geometry& cgeom,
const Geometry& fgeom,
176 BC& cbc,
int cbccomp,
177 BC& fbc,
int fbccomp,
180 const Vector<BCRec>& bcs,
int bcscomp,
181 const PreInterpHook& pre_interp = {},
182 const PostInterpHook& post_interp = {});
221 template <
typename MF,
typename BC,
typename Interp,
222 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
223 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
224 std::enable_if_t<IsFabArray<MF>::value>
226 const Vector<MF*>& cmf,
const Vector<Real>& ct,
227 const Vector<MF*>& fmf,
const Vector<Real>& ft,
228 int scomp,
int dcomp,
int ncomp,
229 const Geometry& cgeom,
const Geometry& fgeom,
230 BC& cbc,
int cbccomp,
231 BC& fbc,
int fbccomp,
234 const Vector<BCRec>& bcs,
int bcscomp,
235 const PreInterpHook& pre_interp = {},
236 const PostInterpHook& post_interp = {});
279 template <
typename MF,
typename BC,
typename Interp,
280 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
281 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
282 std::enable_if_t<IsFabArray<MF>::value>
284 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
285 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
286 int scomp,
int dcomp,
int ncomp,
287 const Geometry& cgeom,
const Geometry& fgeom,
288 Array<BC, AMREX_SPACEDIM>& cbc,
const Array<int, AMREX_SPACEDIM>& cbccomp,
289 Array<BC, AMREX_SPACEDIM>& fbc,
const Array<int, AMREX_SPACEDIM>& fbccomp,
292 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
const Array<int, AMREX_SPACEDIM>& bcscomp,
293 const PreInterpHook& pre_interp = {},
294 const PostInterpHook& post_interp = {});
337 template <
typename MF,
typename BC,
typename Interp,
338 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
339 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
340 std::enable_if_t<IsFabArray<MF>::value>
342 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
343 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
344 int scomp,
int dcomp,
int ncomp,
345 const Geometry& cgeom,
const Geometry& fgeom,
346 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
347 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
350 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
351 const PreInterpHook& pre_interp = {},
352 const PostInterpHook& post_interp = {});
394 template <
typename MF,
typename BC,
typename Interp,
395 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
396 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
397 std::enable_if_t<IsFabArray<MF>::value>
399 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
400 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
401 int scomp,
int dcomp,
int ncomp,
402 const Geometry& cgeom,
const Geometry& fgeom,
403 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
404 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
407 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
408 const PreInterpHook& pre_interp = {},
409 const PostInterpHook& post_interp = {});
451 template <
typename MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
452 std::enable_if_t<IsFabArray<MF>::value>
454 const EB2::IndexSpace& index_space,
455 const Vector<MF*>& cmf,
const Vector<Real>& ct,
456 const Vector<MF*>& fmf,
const Vector<Real>& ft,
457 int scomp,
int dcomp,
int ncomp,
458 const Geometry& cgeom,
const Geometry& fgeom,
459 BC& cbc,
int cbccomp,
460 BC& fbc,
int fbccomp,
463 const Vector<BCRec>& bcs,
int bcscomp,
464 const PreInterpHook& pre_interp,
465 const PostInterpHook& post_interp);
505 template <
typename MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
506 std::enable_if_t<IsFabArray<MF>::value>
508 const EB2::IndexSpace& index_space,
509 const Vector<MF*>& cmf,
const Vector<Real>& ct,
510 const Vector<MF*>& fmf,
const Vector<Real>& ft,
511 int scomp,
int dcomp,
int ncomp,
512 const Geometry& cgeom,
const Geometry& fgeom,
513 BC& cbc,
int cbccomp,
514 BC& fbc,
int fbccomp,
517 const Vector<BCRec>& bcs,
int bcscomp,
518 const PreInterpHook& pre_interp,
519 const PostInterpHook& post_interp);
552 template <
typename MF,
typename BC,
typename Interp,
553 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
554 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
555 std::enable_if_t<IsFabArray<MF>::value>
557 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
558 const Geometry& cgeom,
const Geometry& fgeom,
559 BC& cbc,
int cbccomp,
560 BC& fbc,
int fbccomp,
563 const Vector<BCRec>& bcs,
int bcscomp,
564 const PreInterpHook& pre_interp = {},
565 const PostInterpHook& post_interp = {});
596 template <
typename MF,
typename BC,
typename Interp,
597 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
598 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
599 std::enable_if_t<IsFabArray<MF>::value>
601 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
602 const Geometry& cgeom,
const Geometry& fgeom,
603 BC& cbc,
int cbccomp,
604 BC& fbc,
int fbccomp,
607 const Vector<BCRec>& bcs,
int bcscomp,
608 const PreInterpHook& pre_interp = {},
609 const PostInterpHook& post_interp = {});
641 template <
typename MF,
typename BC,
typename Interp,
642 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
643 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
644 std::enable_if_t<IsFabArray<MF>::value>
646 const EB2::IndexSpace* index_space,
647 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
648 const Geometry& cgeom,
const Geometry& fgeom,
649 BC& cbc,
int cbccomp,
650 BC& fbc,
int fbccomp,
653 const Vector<BCRec>& bcs,
int bcscomp,
654 const PreInterpHook& pre_interp = {},
655 const PostInterpHook& post_interp = {});
687 template <
typename MF,
typename BC,
typename Interp,
688 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
689 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
690 std::enable_if_t<IsFabArray<MF>::value>
692 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
693 const Geometry& cgeom,
const Geometry& fgeom,
694 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
695 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
698 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
699 const PreInterpHook& pre_interp = {},
700 const PostInterpHook& post_interp = {});
733 template <
typename MF,
typename BC,
typename Interp,
734 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
735 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
736 std::enable_if_t<IsFabArray<MF>::value>
738 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
739 const Geometry& cgeom,
const Geometry& fgeom,
740 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
741 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
744 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
745 const PreInterpHook& pre_interp = {},
746 const PostInterpHook& post_interp = {});
774 template <
typename MF,
typename Interp>
775 std::enable_if_t<IsFabArray<MF>::value>
777 IntVect const& nghost_outside_domain,
778 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
779 const Geometry& cgeom,
const Geometry& fgeom,
780 const IntVect& ratio, Interp* mapper,
781 const Vector<BCRec>& bcs,
int bcscomp);
805 template <
typename MF>
806 std::enable_if_t<IsFabArray<MF>::value>
808 const Vector<MF*>& smf,
IntVect const& snghost,
809 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
810 const Geometry& geom);
842 template <
typename MF,
typename Interp>
843 std::enable_if_t<IsFabArray<MF>::value>
846 const Vector<MF*>& cmf,
const Vector<Real>& ct,
847 const Vector<MF*>& fmf,
const Vector<Real>& ft,
848 int scomp,
int dcomp,
int ncomp,
849 const Geometry& cgeom,
const Geometry& fgeom,
850 const IntVect& ratio, Interp* mapper,
851 const Vector<BCRec>& bcs,
int bcscomp);
857 const Array<MultiFab,AMREX_SPACEDIM>&
crse,
858 Array<MultiFab,AMREX_SPACEDIM>&
fine,
859 const Geometry& cgeom,
const Geometry& fgeom,
863 const Array<MultiFab const*,AMREX_SPACEDIM>&
crse,
864 const Array<MultiFab*,AMREX_SPACEDIM>&
fine,
865 const Geometry& cgeom,
const Geometry& fgeom,
907 template <
typename MF,
typename BC,
typename Interp>
908 std::enable_if_t<IsFabArray<MF>::value>
910 const Vector<Vector<MF*>>& smf,
const Vector<Vector<Real>>& st,
911 int scomp,
int dcomp,
int ncomp,
912 const Vector<Geometry>& geom,
913 Vector<BC>& bc,
int bccomp,
914 const Vector<IntVect>& ratio,
916 const Vector<BCRec>& bcr,
int bcrcomp);
Array4< Real > fine
Definition AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition AMReX_InterpFaceRegister.cpp:92
Collection of spatial interpolaters used by FillPatch and flux-register logic.
Interpolaters that operate directly on MultiFabs (cell- or node-centered).
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
std::array< T, N > Array
Definition AMReX_Array.H:26
Definition AMReX_Amr.cpp:49
InterpEM_t
Definition AMReX_FillPatchUtil.H:854
@ InterpB
Definition AMReX_FillPatchUtil.H:854
@ InterpE
Definition AMReX_FillPatchUtil.H:854
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:1363
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
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:75
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:817
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:1005
void InterpCrseFineBndryEMfield(InterpEM_t interp_type, const Array< MultiFab, 3 > &crse, Array< MultiFab, 3 > &fine, const Geometry &cgeom, const Geometry &fgeom, int ref_ratio)
Definition AMReX_FillPatchUtil.cpp:11
IndexTypeND< 3 > IndexType
IndexType is an alias for amrex::IndexTypeND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:36
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:33
Definition AMReX_FillPatchUtil.H:39
void operator()(MFFAB &, const Box &, int, int) const
Definition AMReX_FillPatchUtil.H:41