1#ifndef AMREX_FillPatchUtil_H_
2#define AMREX_FillPatchUtil_H_
3#include <AMReX_Config.H>
37 template <
typename MFFAB>
66 template <
typename Interp>
68 const IndexType& boxType, Interp* mapper);
93 template <FabArrayType MF,
typename BC>
96 const Vector<MF*>& smf,
const Vector<Real>& stime,
97 int scomp,
int dcomp,
int ncomp,
99 BC& physbcf,
int bcfcomp);
124 template <FabArrayType MF,
typename BC>
127 const Vector<MF*>& smf,
const Vector<Real>& stime,
128 int scomp,
int dcomp,
int ncomp,
129 const Geometry& geom,
130 BC& physbcf,
int bcfcomp);
170 template <FabArrayType MF,
typename BC,
typename Interp,
171 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
172 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
175 const Vector<MF*>& cmf,
const Vector<Real>& ct,
176 const Vector<MF*>& fmf,
const Vector<Real>& ft,
177 int scomp,
int dcomp,
int ncomp,
178 const Geometry& cgeom,
const Geometry& fgeom,
179 BC& cbc,
int cbccomp,
180 BC& fbc,
int fbccomp,
183 const Vector<BCRec>& bcs,
int bcscomp,
184 const PreInterpHook& pre_interp = {},
185 const PostInterpHook& post_interp = {});
224 template <FabArrayType MF,
typename BC,
typename Interp,
225 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
226 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
229 const Vector<MF*>& cmf,
const Vector<Real>& ct,
230 const Vector<MF*>& fmf,
const Vector<Real>& ft,
231 int scomp,
int dcomp,
int ncomp,
232 const Geometry& cgeom,
const Geometry& fgeom,
233 BC& cbc,
int cbccomp,
234 BC& fbc,
int fbccomp,
237 const Vector<BCRec>& bcs,
int bcscomp,
238 const PreInterpHook& pre_interp = {},
239 const PostInterpHook& post_interp = {});
282 template <FabArrayType MF,
typename BC,
typename Interp,
283 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
284 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
287 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
288 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
289 int scomp,
int dcomp,
int ncomp,
290 const Geometry& cgeom,
const Geometry& fgeom,
291 Array<BC, AMREX_SPACEDIM>& cbc,
const Array<int, AMREX_SPACEDIM>& cbccomp,
292 Array<BC, AMREX_SPACEDIM>& fbc,
const Array<int, AMREX_SPACEDIM>& fbccomp,
295 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
const Array<int, AMREX_SPACEDIM>& bcscomp,
296 const PreInterpHook& pre_interp = {},
297 const PostInterpHook& post_interp = {});
340 template <FabArrayType MF,
typename BC,
typename Interp,
341 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
342 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
345 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
346 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
347 int scomp,
int dcomp,
int ncomp,
348 const Geometry& cgeom,
const Geometry& fgeom,
349 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
350 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
353 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
354 const PreInterpHook& pre_interp = {},
355 const PostInterpHook& post_interp = {});
397 template <FabArrayType MF,
typename BC,
typename Interp,
398 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
399 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
402 const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf,
const Vector<Real>& ct,
403 const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf,
const Vector<Real>& ft,
404 int scomp,
int dcomp,
int ncomp,
405 const Geometry& cgeom,
const Geometry& fgeom,
406 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
407 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
410 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
411 const PreInterpHook& pre_interp = {},
412 const PostInterpHook& post_interp = {});
454 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
457 const EB2::IndexSpace& index_space,
458 const Vector<MF*>& cmf,
const Vector<Real>& ct,
459 const Vector<MF*>& fmf,
const Vector<Real>& ft,
460 int scomp,
int dcomp,
int ncomp,
461 const Geometry& cgeom,
const Geometry& fgeom,
462 BC& cbc,
int cbccomp,
463 BC& fbc,
int fbccomp,
466 const Vector<BCRec>& bcs,
int bcscomp,
467 const PreInterpHook& pre_interp,
468 const PostInterpHook& post_interp);
508 template <FabArrayType MF,
typename BC,
typename Interp,
typename PreInterpHook,
typename PostInterpHook>
511 const EB2::IndexSpace& index_space,
512 const Vector<MF*>& cmf,
const Vector<Real>& ct,
513 const Vector<MF*>& fmf,
const Vector<Real>& ft,
514 int scomp,
int dcomp,
int ncomp,
515 const Geometry& cgeom,
const Geometry& fgeom,
516 BC& cbc,
int cbccomp,
517 BC& fbc,
int fbccomp,
520 const Vector<BCRec>& bcs,
int bcscomp,
521 const PreInterpHook& pre_interp,
522 const PostInterpHook& post_interp);
555 template <FabArrayType MF,
typename BC,
typename Interp,
556 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
557 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
560 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
561 const Geometry& cgeom,
const Geometry& fgeom,
562 BC& cbc,
int cbccomp,
563 BC& fbc,
int fbccomp,
566 const Vector<BCRec>& bcs,
int bcscomp,
567 const PreInterpHook& pre_interp = {},
568 const PostInterpHook& post_interp = {});
599 template <FabArrayType MF,
typename BC,
typename Interp,
600 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
601 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
604 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
605 const Geometry& cgeom,
const Geometry& fgeom,
606 BC& cbc,
int cbccomp,
607 BC& fbc,
int fbccomp,
610 const Vector<BCRec>& bcs,
int bcscomp,
611 const PreInterpHook& pre_interp = {},
612 const PostInterpHook& post_interp = {});
644 template <FabArrayType MF,
typename BC,
typename Interp,
645 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
646 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
649 const EB2::IndexSpace* index_space,
650 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
651 const Geometry& cgeom,
const Geometry& fgeom,
652 BC& cbc,
int cbccomp,
653 BC& fbc,
int fbccomp,
656 const Vector<BCRec>& bcs,
int bcscomp,
657 const PreInterpHook& pre_interp = {},
658 const PostInterpHook& post_interp = {});
690 template <FabArrayType MF,
typename BC,
typename Interp,
691 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
692 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
695 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
696 const Geometry& cgeom,
const Geometry& fgeom,
697 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
698 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
701 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
702 const PreInterpHook& pre_interp = {},
703 const PostInterpHook& post_interp = {});
736 template <FabArrayType MF,
typename BC,
typename Interp,
737 typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
738 typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
741 const Array<MF*, AMREX_SPACEDIM>& cmf,
int scomp,
int dcomp,
int ncomp,
742 const Geometry& cgeom,
const Geometry& fgeom,
743 Array<BC, AMREX_SPACEDIM>& cbc,
int cbccomp,
744 Array<BC, AMREX_SPACEDIM>& fbc,
int fbccomp,
747 const Array<Vector<BCRec>, AMREX_SPACEDIM>& bcs,
int bcscomp,
748 const PreInterpHook& pre_interp = {},
749 const PostInterpHook& post_interp = {});
777 template <FabArrayType MF,
typename Interp>
780 IntVect const& nghost_outside_domain,
781 const MF& cmf,
int scomp,
int dcomp,
int ncomp,
782 const Geometry& cgeom,
const Geometry& fgeom,
783 const IntVect& ratio, Interp* mapper,
784 const Vector<BCRec>& bcs,
int bcscomp);
808 template <FabArrayType MF>
811 const Vector<MF*>& smf,
IntVect const& snghost,
812 const Vector<Real>& stime,
int scomp,
int dcomp,
int ncomp,
813 const Geometry& geom);
845 template <FabArrayType MF,
typename Interp>
849 const Vector<MF*>& cmf,
const Vector<Real>& ct,
850 const Vector<MF*>& fmf,
const Vector<Real>& ft,
851 int scomp,
int dcomp,
int ncomp,
852 const Geometry& cgeom,
const Geometry& fgeom,
853 const IntVect& ratio, Interp* mapper,
854 const Vector<BCRec>& bcs,
int bcscomp);
860 const Array<MultiFab,AMREX_SPACEDIM>&
crse,
861 Array<MultiFab,AMREX_SPACEDIM>&
fine,
862 const Geometry& cgeom,
const Geometry& fgeom,
866 const Array<MultiFab const*,AMREX_SPACEDIM>&
crse,
867 const Array<MultiFab*,AMREX_SPACEDIM>&
fine,
868 const Geometry& cgeom,
const Geometry& fgeom,
910 template <FabArrayType MF,
typename BC,
typename Interp>
913 const Vector<Vector<MF*>>& smf,
const Vector<Vector<Real>>& st,
914 int scomp,
int dcomp,
int ncomp,
915 const Vector<Geometry>& geom,
916 Vector<BC>& bc,
int bccomp,
917 const Vector<IntVect>& ratio,
919 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).
Checks if a type is derived from amrex::BaseFab.
Definition AMReX_Concepts.H:13
Checks if a type is an amrex::FabArray.
Definition AMReX_Concepts.H:19
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:50
InterpEM_t
Definition AMReX_FillPatchUtil.H:857
@ InterpB
Definition AMReX_FillPatchUtil.H:857
@ InterpE
Definition AMReX_FillPatchUtil.H:857
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
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
void FillPatchSingleLevel(MF &mf, IntVect const &nghost, Real time, const Vector< MF * > &smf, const Vector< Real > &stime, int scomp, int dcomp, int ncomp, const Geometry &geom, BC &physbcf, int bcfcomp)
FillPatch with data from the current level.
Definition AMReX_FillPatchUtil_I.H:75
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:33
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:979
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:791
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:1337
Definition AMReX_FillPatchUtil.H:39
void operator()(MFFAB &, const Box &, int, int) const
Definition AMReX_FillPatchUtil.H:40
void operator()(Array< MFFAB *, 3 >, const Box &, int, int) const
Definition AMReX_FillPatchUtil.H:44
void operator()(MFFAB &, int, int) const
Definition AMReX_FillPatchUtil.H:48