9 #ifndef WARPX_SMART_UTILS_H_
10 #define WARPX_SMART_UTILS_H_
14 #include <AMReX_Config.H>
26 using NameMap = std::map<std::string, int>;
35 [[nodiscard]]
int size () const noexcept {
return static_cast<int>(
common_names.size()); }
51 template <
typename PTile>
56 #pragma omp critical (ionization_nextid)
59 pid = PTile::ParticleType::NextID();
60 PTile::ParticleType::NextID(pid + num_added);
64 auto ptd = ptile.getParticleTileData();
67 auto const lip =
static_cast<amrex::Long
>(ip);
68 auto const new_id = lip + old_size;
std::map< std::string, int > NameMap
Definition: SmartUtils.H:26
PolicyVec getPolicies(const NameMap &names) noexcept
Definition: SmartUtils.cpp:16
void setNewParticleIDs(PTile &ptile, amrex::Long old_size, amrex::Long num_added)
Sets the ids of newly created particles to the next values.
Definition: SmartUtils.H:52
SmartCopyTag getSmartCopyTag(const NameMap &src, const NameMap &dst) noexcept
Definition: SmartUtils.cpp:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint64_t SetParticleIDandCPU(Long id, int cpu) noexcept
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... >, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
Definition: SmartUtils.H:30
amrex::Gpu::DeviceVector< int > dst_comps
Definition: SmartUtils.H:33
int size() const noexcept
Definition: SmartUtils.H:35
amrex::Gpu::DeviceVector< int > src_comps
Definition: SmartUtils.H:32
std::vector< std::string > common_names
Definition: SmartUtils.H:31