Skip to content

Commit

Permalink
ParticleLocator: Make Assignor optional template parameter
Browse files Browse the repository at this point in the history
So that it is backward compatible.
  • Loading branch information
WeiqunZhang committed Aug 25, 2023
1 parent bad61ac commit ca4963a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Src/Particle/AMReX_ParticleLocator.H
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ struct AssignGrid
m_num_bins.z = amrex::max(m_num_bins.z, 1);
}

template <typename P, typename Assignor>
template <typename P, typename Assignor = DefaultAssignor>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
int operator() (const P& p, int nGrow=0, Assignor&& assignor = DefaultAssignor{}) const noexcept
int operator() (const P& p, int nGrow=0, Assignor&& assignor = Assignor{}) const noexcept
{
const auto iv = assignor(p, m_plo, m_dxi, m_domain);
return this->operator()(iv, nGrow);
Expand Down Expand Up @@ -210,10 +210,10 @@ struct AmrAssignGrid
: m_funcs(a_funcs), m_size(a_size)
{}

template <typename P, typename Assignor>
template <typename P, typename Assignor = DefaultAssignor>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
GpuTuple<int, int> operator() (const P& p, int lev_min=-1, int lev_max=-1, int nGrow=0,
Assignor&& assignor = DefaultAssignor{}) const noexcept
Assignor&& assignor = {}) const noexcept
{
lev_min = (lev_min == -1) ? 0 : lev_min;
lev_max = (lev_max == -1) ? m_size - 1 : lev_max;
Expand Down

0 comments on commit ca4963a

Please sign in to comment.