Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 40 additions & 58 deletions Src/AmrCore/AMReX_FillPatchUtil.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <AMReX_MFInterpolater.H>
#include <AMReX_Array.H>
#include <AMReX_Utility.H>

#include <AMReX_Concepts.H>
/**
* \file AMReX_FillPatchUtil.H
* \brief High-level FillPatch helpers for AMR coarse-to-fine synchronization.
Expand All @@ -37,13 +37,13 @@ namespace amrex
template <typename MFFAB>
struct NullInterpHook
{
template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,int> = 0>
template <BaseFabType T = MFFAB>
void operator() (MFFAB& /*fab*/, const Box& /*bx*/, int /*icomp*/, int /*ncomp*/) const {}

template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,int> = 0>
template <BaseFabType T = MFFAB>
void operator() (Array<MFFAB*, AMREX_SPACEDIM> /*fab*/, const Box& /*bx*/, int /*icomp*/, int /*ncomp*/) const {}

template <class F=MFFAB, std::enable_if_t<IsFabArray<F>::value,int> = 0>
template <FabArrayType T = MFFAB>
void operator() (MFFAB& /*mf*/, int /*icomp*/, int /*ncomp*/) const {}
};

Expand Down Expand Up @@ -87,9 +87,8 @@ namespace amrex
* \param physbcf functor for physical boundaries
* \param bcfcomp starting component for physbcf
*/
template <typename MF, typename BC>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchSingleLevel (MF& mf, IntVect const& nghost, Real time,
template <FabArrayType MF, typename BC>
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,
Expand Down Expand Up @@ -118,9 +117,8 @@ namespace amrex
* \param physbcf functor for physical boundaries
* \param bcfcomp starting component for physbcf
*/
template <typename MF, typename BC>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchSingleLevel (MF& mf, Real time,
template <FabArrayType MF, typename BC>
void FillPatchSingleLevel (MF& mf, Real time,
const Vector<MF*>& smf, const Vector<Real>& stime,
int scomp, int dcomp, int ncomp,
const Geometry& geom,
Expand Down Expand Up @@ -164,11 +162,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (MF& mf, IntVect const& nghost, Real time,
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,
Expand Down Expand Up @@ -218,11 +215,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (MF& mf, Real time,
void FillPatchTwoLevels (MF& mf, Real time,
const Vector<MF*>& cmf, const Vector<Real>& ct,
const Vector<MF*>& fmf, const Vector<Real>& ft,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -276,11 +272,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
void FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf, const Vector<Real>& ct,
const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf, const Vector<Real>& ft,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -334,11 +329,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
void FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf, const Vector<Real>& ct,
const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf, const Vector<Real>& ft,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -391,11 +385,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, Real time,
void FillPatchTwoLevels (Array<MF*, AMREX_SPACEDIM> const& mf, Real time,
const Vector<Array<MF*, AMREX_SPACEDIM> >& cmf, const Vector<Real>& ct,
const Vector<Array<MF*, AMREX_SPACEDIM> >& fmf, const Vector<Real>& ft,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -448,9 +441,8 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (MF& mf, IntVect const& nghost, Real time,
template <FabArrayType MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
void FillPatchTwoLevels (MF& mf, IntVect const& nghost, Real time,
const EB2::IndexSpace& index_space,
const Vector<MF*>& cmf, const Vector<Real>& ct,
const Vector<MF*>& fmf, const Vector<Real>& ft,
Expand Down Expand Up @@ -502,9 +494,8 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (MF& mf, Real time,
template <FabArrayType MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
void FillPatchTwoLevels (MF& mf, Real time,
const EB2::IndexSpace& index_space,
const Vector<MF*>& cmf, const Vector<Real>& ct,
const Vector<MF*>& fmf, const Vector<Real>& ft,
Expand Down Expand Up @@ -549,11 +540,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (MF& mf, Real time,
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,
Expand Down Expand Up @@ -593,11 +583,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
void InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
const MF& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
BC& cbc, int cbccomp,
Expand Down Expand Up @@ -638,11 +627,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
void InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
const EB2::IndexSpace* index_space,
const MF& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Expand Down Expand Up @@ -684,11 +672,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (Array<MF*, AMREX_SPACEDIM> const& mf, Real time,
void InterpFromCoarseLevel (Array<MF*, AMREX_SPACEDIM> const& mf, Real time,
const Array<MF*, AMREX_SPACEDIM>& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Array<BC, AMREX_SPACEDIM>& cbc, int cbccomp,
Expand Down Expand Up @@ -730,11 +717,10 @@ namespace amrex
* \param pre_interp pre-interpolation hook
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp,
template <FabArrayType MF, typename BC, typename Interp,
typename PreInterpHook=NullInterpHook<typename MF::FABType::value_type>,
typename PostInterpHook=NullInterpHook<typename MF::FABType::value_type> >
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
void InterpFromCoarseLevel (Array<MF*, AMREX_SPACEDIM> const& mf, IntVect const& nghost, Real time,
const Array<MF*, AMREX_SPACEDIM>& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Array<BC, AMREX_SPACEDIM>& cbc, int cbccomp,
Expand Down Expand Up @@ -771,9 +757,8 @@ namespace amrex
* \param bcs boundar types for each component
* \param bcscomp starting component for bcs
*/
template <typename MF, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
InterpFromCoarseLevel (MF& mf, IntVect const& nghost,
template <FabArrayType MF, typename Interp>
void InterpFromCoarseLevel (MF& mf, IntVect const& nghost,
IntVect const& nghost_outside_domain,
const MF& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Expand Down Expand Up @@ -802,9 +787,8 @@ namespace amrex
* \param ncomp number of components
* \param geom Geometry for this level
*/
template <typename MF>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchSingleLevel (MF& mf, IntVect const& nghost, Real time,
template <FabArrayType MF>
void FillPatchSingleLevel (MF& mf, IntVect const& nghost, Real time,
const Vector<MF*>& smf, IntVect const& snghost,
const Vector<Real>& stime, int scomp, int dcomp, int ncomp,
const Geometry& geom);
Expand Down Expand Up @@ -839,9 +823,8 @@ namespace amrex
* \param bcs boundary types for each component.
* \param bcscomp starting component for bcs
*/
template <typename MF, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchTwoLevels (MF& mf, IntVect const& nghost,
template <FabArrayType MF, typename Interp>
void FillPatchTwoLevels (MF& mf, IntVect const& nghost,
IntVect const& nghost_outside_domain, Real time,
const Vector<MF*>& cmf, const Vector<Real>& ct,
const Vector<MF*>& fmf, const Vector<Real>& ft,
Expand Down Expand Up @@ -904,9 +887,8 @@ namespace amrex
* \param bcr boundary types for each component. We need this because some interpolaters need it.
* \param bcrcomp starting component for bcr
*/
template <typename MF, typename BC, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
FillPatchNLevels (MF& mf, int level, const IntVect& nghost, Real time,
template <FabArrayType MF, typename BC, typename Interp>
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,
Expand Down
Loading
Loading