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
472 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
474 RealType& rdata (int index) &
475 {
476 AMREX_ASSERT(index < NReal);
477 return this->m_rdata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
478 }
479
480 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
482 RealType& rdata (int /*index*/) &
483 {
484 AMREX_ALWAYS_ASSERT(false);
485 return this->pos(0); // bc we must return something
486 }
487
488 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
490 const RealType& rdata (int index) const &
491 {
492 AMREX_ASSERT(index < NReal);
493 return this->m_rdata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
494 }
495
496 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
498 RealType rdata (int /*index*/) const &
499 {
500 AMREX_ALWAYS_ASSERT(false);
501 return this->pos(0); // because we must return something
502 }
503
505 RealType rdata (int /*index*/) && = delete;
506
507 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
509 RealVect rvec (AMREX_D_DECL(int indx, int indy, int indz)) const &
510 {
511 AMREX_ASSERT(AMREX_D_TERM(indx < NReal, && indy < NReal, && indz < NReal));
512 return RealVect(AMREX_D_DECL(this->m_rdata[indx],
513 this->m_rdata[indy],
514 this->m_rdata[indz]));
515 }
516
517 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
519 RealVect rvec (AMREX_D_DECL(int /*indx*/, int /*indy*/, int /*indz*/)) const &
520 {
521 AMREX_ALWAYS_ASSERT(false);
522 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
523 }
524
525 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
527 RealVect rvec (const IntVect& indices) const &
528 {
529 AMREX_ASSERT(indices.allLT(NReal));
530 return RealVect(AMREX_D_DECL(this->m_rdata[indices[0]],
531 this->m_rdata[indices[1]],
532 this->m_rdata[indices[2]]));
533 }
534
535 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
537 RealVect rvec (const IntVect& /*indices*/) const &
538 {
539 AMREX_ALWAYS_ASSERT(false);
540 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
541 }
542
543 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
545 int& idata (int index) &
546 {
547 AMREX_ASSERT(index < NInt);
548 return this->m_idata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
549 }
550
551 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
553 uint64_t& idata (int /*index*/) &
554 {
555 AMREX_ALWAYS_ASSERT(false);
556 return this->m_idcpu; //bc we must return something
557 }
558
559 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
561 const int& idata (int index) const &
562 {
563 AMREX_ASSERT(index < NInt);
564 return this->m_idata[index]; // NOLINT(clang-analyzer-security.ArrayBound)
565 }
566
567 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
569 int idata (int /*index*/) const &
570 {
571 AMREX_ALWAYS_ASSERT(false);
572 return this->m_idcpu; //bc we must return something
573 }
574
576 RealType idata (int /*index*/) && = delete;
577
586 [[nodiscard]] static Long NextID ();
587
591 [[nodiscard]] static Long UnprotectedNextID ();
592
598 static void NextID (Long nextid);
599};
600
601template <int NReal, int NInt> Long Particle<NReal, NInt>::the_next_id = 1;
602
603template <int NReal, int NInt>
604Long
606{
607 Long next;
608// we should be able to test on _OPENMP < 201107 for capture (version 3.1)
609// but we must work around a bug in gcc < 4.9
610#if defined(AMREX_USE_OMP) && defined(_OPENMP) && _OPENMP < 201307
611#pragma omp critical (amrex_particle_nextid)
612#elif defined(AMREX_USE_OMP)
613#pragma omp atomic capture
614#endif
615 next = the_next_id++;
616
618 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
619 }
620
621 return next;
622}
623
624template <int NReal, int NInt>
625Long
627{
628 Long next = the_next_id++;
630 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
631 }
632 return next;
633}
634
635template <int NReal, int NInt>
636void
638{
639 the_next_id = nextid;
640}
641
642template <int NReal, int NInt>
643std::ostream&
644operator<< (std::ostream& os, const Particle<NReal, NInt>& p)
645{
646 os << p.id() << ' '
647 << p.cpu() << ' ';
648
649 for (int i = 0; i < AMREX_SPACEDIM; i++) {
650 os << p.pos(i) << ' ';
651 }
652
653 for (int i = 0; i < NReal; i++) {
654 os << p.rdata(i) << ' ';
655 }
656
657 for (int i = 0; i < NInt; i++) {
658 os << p.idata(i) << ' ';
659 }
660
661 if (!os.good()) {
662 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
663 }
664
665 return os;
666}
667
668template <int NReal>
669std::ostream&
670operator<< (std::ostream& os, const Particle<NReal, 0>& p)
671{
672 os << p.id() << ' '
673 << p.cpu() << ' ';
674
675 for (int i = 0; i < AMREX_SPACEDIM; i++) {
676 os << p.pos(i) << ' ';
677 }
678
679 for (int i = 0; i < NReal; i++) {
680 os << p.rdata(i) << ' ';
681 }
682
683 if (!os.good()) {
684 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
685 }
686
687 return os;
688}
689
690template <int NInt>
691std::ostream&
692operator<< (std::ostream& os, const Particle<0, NInt>& p)
693{
694 os << p.id() << ' '
695 << p.cpu() << ' ';
696
697 for (int i = 0; i < AMREX_SPACEDIM; i++) {
698 os << p.pos(i) << ' ';
699 }
700
701 for (int i = 0; i < NInt; i++) {
702 os << p.idata(i) << ' ';
703 }
704
705 if (!os.good()) {
706 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
707 }
708
709 return os;
710}
711
712template <int NReal=0, int NInt=0>
713std::ostream&
714operator<< (std::ostream& os, const Particle<0, 0>& p)
715{
716 os << p.id() << ' '
717 << p.cpu() << ' ';
718
719 for (int i = 0; i < AMREX_SPACEDIM; i++) {
720 os << p.pos(i) << ' ';
721 }
722
723 if (!os.good()) {
724 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
725 }
726
727 return os;
728}
729
730} // namespace amrex
731
732#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:488
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
Definition AMReX_Amr.cpp:49
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1239
__host__ __device__ std::uint64_t SetParticleIDandCPU(Long id, int cpu) noexcept
Definition AMReX_Particle.H:347
RealVectND< 3 > RealVect
Definition AMReX_ParmParse.H:35
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition AMReX.cpp:234
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:240
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__ 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__ uint64_t & idata(int) &
Definition AMReX_Particle.H:553
__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__ RealType rdata(int) const &
Definition AMReX_Particle.H:498
__host__ __device__ int & idata(int index) &
Definition AMReX_Particle.H:545
__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:605
static Long the_next_id
Definition AMReX_Particle.H:421
__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 &) const &
Definition AMReX_Particle.H:537
__host__ __device__ RealVect rvec(const IntVect &indices) const &
Definition AMReX_Particle.H:527
__host__ __device__ RealType idata(int) &&=delete
__host__ __device__ void atomicSetID(const Long id)
Definition AMReX_Particle.H:436
__host__ __device__ RealType & rdata(int) &
Definition AMReX_Particle.H:482
static Long UnprotectedNextID()
This version can only be used inside omp critical.
Definition AMReX_Particle.H:626
__host__ __device__ int idata(int) const &
Definition AMReX_Particle.H:569
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__ RealVect rvec(int indx, int indy, int indz) const &
Definition AMReX_Particle.H:509
__host__ __device__ ParticleIDWrapper id() &
Definition AMReX_Particle.H:427
__host__ __device__ RealType & rdata(int index) &
Definition AMReX_Particle.H:474
__host__ __device__ const RealType & rdata(int index) const &
Definition AMReX_Particle.H:490
__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(int, int, int) const &
Definition AMReX_Particle.H:519
__host__ __device__ const int & idata(int index) const &
Definition AMReX_Particle.H:561
__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