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<T, uint64_t>::value ||
157 std::is_same<T, simd::SIMDIdCpu<>>::value, // 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};
393
401template <int T_NReal, int T_NInt=0>
402struct alignas(sizeof(double)) Particle
403 : ParticleBase<ParticleReal,T_NReal,T_NInt>
404{
405 static constexpr bool is_soa_particle = false;
407 using ConstType = Particle const;
408
410 static constexpr int NReal = T_NReal;
411
413 static constexpr int NInt = T_NInt;
414
417 using IntType = int;
418
420
423
426
429
432
434 void atomicSetID (const Long id) {
435 uint64_t tmp = 0;
436 ParticleIDWrapper wrapper(tmp);
437 wrapper = id;
438#if defined(AMREX_USE_OMP)
439#pragma omp atomic write
440 this->m_idcpu = *(wrapper.m_idata);
441#else
442 auto *old_ptr = reinterpret_cast<unsigned long long*>(&(this->m_idcpu));
443 amrex::Gpu::Atomic::Exch(old_ptr, (unsigned long long) (*wrapper.m_idata));
444#endif
445 }
446
448 uint64_t& idcpu () & { return this->m_idcpu; }
449
451 const uint64_t& idcpu () const & { return this->m_idcpu; }
452
454 RealVect pos () const & {return RealVect(AMREX_D_DECL(this->m_pos[0], this->m_pos[1], this->m_pos[2]));}
455
457 RealType& pos (int index) &
458 {
459 AMREX_ASSERT(index < AMREX_SPACEDIM);
460 return this->m_pos[index];
461 }
462
464 RealType pos (int index) const &
465 {
466 AMREX_ASSERT(index < AMREX_SPACEDIM);
467 return this->m_pos[index];
468 }
469
470 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
472 RealType& rdata (int index) &
473 {
474 AMREX_ASSERT(index < NReal);
475 return this->m_rdata[index];
476 }
477
478 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
480 RealType& rdata (int /*index*/) &
481 {
482 AMREX_ALWAYS_ASSERT(false);
483 return this->pos(0); // bc we must return something
484 }
485
486 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
488 const RealType& rdata (int index) const &
489 {
490 AMREX_ASSERT(index < NReal);
491 return this->m_rdata[index];
492 }
493
494 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
496 RealType rdata (int /*index*/) const &
497 {
498 AMREX_ALWAYS_ASSERT(false);
499 return this->pos(0); // because we must return something
500 }
501
503 RealType rdata (int /*index*/) && = delete;
504
505 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
507 RealVect rvec (AMREX_D_DECL(int indx, int indy, int indz)) const &
508 {
509 AMREX_ASSERT(AMREX_D_TERM(indx < NReal, && indy < NReal, && indz < NReal));
510 return RealVect(AMREX_D_DECL(this->m_rdata[indx],
511 this->m_rdata[indy],
512 this->m_rdata[indz]));
513 }
514
515 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
517 RealVect rvec (AMREX_D_DECL(int /*indx*/, int /*indy*/, int /*indz*/)) const &
518 {
519 AMREX_ALWAYS_ASSERT(false);
520 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
521 }
522
523 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
525 RealVect rvec (const IntVect& indices) const &
526 {
527 AMREX_ASSERT(indices.allLT(NReal));
528 return RealVect(AMREX_D_DECL(this->m_rdata[indices[0]],
529 this->m_rdata[indices[1]],
530 this->m_rdata[indices[2]]));
531 }
532
533 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
535 RealVect rvec (const IntVect& /*indices*/) const &
536 {
537 AMREX_ALWAYS_ASSERT(false);
538 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
539 }
540
541 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
543 int& idata (int index) &
544 {
545 AMREX_ASSERT(index < NInt);
546 return this->m_idata[index];
547 }
548
549 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
551 uint64_t& idata (int /*index*/) &
552 {
553 AMREX_ALWAYS_ASSERT(false);
554 return this->m_idcpu; //bc we must return something
555 }
556
557 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
559 const int& idata (int index) const &
560 {
561 AMREX_ASSERT(index < NInt);
562 return this->m_idata[index];
563 }
564
565 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
567 int idata (int /*index*/) const &
568 {
569 AMREX_ALWAYS_ASSERT(false);
570 return this->m_idcpu; //bc we must return something
571 }
572
574 RealType idata (int /*index*/) && = delete;
575
584 [[nodiscard]] static Long NextID ();
585
589 [[nodiscard]] static Long UnprotectedNextID ();
590
596 static void NextID (Long nextid);
597};
598
599template <int NReal, int NInt> Long Particle<NReal, NInt>::the_next_id = 1;
600
601template <int NReal, int NInt>
602Long
604{
605 Long next;
606// we should be able to test on _OPENMP < 201107 for capture (version 3.1)
607// but we must work around a bug in gcc < 4.9
608#if defined(AMREX_USE_OMP) && defined(_OPENMP) && _OPENMP < 201307
609#pragma omp critical (amrex_particle_nextid)
610#elif defined(AMREX_USE_OMP)
611#pragma omp atomic capture
612#endif
613 next = the_next_id++;
614
616 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
617 }
618
619 return next;
620}
621
622template <int NReal, int NInt>
623Long
625{
626 Long next = the_next_id++;
628 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
629 }
630 return next;
631}
632
633template <int NReal, int NInt>
634void
636{
637 the_next_id = nextid;
638}
639
640template <int NReal, int NInt>
641std::ostream&
642operator<< (std::ostream& os, const Particle<NReal, NInt>& p)
643{
644 os << p.id() << ' '
645 << p.cpu() << ' ';
646
647 for (int i = 0; i < AMREX_SPACEDIM; i++) {
648 os << p.pos(i) << ' ';
649 }
650
651 for (int i = 0; i < NReal; i++) {
652 os << p.rdata(i) << ' ';
653 }
654
655 for (int i = 0; i < NInt; i++) {
656 os << p.idata(i) << ' ';
657 }
658
659 if (!os.good()) {
660 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
661 }
662
663 return os;
664}
665
666template <int NReal>
667std::ostream&
668operator<< (std::ostream& os, const Particle<NReal, 0>& p)
669{
670 os << p.id() << ' '
671 << p.cpu() << ' ';
672
673 for (int i = 0; i < AMREX_SPACEDIM; i++) {
674 os << p.pos(i) << ' ';
675 }
676
677 for (int i = 0; i < NReal; i++) {
678 os << p.rdata(i) << ' ';
679 }
680
681 if (!os.good()) {
682 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
683 }
684
685 return os;
686}
687
688template <int NInt>
689std::ostream&
690operator<< (std::ostream& os, const Particle<0, NInt>& p)
691{
692 os << p.id() << ' '
693 << p.cpu() << ' ';
694
695 for (int i = 0; i < AMREX_SPACEDIM; i++) {
696 os << p.pos(i) << ' ';
697 }
698
699 for (int i = 0; i < NInt; i++) {
700 os << p.idata(i) << ' ';
701 }
702
703 if (!os.good()) {
704 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
705 }
706
707 return os;
708}
709
710template <int NReal=0, int NInt=0>
711std::ostream&
712operator<< (std::ostream& os, const Particle<0, 0>& p)
713{
714 os << p.id() << ' '
715 << p.cpu() << ' ';
716
717 for (int i = 0; i < AMREX_SPACEDIM; i++) {
718 os << p.pos(i) << ' ';
719 }
720
721 if (!os.good()) {
722 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
723 }
724
725 return os;
726}
727
728} // namespace amrex
729
730#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
Definition AMReX_Amr.cpp:49
__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:224
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:230
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Definition AMReX_AmrMesh.cpp:1236
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:404
__host__ __device__ uint64_t & idcpu() &
Definition AMReX_Particle.H:448
__host__ __device__ ConstParticleIDWrapper id() const &
Definition AMReX_Particle.H:431
__host__ __device__ const uint64_t & idcpu() const &
Definition AMReX_Particle.H:451
__host__ __device__ uint64_t & idata(int) &
Definition AMReX_Particle.H:551
__host__ __device__ RealVect pos() const &
Definition AMReX_Particle.H:454
ParticleReal RealType
The floating point type used for the particles.
Definition AMReX_Particle.H:416
int IntType
Definition AMReX_Particle.H:417
__host__ __device__ RealType rdata(int) const &
Definition AMReX_Particle.H:496
__host__ __device__ int & idata(int index) &
Definition AMReX_Particle.H:543
__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:603
static Long the_next_id
Definition AMReX_Particle.H:419
__host__ __device__ ConstParticleCPUWrapper cpu() const &
Definition AMReX_Particle.H:428
__host__ __device__ ParticleCPUWrapper cpu() &
Definition AMReX_Particle.H:422
__host__ __device__ RealVect rvec(const IntVect &) const &
Definition AMReX_Particle.H:535
__host__ __device__ RealVect rvec(const IntVect &indices) const &
Definition AMReX_Particle.H:525
__host__ __device__ RealType idata(int) &&=delete
__host__ __device__ void atomicSetID(const Long id)
Definition AMReX_Particle.H:434
__host__ __device__ RealType & rdata(int) &
Definition AMReX_Particle.H:480
static Long UnprotectedNextID()
This version can only be used inside omp critical.
Definition AMReX_Particle.H:624
__host__ __device__ int idata(int) const &
Definition AMReX_Particle.H:567
static constexpr int NReal
number of extra Real components in the particle struct
Definition AMReX_Particle.H:410
__host__ __device__ RealVect rvec(int indx, int indy, int indz) const &
Definition AMReX_Particle.H:507
__host__ __device__ ParticleIDWrapper id() &
Definition AMReX_Particle.H:425
__host__ __device__ RealType & rdata(int index) &
Definition AMReX_Particle.H:472
__host__ __device__ const RealType & rdata(int index) const &
Definition AMReX_Particle.H:488
__host__ __device__ RealType & pos(int index) &
Definition AMReX_Particle.H:457
static constexpr int NInt
number of extra integer components in the particle struct
Definition AMReX_Particle.H:413
__host__ __device__ RealVect rvec(int, int, int) const &
Definition AMReX_Particle.H:517
__host__ __device__ const int & idata(int index) const &
Definition AMReX_Particle.H:559
__host__ __device__ RealType pos(int index) const &
Definition AMReX_Particle.H:464
Particle const ConstType
Definition AMReX_Particle.H:407
Definition AMReX_Particle.H:388
static constexpr int NInt
Definition AMReX_Particle.H:390
static constexpr int NReal
Definition AMReX_Particle.H:389
Definition AMReX_MakeParticle.H:13