Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_NeighborParticles.H
Go to the documentation of this file.
1#ifndef AMREX_NEIGHBORPARTICLES_H_
2#define AMREX_NEIGHBORPARTICLES_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_MultiFab.H>
7#include <AMReX_Particles.H>
10#include <AMReX_OpenMP.H>
11#include <AMReX_ParticleTile.H>
13
14namespace amrex {
15
22
34template <typename T_ParticleType, int T_NArrayReal=0, int T_NArrayInt=0,
35 template<class> class Allocator=DefaultAllocator,
36 class CellAssignor=DefaultAssignor>
37class NeighborParticleContainer_impl // NOLINT(cppcoreguidelines-virtual-class-destructor) // clang-tidy seems wrong.
38 : public ParticleContainer_impl<T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>
39{
40public:
48private:
49 struct MaskComps
50 {
51 enum {
52 grid = 0,
53 tile,
54 level
55 };
56 };
57
58 struct NeighborIndexMap {
59 int dst_level;
60 int dst_grid;
61 int dst_tile;
62 int dst_index;
63 int src_level;
64 int src_grid;
65 int src_tile;
66 int src_index;
67 int thread_num;
68
69 NeighborIndexMap(int dlevel, int dgrid, int dtile, int dindex,
70 int slevel, int sgrid, int stile, int sindex, int tnum)
71 : dst_level(dlevel), dst_grid(dgrid), dst_tile(dtile), dst_index(dindex),
72 src_level(slevel), src_grid(sgrid), src_tile(stile), src_index(sindex),
73 thread_num(tnum)
74 {}
75
76 friend std::ostream& operator<< (std::ostream& os, const NeighborIndexMap& nim)
77 {
78 os << nim.dst_level << " " << nim.dst_grid << " " << nim.dst_tile << " " << nim.dst_index
79 << nim.src_level << " " << nim.src_grid << " " << nim.src_tile << " " << nim.src_index
80 << nim.thread_num;
81 if (!os.good()) {
82 amrex::Error("operator<<(ostream&, const NeighborIndexMap& nim) failed");
83 }
84 return os;
85 }
86
87 };
88
89 struct NeighborCopyTag {
90 int level = -1;
91 int grid = -1;
92 int tile = -1;
93 int src_index = 0;
94 int dst_index = 0;
95 IntVect periodic_shift = IntVect(0);
96
97 NeighborCopyTag () = default;
98
99 NeighborCopyTag (int a_level, int a_grid, int a_tile) :
100 level(a_level), grid(a_grid), tile(a_tile)
101 {}
102
103 bool operator< (const NeighborCopyTag& other) const {
104 if (level != other.level) { return level < other.level; }
105 if (grid != other.grid) { return grid < other.grid; }
106 if (tile != other.tile) { return tile < other.tile; }
108 if (periodic_shift[0] != other.periodic_shift[0])
109 return periodic_shift[0] < other.periodic_shift[0];,
110 if (periodic_shift[1] != other.periodic_shift[1])
111 return periodic_shift[1] < other.periodic_shift[1];,
112 if (periodic_shift[2] != other.periodic_shift[2])
113 return periodic_shift[2] < other.periodic_shift[2];
114 )
115 return false;
116 }
117
118 bool operator== (const NeighborCopyTag& other) const {
119 return (level == other.level) && (grid == other.grid) && (tile == other.tile)
121 && (periodic_shift[0] == other.periodic_shift[0]),
122 && (periodic_shift[1] == other.periodic_shift[1]),
123 && (periodic_shift[2] == other.periodic_shift[2])
124 );
125 }
126
127 bool operator!= (const NeighborCopyTag& other) const
128 {
129 return !operator==(other);
130 }
131
132 friend std::ostream& operator<< (std::ostream& os, const NeighborCopyTag& tag)
133 {
134 os << tag.level << " " << tag.grid << " " << tag.tile << " " << tag.periodic_shift;
135 if (!os.good()) {
136 amrex::Error("operator<<(ostream&, const NeighborCopyTag&) failed");
137 }
138 return os;
139 }
140 };
141
142 struct InverseCopyTag
143 {
144 int src_grid;
145 int src_tile;
146 int src_index;
147 int src_level;
148 };
149
150 friend std::ostream& operator<< (std::ostream& os, const InverseCopyTag& tag)
151 {
152 os << tag.src_level << " " << tag.src_grid << " " << tag.src_tile << " " << tag.src_index;
153 if (!os.good()) {
154 amrex::Error("operator<<(ostream&, const InverseCopyTag&) failed");
155 }
156 return os;
157 }
158
159 struct NeighborCommTag {
160
161 NeighborCommTag (int pid, int lid, int gid, int tid)
162 : proc_id(pid), level_id(lid), grid_id(gid), tile_id(tid)
163 {}
164
165 int proc_id;
166 int level_id;
167 int grid_id;
168 int tile_id;
169
170 bool operator< (const NeighborCommTag& other) const {
171 return (proc_id < other.proc_id ||
172 (proc_id == other.proc_id &&
173 grid_id < other.grid_id) ||
174 (proc_id == other.proc_id &&
175 grid_id == other.grid_id &&
176 tile_id < other.tile_id) ||
177 (proc_id == other.proc_id &&
178 grid_id == other.grid_id &&
179 tile_id == other.tile_id &&
180 level_id < other.level_id));
181 }
182
183 bool operator== (const NeighborCommTag& other) const {
184 return ( (proc_id == other.proc_id) &&
185 (grid_id == other.grid_id) &&
186 (tile_id == other.tile_id) &&
187 (level_id == other.level_id));
188 }
189
190 friend std::ostream& operator<< (std::ostream& os, const NeighborCommTag& tag)
191 {
192 os << tag.proc_id << " " << tag.level_id << " " << tag.grid_id << " " << tag.tile_id;
193 if (!os.good()) {
194 amrex::Error("operator<<(ostream&, const NeighborCommTag&) failed");
195 }
196 return os;
197 }
198 };
199
200public:
201
206 static constexpr int RealCommCompStart = ParticleType::is_soa_particle ? 0 : AMREX_SPACEDIM + NStructReal;
207 static constexpr int IntCommCompStart = 2 + NStructInt;
208
210 using PairIndex = std::pair<int, int>;
211 using NeighborCommMap = std::map<NeighborCommTag, Vector<char> >;
218
220
222 const DistributionMapping & dmap,
223 const BoxArray & ba,
224 int nneighbor);
225
227 const Vector<DistributionMapping> & dmap,
228 const Vector<BoxArray> & ba,
229 const Vector<int> & rr,
230 int nneighbor);
231
232 ~NeighborParticleContainer_impl () override = default;
233
236
237 NeighborParticleContainer_impl ( NeighborParticleContainer_impl && ) = default; // NOLINT(performance-noexcept-move-constructor)
238 NeighborParticleContainer_impl& operator= ( NeighborParticleContainer_impl && ) = default; // NOLINT(performance-noexcept-move-constructor)
239
243 void Regrid (const DistributionMapping& dmap, const BoxArray& ba);
244 void Regrid (const DistributionMapping& dmap, const BoxArray& ba, int lev);
245 void Regrid (const Vector<DistributionMapping>& dmap, const Vector<BoxArray>& ba);
246
250 void fillNeighbors ();
251
256 void sumNeighbors (int real_start_comp, int real_num_comp,
257 int int_start_comp, int int_num_comp);
258
262 void updateNeighbors (bool boundary_neighbors_only=false);
263
267 void clearNeighbors ();
268
272 template <class CheckPair>
273 void buildNeighborList (CheckPair const& check_pair, bool sort=false);
274
278 template <class CheckPair, class OtherPCType>
279 void buildNeighborList (CheckPair const& check_pair, OtherPCType& other,
280 Vector<std::map<std::pair<int, int>,
282 bool sort=false);
283
287 template <class CheckPair>
288 void buildNeighborList (CheckPair const& check_pair, int type_ind, int* ref_ratio,
289 int num_bin_types=1, bool sort=false);
290
291 template <class CheckPair>
292 void selectActualNeighbors (CheckPair const& check_pair, int num_cells=1);
293
294 void printNeighborList ();
295
296 void setRealCommComp (int i, bool value);
297 void setIntCommComp (int i, bool value);
298
299 ParticleTile& GetNeighbors (int lev, int grid, int tile)
300 {
301 return neighbors[lev][std::make_pair(grid,tile)];
302 }
303
304 const ParticleTile& GetNeighbors (int lev, int grid, int tile) const
305 {
306 return neighbors[lev][std::make_pair(grid,tile)];
307 }
308
309 template <typename T,
310 std::enable_if_t<std::is_same_v<T,bool>,int> = 0>
311 void AddRealComp (T communicate=true)
312 {
314 ghost_real_comp.push_back(communicate);
315 calcCommSize();
316 }
317
318 template <typename T,
319 std::enable_if_t<std::is_same_v<T,bool>,int> = 0>
320 void AddIntComp (T communicate=true)
321 {
323 ghost_int_comp.push_back(communicate);
324 calcCommSize();
325 }
326
327 void Redistribute (int lev_min=0, int lev_max=-1, int nGrow=0, int local=0,
328 bool remove_negative=true)
329 {
331 ParticleContainerType::Redistribute(lev_min, lev_max, nGrow, local, remove_negative);
332 }
333
334 void RedistributeLocal (bool remove_negative=true)
335 {
336 const int lev_min = 0;
337 const int lev_max = 0;
338 const int nGrow = 0;
339 const int local = 1;
341 this->Redistribute(lev_min, lev_max, nGrow, local, remove_negative);
342 }
343
344#ifdef AMREX_USE_GPU
345 void fillNeighborsGPU ();
346 void updateNeighborsGPU (bool boundary_neighbors_only=false);
347 void clearNeighborsGPU ();
348#else
349 void fillNeighborsCPU ();
350 void sumNeighborsCPU (int real_start_comp, int real_num_comp,
351 int int_start_comp, int int_num_comp);
352 void updateNeighborsCPU (bool reuse_rcv_counts=true);
353 void clearNeighborsCPU ();
354#endif
355
356 void setEnableInverse (bool flag)
357 {
358 enable_inverse = flag;
359 calcCommSize();
360 }
361
362 bool enableInverse () { return enable_inverse; }
363
364 void buildNeighborMask ();
365
366 void buildNeighborCopyOp (bool use_boundary_neighbor=false);
367
368protected:
369
370 [[nodiscard]] int numRealCommComps () const { return RealCommCompStart + this->NumRealComps(); }
371 [[nodiscard]] int numIntCommComps () const { return IntCommCompStart + this->NumIntComps(); }
372
373 void cacheNeighborInfo ();
374
378 void BuildMasks ();
379
383 bool areMasksValid ();
384
385 void GetNeighborCommTags ();
386
387 void GetCommTagsBox (Vector<NeighborCommTag>& tags, int lev, const Box& in_box);
388
389 void resizeContainers (int num_levels);
390
391 void initializeCommComps ();
392
393 void calcCommSize ();
394
398 void fillNeighborsMPI (bool reuse_rcv_counts);
399
400 void sumNeighborsMPI (std::map<int, Vector<char> >& not_ours,
401 int real_start_comp, int real_num_comp,
402 int int_start_comp, int int_num_comp);
403
408
409 template <typename P>
411 const P& p,
412 int nGrow, const NeighborCopyTag& src_tag, const MyParIter& pti);
413
414 template <typename P>
416 const P& p,
417 const IntVect& nGrow, const NeighborCopyTag& src_tag, const MyParIter& pti);
418
419 IntVect computeRefFac (int src_lev, int lev);
420
424 static constexpr size_t pdata_size = sizeof(ParticleType);
425
426 static constexpr int num_mask_comps = 3;
431
434
440 std::map<int, Vector<char> > send_data;
441
444
445 static bool use_mask;
446
447 static bool enable_inverse;
448
449#ifdef AMREX_USE_GPU
450
455
456 NeighborTask(int a_grid_id, const Box& a_box, const IntVect& a_periodic_shift)
457 : grid_id(a_grid_id), box(a_box), periodic_shift(a_periodic_shift) {}
458
459 bool operator<(const NeighborTask& other) const {
460 if (grid_id != other.grid_id) { return grid_id < other.grid_id; }
461 if (box != other.box ) { return box < other.box; }
463 if (periodic_shift[0] != other.periodic_shift[0])
464 { return periodic_shift[0] < other.periodic_shift[0]; },
465 if (periodic_shift[1] != other.periodic_shift[1])
466 { return periodic_shift[1] < other.periodic_shift[1]; },
467 if (periodic_shift[2] != other.periodic_shift[2])
468 { return periodic_shift[2] < other.periodic_shift[2]; }
469 )
470 return false;
471 }
472 };
473
474 // These are used to keep track of which particles need to be ghosted to which grids
478
479 // {pboxid: [[neighbor codes] size= #intersected nbrs] size= #boundary boxes}
480 std::map<int, std::vector<std::vector<NeighborCode> > > m_grid_map;
481
482 // {pboxid: [ith intersected pbox: nbr codes]}
483 std::map<int, amrex::Gpu::DeviceVector<NeighborCode> > m_code_array;
484 // {pboxid: [ith intersected pbox: intersection]}
485 std::map<int, amrex::Gpu::DeviceVector<Box> > m_isec_boxes;
486 std::map<int, amrex::Gpu::DeviceVector<int> > m_code_offsets; // to be removed
487
490
493
496#endif
497
499
501
502 [[nodiscard]] bool hasNeighbors() const { return m_has_neighbors; }
503
504 bool m_has_neighbors = false;
505};
506
507template <int T_NStructReal, int T_NStructInt, int T_NArrayReal=0, int T_NArrayInt=0>
510
511template <int T_NArrayReal, int T_NArrayInt,
512 template<class> class Allocator=DefaultAllocator,
513 class CellAssignor=DefaultAssignor>
516 T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;
517
518}
519
521
522#ifdef AMREX_USE_GPU
524#else
526#endif
527
528#endif // _NEIGHBORPARTICLES_H_
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
A collection of Boxes stored in an Array.
Definition AMReX_BoxArray.H:564
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:43
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:75
Definition AMReX_NeighborList.H:311
Definition AMReX_NeighborParticles.H:39
void AddIntComp(T communicate=true)
Definition AMReX_NeighborParticles.H:320
void fillNeighbors()
Definition AMReX_NeighborParticlesI.H:668
std::pair< int, int > PairIndex
Definition AMReX_NeighborParticles.H:210
void clearNeighbors()
Definition AMReX_NeighborParticlesI.H:713
Vector< Long > rcvs
Definition AMReX_NeighborParticles.H:438
void selectActualNeighbors(CheckPair const &check_pair, int num_cells=1)
Definition AMReX_NeighborParticlesI.H:1014
amrex::BoxArray m_cached_neighbor_ba
Definition AMReX_NeighborParticles.H:476
Vector< int > ghost_int_comp
Definition AMReX_NeighborParticles.H:443
static bool enable_inverse
Definition AMReX_NeighborParticles.H:447
const ParticleTile & GetNeighbors(int lev, int grid, int tile) const
Definition AMReX_NeighborParticles.H:304
~NeighborParticleContainer_impl() override=default
NeighborParticleContainer_impl & operator=(const NeighborParticleContainer_impl &)=delete
void setRealCommComp(int i, bool value)
Definition AMReX_NeighborParticlesI.H:74
void sumNeighbors(int real_start_comp, int real_num_comp, int int_start_comp, int int_num_comp)
Definition AMReX_NeighborParticlesI.H:681
static constexpr int RealCommCompStart
Definition AMReX_NeighborParticles.H:206
std::map< int, amrex::Gpu::DeviceVector< NeighborCode > > m_code_array
Definition AMReX_NeighborParticles.H:483
int numIntCommComps() const
Definition AMReX_NeighborParticles.H:371
void fillNeighborsMPI(bool reuse_rcv_counts)
void buildNeighborList(CheckPair const &check_pair, bool sort=false)
Definition AMReX_NeighborParticlesI.H:728
typename ParticleContainerType::PTDType PTDType
Definition AMReX_NeighborParticles.H:216
void printNeighborList()
Definition AMReX_NeighborParticlesI.H:1126
typename ParticleContainerType::ConstPTDType ConstPTDType
Definition AMReX_NeighborParticles.H:217
void updateNeighborsGPU(bool boundary_neighbors_only=false)
Definition AMReX_NeighborParticlesGPUImpl.H:345
void GetNeighborCommTags()
Definition AMReX_NeighborParticlesI.H:214
friend std::ostream & operator<<(std::ostream &os, const InverseCopyTag &tag)
Definition AMReX_NeighborParticles.H:150
void getNeighborTags(Vector< NeighborCopyTag > &tags, const P &p, int nGrow, const NeighborCopyTag &src_tag, const MyParIter &pti)
Definition AMReX_NeighborParticlesI.H:563
NeighborParticleContainer_impl(NeighborParticleContainer_impl &&)=default
void setEnableInverse(bool flag)
Definition AMReX_NeighborParticles.H:356
Vector< int > neighbor_procs
Definition AMReX_NeighborParticles.H:437
void buildNeighborCopyOp(bool use_boundary_neighbor=false)
Definition AMReX_NeighborParticlesGPUImpl.H:188
NeighborListContainerType m_neighbor_list
Definition AMReX_NeighborParticles.H:498
ParticleTile & GetNeighbors(int lev, int grid, int tile)
Definition AMReX_NeighborParticles.H:299
static bool use_mask
Definition AMReX_NeighborParticles.H:445
void sumNeighborsMPI(std::map< int, Vector< char > > &not_ours, int real_start_comp, int real_num_comp, int int_start_comp, int int_num_comp)
void buildNeighborMask()
Definition AMReX_NeighborParticlesGPUImpl.H:115
ParticleCopyPlan neighbor_copy_plan
Definition AMReX_NeighborParticles.H:489
int m_num_neighbor_cells
Definition AMReX_NeighborParticles.H:428
size_t cdata_size
Definition AMReX_NeighborParticles.H:427
static constexpr int IntCommCompStart
Definition AMReX_NeighborParticles.H:207
NeighborParticleContainer_impl(const NeighborParticleContainer_impl &)=delete
Vector< std::map< PairIndex, Vector< InverseCopyTag > > > inverse_tags
Definition AMReX_NeighborParticles.H:421
void RedistributeLocal(bool remove_negative=true)
Definition AMReX_NeighborParticles.H:334
bool enableInverse()
Definition AMReX_NeighborParticles.H:362
typename ParticleContainerType::ParticleTileType ParticleTile
Definition AMReX_NeighborParticles.H:214
ParticleCopyOp neighbor_copy_op
Definition AMReX_NeighborParticles.H:488
Vector< std::map< PairIndex, IntVector > > neighbor_list
Definition AMReX_NeighborParticles.H:423
typename ParticleContainerType::SuperParticleType SuperParticleType
Definition AMReX_NeighborParticles.H:44
static constexpr int NStructReal
Definition AMReX_NeighborParticles.H:204
void fillNeighborsGPU()
Definition AMReX_NeighborParticlesGPUImpl.H:324
IntVect computeRefFac(int src_lev, int lev)
Definition AMReX_NeighborParticlesI.H:271
void updateNeighbors(bool boundary_neighbors_only=false)
Definition AMReX_NeighborParticlesI.H:695
void initializeCommComps()
Definition AMReX_NeighborParticlesI.H:60
typename ParticleContainerType::AoS AoS
Definition AMReX_NeighborParticles.H:212
std::map< NeighborCommTag, Vector< char > > NeighborCommMap
Definition AMReX_NeighborParticles.H:211
std::map< int, Vector< char > > send_data
Definition AMReX_NeighborParticles.H:440
void GetCommTagsBox(Vector< NeighborCommTag > &tags, int lev, const Box &in_box)
Definition AMReX_NeighborParticlesI.H:291
bool hasNeighbors() const
Definition AMReX_NeighborParticles.H:502
Gpu::PinnedVector< char > pinned_rcv_buffer
Definition AMReX_NeighborParticles.H:495
static constexpr int num_mask_comps
grid, tile, level
Definition AMReX_NeighborParticles.H:426
amrex::PODVector< char, PolymorphicArenaAllocator< char > > snd_buffer
Definition AMReX_NeighborParticles.H:491
Vector< std::map< PairIndex, Vector< Vector< NeighborCopyTag > > > > buffer_tag_cache
Definition AMReX_NeighborParticles.H:432
Vector< std::map< std::pair< int, int >, amrex::Gpu::DeviceVector< int > > > m_boundary_particle_ids
Definition AMReX_NeighborParticles.H:500
Vector< std::map< PairIndex, int > > local_neighbor_sizes
Definition AMReX_NeighborParticles.H:433
typename ParticleContainerType::ParIterType MyParIter
Definition AMReX_NeighborParticles.H:209
typename ParticleContainerType::ParticleVector ParticleVector
Definition AMReX_NeighborParticles.H:213
bool areMasksValid()
Definition AMReX_NeighborParticlesI.H:149
Vector< std::unique_ptr< iMultiFab > > mask_ptr
Definition AMReX_NeighborParticles.H:430
Vector< std::map< PairIndex, ParticleTile > > neighbors
Definition AMReX_NeighborParticles.H:422
typename ParticleContainerType::IntVector IntVector
Definition AMReX_NeighborParticles.H:215
void calcCommSize()
Definition AMReX_NeighborParticlesI.H:92
void clearNeighborsGPU()
Definition AMReX_NeighborParticlesGPUImpl.H:402
bool m_has_neighbors
Definition AMReX_NeighborParticles.H:504
amrex::PODVector< char, PolymorphicArenaAllocator< char > > rcv_buffer
Definition AMReX_NeighborParticles.H:492
static constexpr int NArrayInt
Definition AMReX_NeighborParticles.H:203
Vector< NeighborCommTag > local_neighbors
Definition AMReX_NeighborParticles.H:429
void BuildMasks()
Definition AMReX_NeighborParticlesI.H:174
Long num_snds
Definition AMReX_NeighborParticles.H:439
void resizeContainers(int num_levels)
Definition AMReX_NeighborParticlesI.H:1146
bool m_neighbor_mask_initialized
Definition AMReX_NeighborParticles.H:475
Gpu::PinnedVector< char > pinned_snd_buffer
Definition AMReX_NeighborParticles.H:494
std::map< int, amrex::Gpu::DeviceVector< Box > > m_isec_boxes
Definition AMReX_NeighborParticles.H:485
Vector< int > ghost_real_comp
Definition AMReX_NeighborParticles.H:442
void setIntCommComp(int i, bool value)
Definition AMReX_NeighborParticlesI.H:83
std::map< int, std::vector< std::vector< NeighborCode > > > m_grid_map
Definition AMReX_NeighborParticles.H:480
std::map< int, amrex::Gpu::DeviceVector< int > > m_code_offsets
Definition AMReX_NeighborParticles.H:486
int numRealCommComps() const
Definition AMReX_NeighborParticles.H:370
void Regrid(const DistributionMapping &dmap, const BoxArray &ba)
Definition AMReX_NeighborParticlesI.H:112
static constexpr int NArrayReal
Definition AMReX_NeighborParticles.H:202
void Redistribute(int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true)
Definition AMReX_NeighborParticles.H:327
static constexpr int NStructInt
Definition AMReX_NeighborParticles.H:205
void cacheNeighborInfo()
Definition AMReX_NeighborParticlesI.H:339
typename ParticleContainerType::ParticleType ParticleType
Definition AMReX_NeighborParticles.H:43
static constexpr size_t pdata_size
Definition AMReX_NeighborParticles.H:424
void AddRealComp(T communicate=true)
Definition AMReX_NeighborParticles.H:311
amrex::DistributionMapping m_cached_neighbor_dm
Definition AMReX_NeighborParticles.H:477
Dynamically allocated vector for trivially copyable data.
Definition AMReX_PODVector.H:308
Definition AMReX_ParGDB.H:13
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition AMReX_ParticleContainer.H:149
typename ParticleTileType::ConstParticleTileDataType ConstPTDType
Definition AMReX_ParticleContainer.H:198
void Redistribute(int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true)
Redistribute puts all the particles back in the right places (for some value of right)
Definition AMReX_ParticleContainerI.H:1238
void AddIntComp(std::string const &name, int communicate=1)
Definition AMReX_ParticleContainer.H:1326
Particle< NStructReal+NArrayReal, NStructInt+NArrayInt > SuperParticleType
The type of the "SuperParticle" which stored all components in AoS form.
Definition AMReX_ParticleContainer.H:174
static constexpr int NArrayInt
Number of extra integer components stored in struct-of-array form.
Definition AMReX_ParticleContainer.H:162
static constexpr int NArrayReal
Number of extra Real components stored in struct-of-array form.
Definition AMReX_ParticleContainer.H:160
typename ParticleTileType::AoS AoS
Definition AMReX_ParticleContainer.H:199
typename AoS::ParticleVector ParticleVector
Definition AMReX_ParticleContainer.H:204
static constexpr int NStructInt
Number of extra integer components in the particle struct.
Definition AMReX_ParticleContainer.H:158
int NumRealComps() const
Definition AMReX_ParticleContainer.H:1362
static constexpr int NStructReal
Number of extra Real components in the particle struct.
Definition AMReX_ParticleContainer.H:156
int NumIntComps() const
Definition AMReX_ParticleContainer.H:1363
typename ParticleTileType::ParticleTileDataType PTDType
Definition AMReX_ParticleContainer.H:197
typename SoA::IntVector IntVector
Definition AMReX_ParticleContainer.H:203
ParIter_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > ParIterType
Definition AMReX_ParticleContainer.H:206
std::conditional_t< is_rtsoa_pc, ParticleTileRT< typename ParticleType::RealType, typename ParticleType::IntType >, ParticleTile< ParticleType, NArrayReal, NArrayInt, Allocator > > ParticleTileType
Definition AMReX_ParticleContainer.H:191
void AddRealComp(std::string const &name, int communicate=1)
Definition AMReX_ParticleContainer.H:1293
T_ParticleType ParticleType
Definition AMReX_ParticleContainer.H:151
amrex_long Long
Definition AMReX_INT.H:30
Definition AMReX_Amr.cpp:50
amrex::ArenaAllocator< T > DefaultAllocator
Definition AMReX_GpuAllocators.H:205
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:33
bool operator==(A1 const &a1, A2 const &a2)
Definition AMReX_GpuAllocators.H:214
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition AMReX.cpp:235
Definition AMReX_ParticleUtil.H:390
Definition AMReX_NeighborParticles.H:17
Box grid_box
Definition AMReX_NeighborParticles.H:19
IntVect periodic_shift
Definition AMReX_NeighborParticles.H:20
int grid_id
Definition AMReX_NeighborParticles.H:18
Definition AMReX_NeighborParticles.H:451
IntVect periodic_shift
Definition AMReX_NeighborParticles.H:454
Box box
Definition AMReX_NeighborParticles.H:453
int grid_id
Definition AMReX_NeighborParticles.H:452
bool operator<(const NeighborTask &other) const
Definition AMReX_NeighborParticles.H:459
NeighborTask(int a_grid_id, const Box &a_box, const IntVect &a_periodic_shift)
Definition AMReX_NeighborParticles.H:456
Definition AMReX_ParticleCommunication.H:66
Definition AMReX_ParticleCommunication.H:92