Block-Structured AMR Software Framework
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
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
6
namespace
amrex
{
7
8
template
<
class
T >
9
struct
is_soa_particle
10
: std::integral_constant<
11
bool,
12
T::is_soa_particle
13
> {};
14
15
16
template
<
typename
T_ParticleType,
class
Enable =
void
>
17
struct
make_particle
18
{
19
template
<
typename
PTD>
20
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
21
auto
&
22
operator()
(PTD
const
& ptd,
int
i)
23
{
24
// legacy Particle (AoS)
25
return
ptd.m_aos[i];
26
}
27
};
28
29
template
<
typename
T_ParticleType>
30
struct
make_particle
<T_ParticleType, std::enable_if_t<is_soa_particle<T_ParticleType>::value>>
31
{
32
template
<
typename
PTD>
33
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
34
auto
35
operator()
(PTD
const
& ptd,
int
index)
36
{
37
// SoAParticle
38
return
T_ParticleType(ptd, index);
39
}
40
};
41
42
}
43
44
#endif
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
Definition
AMReX_Extension.H:119
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
Definition
AMReX_GpuQualifiers.H:20
amrex
Definition
AMReX_Amr.cpp:49
amrex::is_soa_particle
Definition
AMReX_MakeParticle.H:13
amrex::make_particle
Definition
AMReX_MakeParticle.H:18
amrex::make_particle::operator()
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto & operator()(PTD const &ptd, int i)
Definition
AMReX_MakeParticle.H:22
Src
Particle
AMReX_MakeParticle.H
Generated by
1.9.8