Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_Particle.H
Go to the documentation of this file.
1#ifndef AMREX_PARTICLE_H_
2#define AMREX_PARTICLE_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_FArrayBox.H>
6#include <AMReX_Geometry.H>
7#include <AMReX_IntVect.H>
8#include <AMReX_ParmParse.H>
9#include <AMReX_REAL.H>
10#include <AMReX_RealVect.H>
11
12#include <type_traits>
13
14
15namespace amrex {
16
18 namespace LongParticleIds {
19 constexpr Long GhostParticleID = 549755813887L; // 2**39-1
24 }
25
26 using namespace LongParticleIds;
27
31 namespace ParticleIdCpus {
32 constexpr std::uint64_t Invalid = 16777216; // corresponds to id = -1, cpu = 0
33 }
34
35 using namespace ParticleIdCpus;
36
37 namespace particle_impl {
38
40 Long unpack_id (const uint64_t idcpu) noexcept {
41 Long r = 0;
42
43 uint64_t sign = idcpu >> 63; // extract leftmost sign bit
44 uint64_t val = ((idcpu >> 24) & 0x7FFFFFFFFF); // extract next 39 id bits
45
46 Long lval = static_cast<Long>(val); // bc we take -
47 r = (sign) ? lval : -lval;
48 return r;
49 }
50
52 int unpack_cpu (const uint64_t idcpu) noexcept {
53 return static_cast<int>(idcpu & 0x00FFFFFF);
54 }
55
57 void pack_id (uint64_t& idcpu, const Long id) noexcept {
58 // zero out the 40 leftmost bits, which store the sign and the abs of the id;
59 idcpu &= 0x00FFFFFF;
60
61 uint64_t val;
62 uint64_t sign = id >= 0;
63 if (sign)
64 {
65 // 2**39-1, the max value representable in this fashion
66 AMREX_ASSERT(id <= 549755813887L);
67 val = id;
68 }
69 else
70 {
71 // -2**39-1, the min value representable in this fashion
72 AMREX_ASSERT(id >= -549755813887L);
73 val = -id;
74 }
75
76 (idcpu) |= (sign << 63); // put the sign in the leftmost bit
77 (idcpu) |= (val << 24); // put the val in the next 39
78 }
79
81 void pack_cpu (uint64_t& idcpu, const int cpu) noexcept {
82 // zero out the first 24 bits, which are used to store the cpu number
83 idcpu &= (~ 0x00FFFFFF);
84
85 AMREX_ASSERT(cpu >= 0);
86 AMREX_ASSERT(cpu <= 16777215); // 2**24-1, the max representable number
87
88 idcpu |= cpu;
89 }
90
92 void make_invalid (uint64_t& idcpu) noexcept {
93 // RHS mask: 0111...
94 idcpu &= ~(uint64_t(1) << 63);
95 }
96
97 template<typename T_SIMD, typename T_Mask>
99 void make_invalid (T_SIMD & idcpu, T_Mask const & mask) noexcept {
100 // RHS mask: 0111...
101 if constexpr (std::is_same_v<T_Mask, bool>) {
102 // scalar
103 static_assert(std::is_same_v<T_SIMD, uint64_t>, "make_invalid: forgot template on wrapper?");
104 if (mask) { make_invalid(idcpu); }
105 } else {
106#ifdef AMREX_USE_SIMD
107 // SIMD
108 static_assert(!std::is_same_v<T_SIMD, uint64_t>, "make_invalid: forgot template on wrapper?");
109 // cvt / .__cvt() because of: https://github.com/VcDevel/std-simd/issues/41#issuecomment-3185164952
110 // see also https://github.com/mattkretz/vir-simd/issues/45
111 simd::stdx::where(simd::stdx::cvt(mask), idcpu) &= ~(T_SIMD{1} << 63);
112#else
113 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(false, "make_invalid: AMReX_SIMD was not enabled!");
114#endif
115 }
116 }
117
119 void make_valid (uint64_t& idcpu) noexcept {
120 // RHS mask: 1000...
121 idcpu |= uint64_t(1) << 63;
122 }
123
124 template<typename T_SIMD, typename T_Mask>
126 void make_valid (T_SIMD & idcpu, T_Mask const & mask) noexcept {
127 // RHS mask: 1000...
128 if constexpr (std::is_same_v<T_Mask, bool>) {
129 // scalar
130 static_assert(std::is_same_v<T_SIMD, uint64_t>, "make_valid: forgot template on wrapper?");
131 if (mask) { make_valid(idcpu); }
132 } else {
133#ifdef AMREX_USE_SIMD
134 // SIMD
135 static_assert(!std::is_same_v<T_SIMD, uint64_t>, "make_valid: forgot template on wrapper?");
136 // cvt / .__cvt() because of: https://github.com/VcDevel/std-simd/issues/41#issuecomment-3185164952
137 // see also https://github.com/mattkretz/vir-simd/issues/45
138 simd::stdx::where(simd::stdx::cvt(mask), idcpu) |= T_SIMD{1} << 63;
139#else
140 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(false, "make_valid: AMReX_SIMD was not enabled!");
141#endif
142 }
143 }
144
146 bool is_valid (const uint64_t idcpu) noexcept {
147 // the leftmost bit is our id's valid sign
148 return idcpu >> 63;
149 }
150 } // namespace particle_impl
151
152template<typename T = uint64_t>
154{
155 /*
156 static_assert(std::is_same_v<T, uint64_t> ||
157 std::is_same_v<T, simd::SIMDIdCpu<>>, // note: this one will not work because users can change the SIMDIdCpu width
158 "ParticleIDWrapper only supports uint64_t or SIMD thereof"
159 );
160 */
161
163
164 ~ParticleIDWrapper () noexcept = default;
165
167 ParticleIDWrapper (T& idata) noexcept
168 : m_idata(&idata)
169 {}
170
172 ParticleIDWrapper (const ParticleIDWrapper& rhs) = default;
173
175
178 {
179 return this->operator=(Long(pidw)); // NOLINT
180 }
181
184 {
185 return this->operator=(Long(pidw)); // NOLINT
186 }
187
190 {
192 return *this;
193 }
194
196 operator Long () const noexcept
197 {
199 }
200
207 void make_invalid () const noexcept
208 {
210 }
211
217 template<typename T_Bool>
219 void make_invalid (T_Bool const & mask) const noexcept
220 {
222 }
223
230 void make_valid () const noexcept
231 {
233 }
234
240 template<typename T_Bool>
242 void make_valid (T_Bool const & mask) const noexcept
243 {
245 }
246
252 bool is_valid () const noexcept
253 {
255 }
256};
257
259{
260 uint64_t* m_idata;
261
262 ~ParticleCPUWrapper () noexcept = default;
263
265 ParticleCPUWrapper (uint64_t& idata) noexcept
266 : m_idata(&idata)
267 {}
268
271
273
276 {
277 return this->operator=(int(pcpuw)); // NOLINT
278 }
279
282 {
283 return this->operator=(int(pcpuw)); // NOLINT
284 }
285
287 ParticleCPUWrapper& operator= (const int cpu) noexcept
288 {
290 return *this;
291 }
292
294 operator int () const noexcept
295 {
297 }
298};
299
301{
302 const uint64_t* m_idata;
303
305 ConstParticleIDWrapper (const uint64_t& idata) noexcept
306 : m_idata(&idata)
307 {}
308
310 operator Long () const noexcept
311 {
313 }
314
320 bool is_valid () const noexcept
321 {
323 }
324};
325
327{
328 const uint64_t* m_idata;
329
331 ConstParticleCPUWrapper (const uint64_t& idata) noexcept
332 : m_idata(&idata)
333 {}
334
336 operator int () const noexcept {
338 }
339};
340
347std::uint64_t SetParticleIDandCPU (Long id, int cpu) noexcept{
348 std::uint64_t idcpu = 0;
349 ParticleIDWrapper{idcpu} = id;
350 ParticleCPUWrapper{idcpu} = cpu;
351 return idcpu;
352}
353
354template <typename T, int NReal, int NInt>
356{
357 T m_pos[AMREX_SPACEDIM];
358 T m_rdata[NReal];
359 uint64_t m_idcpu = 0;
360 int m_idata[NInt];
361};
362
363template <typename T, int NInt>
364struct ParticleBase<T,0,NInt>
365{
366 T m_pos[AMREX_SPACEDIM];
367 uint64_t m_idcpu = 0;
368 int m_idata[NInt];
369};
370
371template <typename T, int NReal>
372struct ParticleBase<T,NReal,0>
373{
374 T m_pos[AMREX_SPACEDIM];
375 T m_rdata[NReal];
376 uint64_t m_idcpu = 0;
377};
378
379template <typename T>
380struct ParticleBase<T,0,0>
381{
382 T m_pos[AMREX_SPACEDIM];
383 uint64_t m_idcpu = 0;
384};
385
386
388{
389 static constexpr int NReal=0;
390 static constexpr int NInt=0;
391 static constexpr bool is_soa_particle = true;
392 static constexpr bool is_rtsoa_particle = false;
393};
394
402template <int T_NReal, int T_NInt=0>
403struct alignas(sizeof(double)) Particle
404 : ParticleBase<ParticleReal,T_NReal,T_NInt>
405{
406 static constexpr bool is_soa_particle = false;
407 static constexpr bool is_rtsoa_particle = false;
409 using ConstType = Particle const;
410
412 static constexpr int NReal = T_NReal;
413
415 static constexpr int NInt = T_NInt;
416
419 using IntType = int;
420
422
425
428
431
434
436 void atomicSetID (const Long id) {
437 uint64_t tmp = 0;
438 ParticleIDWrapper wrapper(tmp);
439 wrapper = id;
440#if defined(AMREX_USE_OMP)
441#pragma omp atomic write
442 this->m_idcpu = *(wrapper.m_idata);
443#else
444 auto *old_ptr = reinterpret_cast<unsigned long long*>(&(this->m_idcpu));
445 amrex::Gpu::Atomic::Exch(old_ptr, (unsigned long long) (*wrapper.m_idata));
446#endif
447 }
448
450 uint64_t& idcpu () & { return this->m_idcpu; }
451
453 const uint64_t& idcpu () const & { return this->m_idcpu; }
454
456 RealVect pos () const & {return RealVect(AMREX_D_DECL(this->m_pos[0], this->m_pos[1], this->m_pos[2]));}
457
459 RealType& pos (int index) &
460 {
461 AMREX_ASSERT(index < AMREX_SPACEDIM);
462 return this->m_pos[index];
463 }
464
466 RealType pos (int index) const &
467 {
468 AMREX_ASSERT(index < AMREX_SPACEDIM);
469 return this->m_pos[index];
470 }
471
473 RealType& rdata (int index) & requires (NReal != 0)
474 {
475 AMREX_ASSERT(index < NReal);
476 return this->m_rdata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
477 }
478
480 RealType& rdata (int /*index*/) & requires (NReal == 0)
481 {
482 AMREX_ALWAYS_ASSERT(false);
483 return this->pos(0); // bc we must return something
484 }
485
487 const RealType& rdata (int index) const & requires (NReal != 0)
488 {
489 AMREX_ASSERT(index < NReal);
490 return this->m_rdata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
491 }
492
494 RealType rdata (int /*index*/) const & requires (NReal == 0)
495 {
496 AMREX_ALWAYS_ASSERT(false);
497 return this->pos(0); // because we must return something
498 }
499
501 RealType rdata (int /*index*/) && = delete;
502
504 RealVect rvec (AMREX_D_DECL(int indx, int indy, int indz)) const &
505 requires (NReal != 0)
506 {
507 AMREX_ASSERT(AMREX_D_TERM(indx < NReal, && indy < NReal, && indz < NReal));
508 return RealVect(AMREX_D_DECL(this->m_rdata[indx],
509 this->m_rdata[indy],
510 this->m_rdata[indz]));
511 }
512
514 RealVect rvec (AMREX_D_DECL(int /*indx*/, int /*indy*/, int /*indz*/)) const &
515 requires (NReal == 0)
516 {
517 AMREX_ALWAYS_ASSERT(false);
518 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
519 }
520
522 RealVect rvec (const IntVect& indices) const & requires (NReal != 0)
523 {
524 AMREX_ASSERT(indices.allLT(NReal));
525 return RealVect(AMREX_D_DECL(this->m_rdata[indices[0]],
526 this->m_rdata[indices[1]],
527 this->m_rdata[indices[2]]));
528 }
529
531 RealVect rvec (const IntVect& /*indices*/) const & requires (NReal == 0)
532 {
533 AMREX_ALWAYS_ASSERT(false);
534 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
535 }
536
538 int& idata (int index) & requires (NInt != 0)
539 {
540 AMREX_ASSERT(index < NInt);
541 return this->m_idata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
542 }
543
545 uint64_t& idata (int /*index*/) & requires (NInt == 0)
546 {
547 AMREX_ALWAYS_ASSERT(false);
548 return this->m_idcpu; //bc we must return something
549 }
550
552 const int& idata (int index) const & requires (NInt != 0)
553 {
554 AMREX_ASSERT(index < NInt);
555 return this->m_idata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
556 }
557
559 int idata (int /*index*/) const & requires (NInt == 0)
560 {
561 AMREX_ALWAYS_ASSERT(false);
562 return this->m_idcpu; //bc we must return something
563 }
564
566 RealType idata (int /*index*/) && = delete;
567
576 [[nodiscard]] static Long NextID ();
577
581 [[nodiscard]] static Long UnprotectedNextID ();
582
588 static void NextID (Long nextid);
589};
590
591template <int NReal, int NInt> Long Particle<NReal, NInt>::the_next_id = 1;
592
593template <int NReal, int NInt>
594Long
596{
597 Long next;
598// we should be able to test on _OPENMP < 201107 for capture (version 3.1)
599// but we must work around a bug in gcc < 4.9
600#if defined(AMREX_USE_OMP) && defined(_OPENMP) && _OPENMP < 201307
601#pragma omp critical (amrex_particle_nextid)
602#elif defined(AMREX_USE_OMP)
603#pragma omp atomic capture
604#endif
605 next = the_next_id++;
606
608 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
609 }
610
611 return next;
612}
613
614template <int NReal, int NInt>
615Long
617{
618 Long next = the_next_id++;
620 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
621 }
622 return next;
623}
624
625template <int NReal, int NInt>
626void
628{
629 the_next_id = nextid;
630}
631
632template <int NReal, int NInt>
633std::ostream&
634operator<< (std::ostream& os, const Particle<NReal, NInt>& p)
635{
636 os << p.id() << ' '
637 << p.cpu() << ' ';
638
639 for (int i = 0; i < AMREX_SPACEDIM; i++) {
640 os << p.pos(i) << ' ';
641 }
642
643 for (int i = 0; i < NReal; i++) {
644 os << p.rdata(i) << ' ';
645 }
646
647 for (int i = 0; i < NInt; i++) {
648 os << p.idata(i) << ' ';
649 }
650
651 if (!os.good()) {
652 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
653 }
654
655 return os;
656}
657
658template <int NReal>
659std::ostream&
660operator<< (std::ostream& os, const Particle<NReal, 0>& p)
661{
662 os << p.id() << ' '
663 << p.cpu() << ' ';
664
665 for (int i = 0; i < AMREX_SPACEDIM; i++) {
666 os << p.pos(i) << ' ';
667 }
668
669 for (int i = 0; i < NReal; i++) {
670 os << p.rdata(i) << ' ';
671 }
672
673 if (!os.good()) {
674 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
675 }
676
677 return os;
678}
679
680template <int NInt>
681std::ostream&
682operator<< (std::ostream& os, const Particle<0, NInt>& p)
683{
684 os << p.id() << ' '
685 << p.cpu() << ' ';
686
687 for (int i = 0; i < AMREX_SPACEDIM; i++) {
688 os << p.pos(i) << ' ';
689 }
690
691 for (int i = 0; i < NInt; i++) {
692 os << p.idata(i) << ' ';
693 }
694
695 if (!os.good()) {
696 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
697 }
698
699 return os;
700}
701
702template <int NReal=0, int NInt=0>
703std::ostream&
704operator<< (std::ostream& os, const Particle<0, 0>& p)
705{
706 os << p.id() << ' '
707 << p.cpu() << ' ';
708
709 for (int i = 0; i < AMREX_SPACEDIM; i++) {
710 os << p.pos(i) << ' ';
711 }
712
713 if (!os.good()) {
714 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
715 }
716
717 return os;
718}
719
720} // namespace amrex
721
722#endif // AMREX_PARTICLE_H_
#define AMREX_ALWAYS_ASSERT_WITH_MESSAGE(EX, MSG)
Definition AMReX_BLassert.H:49
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
#define AMREX_ALWAYS_ASSERT(EX)
Definition AMReX_BLassert.H:50
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Array4< int const > mask
Definition AMReX_InterpFaceRegister.cpp:93
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
amrex_particle_real ParticleReal
Floating Point Type for Particles.
Definition AMReX_REAL.H:90
amrex_long Long
Definition AMReX_INT.H:30
__host__ __device__ AMREX_FORCE_INLINE T Exch(T *address, T val) noexcept
Definition AMReX_GpuAtomic.H:487
constexpr Long GhostParticleID
Definition AMReX_Particle.H:19
constexpr Long NoSplitParticleID
Definition AMReX_Particle.H:23
constexpr Long VirtualParticleID
Definition AMReX_Particle.H:20
constexpr Long DoSplitParticleID
Definition AMReX_Particle.H:22
constexpr Long LastParticleID
Definition AMReX_Particle.H:21
constexpr std::uint64_t Invalid
Definition AMReX_Particle.H:32
__host__ __device__ void pack_cpu(uint64_t &idcpu, const int cpu) noexcept
Definition AMReX_Particle.H:81
__host__ __device__ bool is_valid(const uint64_t idcpu) noexcept
Definition AMReX_Particle.H:146
__host__ __device__ void make_invalid(uint64_t &idcpu) noexcept
Definition AMReX_Particle.H:92
__host__ __device__ Long unpack_id(const uint64_t idcpu) noexcept
Definition AMReX_Particle.H:40
__host__ __device__ void make_valid(uint64_t &idcpu) noexcept
Definition AMReX_Particle.H:119
__host__ __device__ void pack_id(uint64_t &idcpu, const Long id) noexcept
Definition AMReX_Particle.H:57
__host__ __device__ int unpack_cpu(const uint64_t idcpu) noexcept
Definition AMReX_Particle.H:52
__host__ __device__ detail::where_expression< T > where(bool const mask, T &value)
Definition AMReX_SIMD.H:120
Definition AMReX_Amr.cpp:50
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1306
__host__ __device__ std::uint64_t SetParticleIDandCPU(Long id, int cpu) noexcept
Definition AMReX_Particle.H:347
RealVectND< 3 > RealVect
Definition AMReX_ParmParse.H:37
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition AMReX.cpp:235
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:241
const int[]
Definition AMReX_BLProfiler.cpp:1664
Definition AMReX_Particle.H:327
__host__ __device__ ConstParticleCPUWrapper(const uint64_t &idata) noexcept
Definition AMReX_Particle.H:331
const uint64_t * m_idata
Definition AMReX_Particle.H:328
Definition AMReX_Particle.H:301
__host__ __device__ ConstParticleIDWrapper(const uint64_t &idata) noexcept
Definition AMReX_Particle.H:305
const uint64_t * m_idata
Definition AMReX_Particle.H:302
__host__ __device__ bool is_valid() const noexcept
Definition AMReX_Particle.H:320
Definition AMReX_Particle.H:356
T m_rdata[NReal]
Definition AMReX_Particle.H:358
uint64_t m_idcpu
Definition AMReX_Particle.H:359
int m_idata[NInt]
Definition AMReX_Particle.H:360
T m_pos[3]
Definition AMReX_Particle.H:357
Definition AMReX_Particle.H:259
ParticleCPUWrapper(ParticleCPUWrapper &&)=delete
~ParticleCPUWrapper() noexcept=default
__host__ __device__ ParticleCPUWrapper(const ParticleCPUWrapper &rhs)=default
uint64_t * m_idata
Definition AMReX_Particle.H:260
__host__ __device__ ParticleCPUWrapper & operator=(const ParticleCPUWrapper &pcpuw) noexcept
Definition AMReX_Particle.H:275
Definition AMReX_Particle.H:154
__host__ __device__ void make_valid(T_Bool const &mask) const noexcept
Definition AMReX_Particle.H:242
__host__ __device__ void make_invalid() const noexcept
Definition AMReX_Particle.H:207
T * m_idata
Definition AMReX_Particle.H:162
__host__ __device__ void make_valid() const noexcept
Definition AMReX_Particle.H:230
__host__ __device__ ParticleIDWrapper(const ParticleIDWrapper &rhs)=default
~ParticleIDWrapper() noexcept=default
__host__ __device__ ParticleIDWrapper & operator=(const ParticleIDWrapper &pidw) noexcept
Definition AMReX_Particle.H:177
__host__ __device__ void make_invalid(T_Bool const &mask) const noexcept
Definition AMReX_Particle.H:219
ParticleIDWrapper(ParticleIDWrapper &&)=delete
__host__ __device__ bool is_valid() const noexcept
Definition AMReX_Particle.H:252
The struct used to store particles.
Definition AMReX_Particle.H:405
__host__ __device__ RealVect rvec(int indx, int indy, int indz) const &
Definition AMReX_Particle.H:504
__host__ __device__ uint64_t & idcpu() &
Definition AMReX_Particle.H:450
__host__ __device__ ConstParticleIDWrapper id() const &
Definition AMReX_Particle.H:433
__host__ __device__ const uint64_t & idcpu() const &
Definition AMReX_Particle.H:453
__host__ __device__ RealVect pos() const &
Definition AMReX_Particle.H:456
ParticleReal RealType
The floating point type used for the particles.
Definition AMReX_Particle.H:418
int IntType
Definition AMReX_Particle.H:419
__host__ __device__ int idata(int) const &
Definition AMReX_Particle.H:559
__host__ __device__ RealType rdata(int) &&=delete
static Long NextID()
Returns the next particle ID for this processor. Particle IDs start at 1 and are never reused....
Definition AMReX_Particle.H:595
__host__ __device__ RealType & rdata(int) &
Definition AMReX_Particle.H:480
__host__ __device__ const RealType & rdata(int index) const &
Definition AMReX_Particle.H:487
static Long the_next_id
Definition AMReX_Particle.H:421
__host__ __device__ int & idata(int index) &
Definition AMReX_Particle.H:538
__host__ __device__ const int & idata(int index) const &
Definition AMReX_Particle.H:552
__host__ __device__ ConstParticleCPUWrapper cpu() const &
Definition AMReX_Particle.H:430
__host__ __device__ ParticleCPUWrapper cpu() &
Definition AMReX_Particle.H:424
__host__ __device__ RealVect rvec(const IntVect &indices) const &
Definition AMReX_Particle.H:522
__host__ __device__ RealType idata(int) &&=delete
__host__ __device__ void atomicSetID(const Long id)
Definition AMReX_Particle.H:436
__host__ __device__ RealVect rvec(int, int, int) const &
Definition AMReX_Particle.H:514
__host__ __device__ uint64_t & idata(int) &
Definition AMReX_Particle.H:545
static Long UnprotectedNextID()
This version can only be used inside omp critical.
Definition AMReX_Particle.H:616
__host__ __device__ RealType & rdata(int index) &
Definition AMReX_Particle.H:473
__host__ __device__ RealType rdata(int) const &
Definition AMReX_Particle.H:494
static constexpr bool is_rtsoa_particle
Definition AMReX_Particle.H:407
static constexpr int NReal
number of extra Real components in the particle struct
Definition AMReX_Particle.H:412
__host__ __device__ ParticleIDWrapper id() &
Definition AMReX_Particle.H:427
__host__ __device__ RealType & pos(int index) &
Definition AMReX_Particle.H:459
static constexpr int NInt
number of extra integer components in the particle struct
Definition AMReX_Particle.H:415
__host__ __device__ RealVect rvec(const IntVect &) const &
Definition AMReX_Particle.H:531
__host__ __device__ RealType pos(int index) const &
Definition AMReX_Particle.H:466
Particle const ConstType
Definition AMReX_Particle.H:409
Definition AMReX_Particle.H:388
static constexpr bool is_rtsoa_particle
Definition AMReX_Particle.H:392
static constexpr int NInt
Definition AMReX_Particle.H:390
static constexpr int NReal
Definition AMReX_Particle.H:389
Definition AMReX_MakeParticle.H:13