Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_MakeParticle.H
Go to the documentation of this file.
1#ifndef AMREX_MAKEPARTICLE_H_
2#define AMREX_MAKEPARTICLE_H_
3
4#include <type_traits>
5
6namespace amrex {
7
8template< class T >
10 : std::integral_constant<
11 bool,
12 T::is_soa_particle
13 > {};
14
15
16template <typename T_ParticleType>
18{
19 template <typename PTD>
21 auto&
22 operator() (PTD const& ptd, int i)
23 {
24 // legacy Particle (AoS)
25 return ptd.m_aos[i];
26 }
27};
28
29template <typename T_ParticleType>
30requires (is_soa_particle<T_ParticleType>::value)
32{
33 template <typename PTD>
35 auto
36 operator() (PTD const& ptd, int index)
37 {
38 // SoAParticle
39 return T_ParticleType(ptd, index);
40 }
41};
42
43}
44
45#endif
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Definition AMReX_Amr.cpp:50
Definition AMReX_MakeParticle.H:13
Definition AMReX_MakeParticle.H:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto & operator()(PTD const &ptd, int i)
Definition AMReX_MakeParticle.H:22