Skip to content
Draft
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
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ HeaderFilterRegex: '([^n].....|[^o]....|[^l]...|[^i]..|[^n].|[^t])\.H$'
# Only available in clang-tidy >= 17
HeaderFileExtensions: ['', "H", 'h', 'hh', 'hpp', 'hxx']

# We will try to modernize this after switching to C++20
# -modernize-use-constraints
# -modernize-use-designated-initializers
# -modernize-use-std-numbers
# -modernize-use-ranges
Expand Down
3 changes: 2 additions & 1 deletion Src/AmrCore/AMReX_AmrParticles.H
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssig
* \param zero_out_input Whether to zero the MultiFabs before depositing.
* \param vol_weight Whether to divide by cell volume after deposition.
*/
template <class PC, class F, std::enable_if_t<IsParticleContainer<PC>::value, int> foo = 0>
template <class PC, class F>
requires IsParticleContainer<PC>::value
void
ParticleToMesh (PC const& pc, const Vector<MultiFab*>& mf,
int lev_min, int lev_max, F&& f,
Expand Down
63 changes: 42 additions & 21 deletions Src/AmrCore/AMReX_FillPatchUtil.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ namespace amrex
template <typename MFFAB>
struct NullInterpHook
{
template <class F=MFFAB, std::enable_if_t<IsBaseFab<F>::value,int> = 0>
template <class F=MFFAB>
requires IsBaseFab<F>::value
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 <class F=MFFAB>
requires IsBaseFab<F>::value
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 <class F=MFFAB>
requires IsFabArray<F>::value
void operator() (MFFAB& /*mf*/, int /*icomp*/, int /*ncomp*/) const {}
};

Expand Down Expand Up @@ -88,7 +91,8 @@ namespace amrex
* \param bcfcomp starting component for physbcf
*/
template <typename MF, typename BC>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
FillPatchSingleLevel (MF& mf, IntVect const& nghost, Real time,
const Vector<MF*>& smf, const Vector<Real>& stime,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -119,7 +123,8 @@ namespace amrex
* \param bcfcomp starting component for physbcf
*/
template <typename MF, typename BC>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
FillPatchSingleLevel (MF& mf, Real time,
const Vector<MF*>& smf, const Vector<Real>& stime,
int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -167,7 +172,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -221,7 +227,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
void
FillPatchTwoLevels (MF& mf, Real time,
const Vector<MF*>& cmf, const Vector<Real>& ct,
const Vector<MF*>& fmf, const Vector<Real>& ft,
Expand Down Expand Up @@ -279,7 +286,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -337,7 +345,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -394,7 +403,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -449,7 +459,8 @@ namespace amrex
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
FillPatchTwoLevels (MF& mf, IntVect const& nghost, Real time,
const EB2::IndexSpace& index_space,
const Vector<MF*>& cmf, const Vector<Real>& ct,
Expand Down Expand Up @@ -503,7 +514,8 @@ namespace amrex
* \param post_interp post-interpolation hook
*/
template <typename MF, typename BC, typename Interp, typename PreInterpHook, typename PostInterpHook>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
FillPatchTwoLevels (MF& mf, Real time,
const EB2::IndexSpace& index_space,
const Vector<MF*>& cmf, const Vector<Real>& ct,
Expand Down Expand Up @@ -552,7 +564,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
void
InterpFromCoarseLevel (MF& mf, Real time,
const MF& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Expand Down Expand Up @@ -596,7 +609,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
void
InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
const MF& cmf, int scomp, int dcomp, int ncomp,
const Geometry& cgeom, const Geometry& fgeom,
Expand Down Expand Up @@ -641,7 +655,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
void
InterpFromCoarseLevel (MF& mf, IntVect const& nghost, Real time,
const EB2::IndexSpace* index_space,
const MF& cmf, int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -687,7 +702,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -733,7 +749,8 @@ namespace amrex
template <typename 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>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -772,7 +789,8 @@ namespace amrex
* \param bcscomp starting component for bcs
*/
template <typename MF, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
InterpFromCoarseLevel (MF& mf, IntVect const& nghost,
IntVect const& nghost_outside_domain,
const MF& cmf, int scomp, int dcomp, int ncomp,
Expand Down Expand Up @@ -803,7 +821,8 @@ namespace amrex
* \param geom Geometry for this level
*/
template <typename MF>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
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,
Expand Down Expand Up @@ -840,7 +859,8 @@ namespace amrex
* \param bcscomp starting component for bcs
*/
template <typename MF, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
void
FillPatchTwoLevels (MF& mf, IntVect const& nghost,
IntVect const& nghost_outside_domain, Real time,
const Vector<MF*>& cmf, const Vector<Real>& ct,
Expand Down Expand Up @@ -905,7 +925,8 @@ namespace amrex
* \param bcrcomp starting component for bcr
*/
template <typename MF, typename BC, typename Interp>
std::enable_if_t<IsFabArray<MF>::value>
requires IsFabArray<MF>::value
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,
Expand Down
Loading
Loading