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
20 constexpr Long VirtualParticleID = GhostParticleID - 1;
21 constexpr Long LastParticleID = GhostParticleID - 2;
22 constexpr Long DoSplitParticleID = GhostParticleID - 3;
23 constexpr Long NoSplitParticleID = GhostParticleID - 4;
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
189 ParticleIDWrapper& operator= (const Long id) noexcept
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
399template <int T_NReal, int T_NInt=0>
400struct alignas(sizeof(double)) Particle
401 : ParticleBase<ParticleReal,T_NReal,T_NInt>
402{
403 static constexpr bool is_soa_particle = false;
405 using ConstType = Particle const;
406
408 static constexpr int NReal = T_NReal;
409
411 static constexpr int NInt = T_NInt;
412
414 using RealType = ParticleReal;
415 using IntType = int;
416
417 static Long the_next_id;
418
421
424
427
430
432 void atomicSetID (const Long id) {
433 uint64_t tmp = 0;
434 ParticleIDWrapper wrapper(tmp);
435 wrapper = id;
436#if defined(AMREX_USE_OMP)
437#pragma omp atomic write
438 this->m_idcpu = *(wrapper.m_idata);
439#else
440 auto *old_ptr = reinterpret_cast<unsigned long long*>(&(this->m_idcpu));
441 amrex::Gpu::Atomic::Exch(old_ptr, (unsigned long long) (*wrapper.m_idata));
442#endif
443 }
444
446 uint64_t& idcpu () & { return this->m_idcpu; }
447
449 const uint64_t& idcpu () const & { return this->m_idcpu; }
450
452 RealVect pos () const & {return RealVect(AMREX_D_DECL(this->m_pos[0], this->m_pos[1], this->m_pos[2]));}
453
455 RealType& pos (int index) &
456 {
457 AMREX_ASSERT(index < AMREX_SPACEDIM);
458 return this->m_pos[index];
459 }
460
462 RealType pos (int index) const &
463 {
464 AMREX_ASSERT(index < AMREX_SPACEDIM);
465 return this->m_pos[index];
466 }
467
468 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
470 RealType& rdata (int index) &
471 {
472 AMREX_ASSERT(index < NReal);
473 return this->m_rdata[index];
474 }
475
476 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
478 RealType& rdata (int /*index*/) &
479 {
480 AMREX_ALWAYS_ASSERT(false);
481 return this->pos(0); // bc we must return something
482 }
483
484 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
486 const RealType& rdata (int index) const &
487 {
488 AMREX_ASSERT(index < NReal);
489 return this->m_rdata[index];
490 }
491
492 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
494 RealType rdata (int /*index*/) const &
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
503 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
505 RealVect rvec (AMREX_D_DECL(int indx, int indy, int indz)) const &
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
513 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
515 RealVect rvec (AMREX_D_DECL(int /*indx*/, int /*indy*/, int /*indz*/)) const &
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
521 template <int U = T_NReal, std::enable_if_t<U != 0, int> = 0>
523 RealVect rvec (const IntVect& indices) const &
524 {
525 AMREX_ASSERT(indices.allLT(NReal));
526 return RealVect(AMREX_D_DECL(this->m_rdata[indices[0]],
527 this->m_rdata[indices[1]],
528 this->m_rdata[indices[2]]));
529 }
530
531 template <int U = T_NReal, std::enable_if_t<U == 0, int> = 0>
533 RealVect rvec (const IntVect& /*indices*/) const &
534 {
535 AMREX_ALWAYS_ASSERT(false);
536 return RealVect(AMREX_D_DECL(0.0, 0.0, 0.0)); // bc we must return something
537 }
538
539 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
541 int& idata (int index) &
542 {
543 AMREX_ASSERT(index < NInt);
544 return this->m_idata[index];
545 }
546
547 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
549 uint64_t& idata (int /*index*/) &
550 {
551 AMREX_ALWAYS_ASSERT(false);
552 return this->m_idcpu; //bc we must return something
553 }
554
555 template <int U = T_NInt, std::enable_if_t<U != 0, int> = 0>
557 const int& idata (int index) const &
558 {
559 AMREX_ASSERT(index < NInt);
560 return this->m_idata[index];
561 }
562
563 template <int U = T_NInt, std::enable_if_t<U == 0, int> = 0>
565 int idata (int /*index*/) const &
566 {
567 AMREX_ALWAYS_ASSERT(false);
568 return this->m_idcpu; //bc we must return something
569 }
570
572 RealType idata (int /*index*/) && = delete;
573
582 [[nodiscard]] static Long NextID ();
583
587 [[nodiscard]] static Long UnprotectedNextID ();
588
594 static void NextID (Long nextid);
595};
596
597template <int NReal, int NInt> Long Particle<NReal, NInt>::the_next_id = 1;
598
599template <int NReal, int NInt>
600Long
602{
603 Long next;
604// we should be able to test on _OPENMP < 201107 for capture (version 3.1)
605// but we must work around a bug in gcc < 4.9
606#if defined(AMREX_USE_OMP) && defined(_OPENMP) && _OPENMP < 201307
607#pragma omp critical (amrex_particle_nextid)
608#elif defined(AMREX_USE_OMP)
609#pragma omp atomic capture
610#endif
611 next = the_next_id++;
612
614 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
615 }
616
617 return next;
618}
619
620template <int NReal, int NInt>
621Long
623{
624 Long next = the_next_id++;
626 amrex::Abort("Particle<NReal, NInt>::NextID() -- too many particles");
627 }
628 return next;
629}
630
631template <int NReal, int NInt>
632void
634{
635 the_next_id = nextid;
636}
637
638template <int NReal, int NInt>
639std::ostream&
640operator<< (std::ostream& os, const Particle<NReal, NInt>& p)
641{
642 os << p.id() << ' '
643 << p.cpu() << ' ';
644
645 for (int i = 0; i < AMREX_SPACEDIM; i++) {
646 os << p.pos(i) << ' ';
647 }
648
649 for (int i = 0; i < NReal; i++) {
650 os << p.rdata(i) << ' ';
651 }
652
653 for (int i = 0; i < NInt; i++) {
654 os << p.idata(i) << ' ';
655 }
656
657 if (!os.good()) {
658 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
659 }
660
661 return os;
662}
663
664template <int NReal>
665std::ostream&
666operator<< (std::ostream& os, const Particle<NReal, 0>& p)
667{
668 os << p.id() << ' '
669 << p.cpu() << ' ';
670
671 for (int i = 0; i < AMREX_SPACEDIM; i++) {
672 os << p.pos(i) << ' ';
673 }
674
675 for (int i = 0; i < NReal; i++) {
676 os << p.rdata(i) << ' ';
677 }
678
679 if (!os.good()) {
680 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
681 }
682
683 return os;
684}
685
686template <int NInt>
687std::ostream&
688operator<< (std::ostream& os, const Particle<0, NInt>& p)
689{
690 os << p.id() << ' '
691 << p.cpu() << ' ';
692
693 for (int i = 0; i < AMREX_SPACEDIM; i++) {
694 os << p.pos(i) << ' ';
695 }
696
697 for (int i = 0; i < NInt; i++) {
698 os << p.idata(i) << ' ';
699 }
700
701 if (!os.good()) {
702 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
703 }
704
705 return os;
706}
707
708template <int NReal=0, int NInt=0>
709std::ostream&
710operator<< (std::ostream& os, const Particle<0, 0>& p)
711{
712 os << p.id() << ' '
713 << p.cpu() << ' ';
714
715 for (int i = 0; i < AMREX_SPACEDIM; i++) {
716 os << p.pos(i) << ' ';
717 }
718
719 if (!os.good()) {
720 amrex::Error("operator<<(ostream&,Particle<NReal, NInt>&) failed");
721 }
722
723 return os;
724}
725
726} // namespace amrex
727
728#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
__host__ __device__ AMREX_FORCE_INLINE T Exch(T *address, T val) noexcept
Definition AMReX_GpuAtomic.H:485
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:402
__host__ __device__ uint64_t & idcpu() &
Definition AMReX_Particle.H:446
__host__ __device__ ConstParticleIDWrapper id() const &
Definition AMReX_Particle.H:429
__host__ __device__ const uint64_t & idcpu() const &
Definition AMReX_Particle.H:449
__host__ __device__ uint64_t & idata(int) &
Definition AMReX_Particle.H:549
__host__ __device__ RealVect pos() const &
Definition AMReX_Particle.H:452
ParticleReal RealType
The floating point type used for the particles.
Definition AMReX_Particle.H:414
int IntType
Definition AMReX_Particle.H:415
__host__ __device__ RealType rdata(int) const &
Definition AMReX_Particle.H:494
__host__ __device__ int & idata(int index) &
Definition AMReX_Particle.H:541
__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:601
static Long the_next_id
Definition AMReX_Particle.H:417
__host__ __device__ ConstParticleCPUWrapper cpu() const &
Definition AMReX_Particle.H:426
__host__ __device__ ParticleCPUWrapper cpu() &
Definition AMReX_Particle.H:420
__host__ __device__ RealVect rvec(const IntVect &) const &
Definition AMReX_Particle.H:533
__host__ __device__ RealVect rvec(const IntVect &indices) const &
Definition AMReX_Particle.H:523
__host__ __device__ RealType idata(int) &&=delete
__host__ __device__ void atomicSetID(const Long id)
Definition AMReX_Particle.H:432
__host__ __device__ RealType & rdata(int) &
Definition AMReX_Particle.H:478
static Long UnprotectedNextID()
This version can only be used inside omp critical.
Definition AMReX_Particle.H:622
__host__ __device__ int idata(int) const &
Definition AMReX_Particle.H:565
static constexpr int NReal
number of extra Real components in the particle struct
Definition AMReX_Particle.H:408
__host__ __device__ RealVect rvec(int indx, int indy, int indz) const &
Definition AMReX_Particle.H:505
__host__ __device__ ParticleIDWrapper id() &
Definition AMReX_Particle.H:423
__host__ __device__ RealType & rdata(int index) &
Definition AMReX_Particle.H:470
__host__ __device__ const RealType & rdata(int index) const &
Definition AMReX_Particle.H:486
__host__ __device__ RealType & pos(int index) &
Definition AMReX_Particle.H:455
static constexpr int NInt
number of extra integer components in the particle struct
Definition AMReX_Particle.H:411
__host__ __device__ RealVect rvec(int, int, int) const &
Definition AMReX_Particle.H:515
__host__ __device__ const int & idata(int index) const &
Definition AMReX_Particle.H:557
__host__ __device__ RealType pos(int index) const &
Definition AMReX_Particle.H:462
Particle const ConstType
Definition AMReX_Particle.H:405
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