Block-Structured AMR Software Framework
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>
6 #include <AMReX_MultiFabUtil.H>
7 #include <AMReX_Particles.H>
8 #include <AMReX_ParticleUtil.H>
9 #include <AMReX_NeighborList.H>
10 #include <AMReX_OpenMP.H>
11 #include <AMReX_ParticleTile.H>
12 
13 namespace amrex {
14 
15  struct NeighborCode
16  {
17  int grid_id;
19  };
20 
32 template <int NStructReal, int NStructInt, int NArrayReal=0, int NArrayInt=0>
33 class NeighborParticleContainer // NOLINT(cppcoreguidelines-virtual-class-destructor) // clang-tidy seems wrong.
34  : public ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>
35 {
36 public:
41 private:
42  struct MaskComps
43  {
44  enum {
45  grid = 0,
47  level
48  };
49  };
50 
52  int dst_level;
53  int dst_grid;
54  int dst_tile;
55  int dst_index;
56  int src_level;
57  int src_grid;
58  int src_tile;
59  int src_index;
61 
62  NeighborIndexMap(int dlevel, int dgrid, int dtile, int dindex,
63  int slevel, int sgrid, int stile, int sindex, int tnum)
64  : dst_level(dlevel), dst_grid(dgrid), dst_tile(dtile), dst_index(dindex),
65  src_level(slevel), src_grid(sgrid), src_tile(stile), src_index(sindex),
66  thread_num(tnum)
67  {}
68 
69  friend std::ostream& operator<< (std::ostream& os, const NeighborIndexMap& nim)
70  {
71  os << nim.dst_level << " " << nim.dst_grid << " " << nim.dst_tile << " " << nim.dst_index
72  << nim.src_level << " " << nim.src_grid << " " << nim.src_tile << " " << nim.src_index
73  << nim.thread_num;
74  if (!os.good()) {
75  amrex::Error("operator<<(ostream&, const NeighborIndexMap& nim) failed");
76  }
77  return os;
78  }
79 
80  };
81 
82  struct NeighborCopyTag {
83  int level = -1;
84  int grid = -1;
85  int tile = -1;
86  int src_index = 0;
87  int dst_index = 0;
89 
90  NeighborCopyTag () = default;
91 
92  NeighborCopyTag (int a_level, int a_grid, int a_tile) :
93  level(a_level), grid(a_grid), tile(a_tile)
94  {}
95 
96  bool operator< (const NeighborCopyTag& other) const {
97  if (level != other.level) { return level < other.level; }
98  if (grid != other.grid) { return grid < other.grid; }
99  if (tile != other.tile) { return tile < other.tile; }
100  AMREX_D_TERM(
101  if (periodic_shift[0] != other.periodic_shift[0])
102  return periodic_shift[0] < other.periodic_shift[0];,
103  if (periodic_shift[1] != other.periodic_shift[1])
104  return periodic_shift[1] < other.periodic_shift[1];,
105  if (periodic_shift[2] != other.periodic_shift[2])
106  return periodic_shift[2] < other.periodic_shift[2];
107  )
108  return false;
109  }
110 
111  bool operator== (const NeighborCopyTag& other) const {
112  return (level == other.level) && (grid == other.grid) && (tile == other.tile)
113  AMREX_D_TERM(
114  && (periodic_shift[0] == other.periodic_shift[0]),
115  && (periodic_shift[1] == other.periodic_shift[1]),
116  && (periodic_shift[2] == other.periodic_shift[2])
117  );
118  }
119 
120  bool operator!= (const NeighborCopyTag& other) const
121  {
122  return !operator==(other);
123  }
124 
125  friend std::ostream& operator<< (std::ostream& os, const NeighborCopyTag& tag)
126  {
127  os << tag.level << " " << tag.grid << " " << tag.tile << " " << tag.periodic_shift;
128  if (!os.good()) {
129  amrex::Error("operator<<(ostream&, const NeighborCopyTag&) failed");
130  }
131  return os;
132  }
133  };
134 
136  {
137  int src_grid;
138  int src_tile;
141  };
142 
143  friend std::ostream& operator<< (std::ostream& os, const InverseCopyTag& tag)
144  {
145  os << tag.src_level << " " << tag.src_grid << " " << tag.src_tile << " " << tag.src_index;
146  if (!os.good()) {
147  amrex::Error("operator<<(ostream&, const InverseCopyTag&) failed");
148  }
149  return os;
150  }
151 
153 
154  NeighborCommTag (int pid, int lid, int gid, int tid)
155  : proc_id(pid), level_id(lid), grid_id(gid), tile_id(tid)
156  {}
157 
158  int proc_id;
159  int level_id;
160  int grid_id;
161  int tile_id;
162 
163  bool operator< (const NeighborCommTag& other) const {
164  return (proc_id < other.proc_id ||
165  (proc_id == other.proc_id &&
166  grid_id < other.grid_id) ||
167  (proc_id == other.proc_id &&
168  grid_id == other.grid_id &&
169  tile_id < other.tile_id) ||
170  (proc_id == other.proc_id &&
171  grid_id == other.grid_id &&
172  tile_id == other.tile_id &&
173  level_id < other.level_id));
174  }
175 
176  bool operator== (const NeighborCommTag& other) const {
177  return ( (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  friend std::ostream& operator<< (std::ostream& os, const NeighborCommTag& tag)
184  {
185  os << tag.proc_id << " " << tag.level_id << " " << tag.grid_id << " " << tag.tile_id;
186  if (!os.good()) {
187  amrex::Error("operator<<(ostream&, const NeighborCommTag&) failed");
188  }
189  return os;
190  }
191  };
192 
193 public:
194 
196  using PairIndex = std::pair<int, int>;
197  using NeighborCommMap = std::map<NeighborCommTag, Vector<char> >;
202 
203  NeighborParticleContainer (ParGDBBase* gdb, int ncells);
204 
205  NeighborParticleContainer (const Geometry & geom,
206  const DistributionMapping & dmap,
207  const BoxArray & ba,
208  int nneighbor);
209 
211  const Vector<DistributionMapping> & dmap,
212  const Vector<BoxArray> & ba,
213  const Vector<int> & rr,
214  int nneighbor);
215 
216  ~NeighborParticleContainer () override = default;
217 
220 
221  NeighborParticleContainer ( NeighborParticleContainer && ) = default; // NOLINT(performance-noexcept-move-constructor)
222  NeighborParticleContainer& operator= ( NeighborParticleContainer && ) = default; // NOLINT(performance-noexcept-move-constructor)
223 
227  void Regrid (const DistributionMapping& dmap, const BoxArray& ba);
228  void Regrid (const DistributionMapping& dmap, const BoxArray& ba, int lev);
229  void Regrid (const Vector<DistributionMapping>& dmap, const Vector<BoxArray>& ba);
230 
234  void fillNeighbors ();
235 
240  void sumNeighbors (int real_start_comp, int real_num_comp,
241  int int_start_comp, int int_num_comp);
242 
246  void updateNeighbors (bool boundary_neighbors_only=false);
247 
251  void clearNeighbors ();
252 
256  template <class CheckPair>
257  void buildNeighborList (CheckPair const& check_pair, bool sort=false);
258 
262  template <class CheckPair, class OtherPCType>
263  void buildNeighborList (CheckPair const& check_pair, OtherPCType& other,
264  Vector<std::map<std::pair<int, int>, amrex::NeighborList<typename OtherPCType::ParticleType> > >& neighbor_lists,
265  bool sort=false);
266 
270  template <class CheckPair>
271  void buildNeighborList (CheckPair const& check_pair, int type_ind, int* ref_ratio,
272  int num_bin_types=1, bool sort=false);
273 
274  template <class CheckPair>
275  void selectActualNeighbors (CheckPair const& check_pair, int num_cells=1);
276 
277  void printNeighborList ();
278 
279  void setRealCommComp (int i, bool value);
280  void setIntCommComp (int i, bool value);
281 
282  ParticleTile& GetNeighbors (int lev, int grid, int tile)
283  {
284  return neighbors[lev][std::make_pair(grid,tile)];
285  }
286 
287  const ParticleTile& GetNeighbors (int lev, int grid, int tile) const
288  {
289  return neighbors[lev][std::make_pair(grid,tile)];
290  }
291 
292  template <typename T,
293  std::enable_if_t<std::is_same_v<T,bool>,int> = 0>
294  void AddRealComp (T communicate=true)
295  {
297  AddRealComp(communicate);
298  ghost_real_comp.push_back(communicate);
299  calcCommSize();
300  }
301 
302  template <typename T,
303  std::enable_if_t<std::is_same_v<T,bool>,int> = 0>
304  void AddIntComp (T communicate=true)
305  {
307  AddIntComp(communicate);
308  ghost_int_comp.push_back(communicate);
309  calcCommSize();
310  }
311 
312  void Redistribute (int lev_min=0, int lev_max=-1, int nGrow=0, int local=0)
313  {
314  clearNeighbors();
316  ::Redistribute(lev_min, lev_max, nGrow, local);
317  }
318 
320  {
321  const int lev_min = 0;
322  const int lev_max = 0;
323  const int nGrow = 0;
324  const int local = 1;
325  clearNeighbors();
326  this->Redistribute(lev_min, lev_max, nGrow, local);
327  }
328 
329 #ifdef AMREX_USE_GPU
330  void fillNeighborsGPU ();
331  void updateNeighborsGPU (bool boundary_neighbors_only=false);
332  void clearNeighborsGPU ();
333 #else
334  void fillNeighborsCPU ();
335  void sumNeighborsCPU (int real_start_comp, int real_num_comp,
336  int int_start_comp, int int_num_comp);
337  void updateNeighborsCPU (bool reuse_rcv_counts=true);
338  void clearNeighborsCPU ();
339 #endif
340 
341  void setEnableInverse (bool flag)
342  {
343  enable_inverse = flag;
344  calcCommSize();
345  }
346 
347  bool enableInverse () { return enable_inverse; }
348 
349  void buildNeighborMask ();
350 
351  void buildNeighborCopyOp (bool use_boundary_neighbor=false);
352 
353 protected:
354 
355  void cacheNeighborInfo ();
356 
360  void BuildMasks ();
361 
365  bool areMasksValid ();
366 
367  void GetNeighborCommTags ();
368 
369  void GetCommTagsBox (Vector<NeighborCommTag>& tags, int lev, const Box& in_box);
370 
371  void resizeContainers (int num_levels);
372 
373  void initializeCommComps ();
374 
375  void calcCommSize ();
376 
380  void fillNeighborsMPI (bool reuse_rcv_counts);
381 
382  void sumNeighborsMPI (std::map<int, Vector<char> >& not_ours,
383  int real_start_comp, int real_num_comp,
384  int int_start_comp, int int_num_comp);
385 
389  void getRcvCountsMPI ();
390 
392  const ParticleType& p,
393  int nGrow, const NeighborCopyTag& src_tag, const MyParIter& pti);
394 
396  const ParticleType& p,
397  const IntVect& nGrow, const NeighborCopyTag& src_tag, const MyParIter& pti);
398 
399  IntVect computeRefFac (int src_lev, int lev);
400 
404  static constexpr size_t pdata_size = sizeof(ParticleType);
405 
406  static constexpr int num_mask_comps = 3;
407  size_t cdata_size;
411 
414 
419  Long num_snds;
420  std::map<int, Vector<char> > send_data;
421 
424 
425  static bool use_mask;
426 
427  static bool enable_inverse;
428 
429 #ifdef AMREX_USE_GPU
430 
431  struct NeighborTask {
432  int grid_id;
435 
436  NeighborTask(int a_grid_id, const Box& a_box, const IntVect& a_periodic_shift)
437  : grid_id(a_grid_id), box(a_box), periodic_shift(a_periodic_shift) {}
438 
439  bool operator<(const NeighborTask& other) const {
440  if (grid_id != other.grid_id) { return grid_id < other.grid_id; }
441  if (box != other.box ) { return box < other.box; }
442  AMREX_D_TERM(
443  if (periodic_shift[0] != other.periodic_shift[0])
444  { return periodic_shift[0] < other.periodic_shift[0]; },
445  if (periodic_shift[1] != other.periodic_shift[1])
446  { return periodic_shift[1] < other.periodic_shift[1]; },
447  if (periodic_shift[2] != other.periodic_shift[2])
448  { return periodic_shift[2] < other.periodic_shift[2]; }
449  )
450  return false;
451  }
452  };
453 
454  // These are used to keep track of which particles need to be ghosted to which grids
456  std::unique_ptr<amrex::iMultiFab> m_neighbor_mask_ptr;
457  // {pboxid: [[neighbor codes] size= #intersected nbrs] size= #boundary boxes}
458  std::map<int, std::vector<std::vector<NeighborCode> > > m_grid_map;
459 
460  // {pboxid: [ith intersected pbox: nbr codes]}
461  std::map<int, amrex::Gpu::DeviceVector<NeighborCode> > m_code_array;
462  // {pboxid: [ith intersected pbox: intersection]}
463  std::map<int, amrex::Gpu::DeviceVector<Box> > m_isec_boxes;
464  std::map<int, amrex::Gpu::DeviceVector<int> > m_code_offsets; // to be removed
465 
468 
471 
474 #endif
475 
477 
479 
480  [[nodiscard]] bool hasNeighbors() const { return m_has_neighbors; }
481 
482  bool m_has_neighbors = false;
483 };
484 
486 
487 #ifdef AMREX_USE_GPU
489 #else
491 #endif
492 
493 }
494 
495 #endif // _NEIGHBORPARTICLES_H_
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
if(!(yy_init))
Definition: amrex_iparser.lex.nolint.H:935
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:550
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_NeighborList.H:247
Definition: AMReX_NeighborParticles.H:35
void GetNeighborCommTags()
Definition: AMReX_NeighborParticlesI.H:190
bool m_has_neighbors
Definition: AMReX_NeighborParticles.H:482
void RedistributeLocal()
Definition: AMReX_NeighborParticles.H:319
size_t cdata_size
Definition: AMReX_NeighborParticles.H:407
std::pair< int, int > PairIndex
Definition: AMReX_NeighborParticles.H:196
const ParticleTile & GetNeighbors(int lev, int grid, int tile) const
Definition: AMReX_NeighborParticles.H:287
std::unique_ptr< amrex::iMultiFab > m_neighbor_mask_ptr
Definition: AMReX_NeighborParticles.H:456
void updateNeighborsGPU(bool boundary_neighbors_only=false)
Definition: AMReX_NeighborParticlesGPUImpl.H:245
bool enableInverse()
Definition: AMReX_NeighborParticles.H:347
void selectActualNeighbors(CheckPair const &check_pair, int num_cells=1)
bool areMasksValid()
Definition: AMReX_NeighborParticlesI.H:127
typename ParticleContainerType::SuperParticleType SuperParticleType
Definition: AMReX_NeighborParticles.H:39
void Redistribute(int lev_min=0, int lev_max=-1, int nGrow=0, int local=0)
Definition: AMReX_NeighborParticles.H:312
Gpu::PinnedVector< char > pinned_snd_buffer
Definition: AMReX_NeighborParticles.H:472
static bool use_mask
Definition: AMReX_NeighborParticles.H:425
static bool enable_inverse
Definition: AMReX_NeighborParticles.H:427
void clearNeighbors()
Definition: AMReX_NeighborParticlesI.H:679
void fillNeighbors()
Definition: AMReX_NeighborParticlesI.H:637
Vector< std::map< PairIndex, ParticleTile > > neighbors
Definition: AMReX_NeighborParticles.H:402
Vector< NeighborCommTag > local_neighbors
Definition: AMReX_NeighborParticles.H:409
void AddRealComp(T communicate=true)
Definition: AMReX_NeighborParticles.H:294
ParticleCopyPlan neighbor_copy_plan
Definition: AMReX_NeighborParticles.H:467
typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::AoS AoS
Definition: AMReX_NeighborParticles.H:198
void buildNeighborCopyOp(bool use_boundary_neighbor=false)
Definition: AMReX_NeighborParticlesGPUImpl.H:120
ParticleCopyOp neighbor_copy_op
Definition: AMReX_NeighborParticles.H:466
NeighborParticleContainer & operator=(const NeighborParticleContainer &)=delete
void AddIntComp(T communicate=true)
Definition: AMReX_NeighborParticles.H:304
void cacheNeighborInfo()
Definition: AMReX_NeighborParticlesI.H:312
~NeighborParticleContainer() override=default
void fillNeighborsGPU()
Definition: AMReX_NeighborParticlesGPUImpl.H:225
ParIter< NStructReal, NStructInt, NArrayReal, NArrayInt > MyParIter
Definition: AMReX_NeighborParticles.H:195
Gpu::PinnedVector< char > pinned_rcv_buffer
Definition: AMReX_NeighborParticles.H:473
std::map< int, Vector< char > > send_data
Definition: AMReX_NeighborParticles.H:420
bool hasNeighbors() const
Definition: AMReX_NeighborParticles.H:480
typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::IntVector IntVector
Definition: AMReX_NeighborParticles.H:201
void resizeContainers(int num_levels)
Definition: AMReX_NeighborParticlesI.H:1112
void setIntCommComp(int i, bool value)
Definition: AMReX_NeighborParticlesI.H:66
ParticleTile & GetNeighbors(int lev, int grid, int tile)
Definition: AMReX_NeighborParticles.H:282
Vector< int > ghost_int_comp
Definition: AMReX_NeighborParticles.H:423
Vector< std::map< PairIndex, IntVector > > neighbor_list
Definition: AMReX_NeighborParticles.H:403
bool m_neighbor_mask_initialized
Definition: AMReX_NeighborParticles.H:455
std::map< int, std::vector< std::vector< NeighborCode > > > m_grid_map
Definition: AMReX_NeighborParticles.H:458
void updateNeighbors(bool boundary_neighbors_only=false)
Definition: AMReX_NeighborParticlesI.H:662
Vector< Long > rcvs
Definition: AMReX_NeighborParticles.H:418
void buildNeighborList(CheckPair const &check_pair, bool sort=false)
Vector< int > neighbor_procs
Definition: AMReX_NeighborParticles.H:417
Vector< std::map< std::pair< int, int >, amrex::Gpu::DeviceVector< int > > > m_boundary_particle_ids
Definition: AMReX_NeighborParticles.H:478
NeighborListContainerType m_neighbor_list
Definition: AMReX_NeighborParticles.H:476
void getRcvCountsMPI()
Definition: AMReX_NeighborParticlesCPUImpl.H:446
Vector< std::map< PairIndex, Vector< Vector< NeighborCopyTag > > > > buffer_tag_cache
Definition: AMReX_NeighborParticles.H:412
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)
Definition: AMReX_NeighborParticlesCPUImpl.H:108
void buildNeighborList(CheckPair const &check_pair, OtherPCType &other, Vector< std::map< std::pair< int, int >, amrex::NeighborList< typename OtherPCType::ParticleType > > > &neighbor_lists, bool sort=false)
void sumNeighbors(int real_start_comp, int real_num_comp, int int_start_comp, int int_num_comp)
Definition: AMReX_NeighborParticlesI.H:649
typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleTileType ParticleTile
Definition: AMReX_NeighborParticles.H:200
std::map< int, amrex::Gpu::DeviceVector< Box > > m_isec_boxes
Definition: AMReX_NeighborParticles.H:463
NeighborParticleContainer(NeighborParticleContainer &&)=default
amrex::PODVector< char, PolymorphicArenaAllocator< char > > snd_buffer
Definition: AMReX_NeighborParticles.H:469
static constexpr size_t pdata_size
Definition: AMReX_NeighborParticles.H:404
void getNeighborTags(Vector< NeighborCopyTag > &tags, const ParticleType &p, int nGrow, const NeighborCopyTag &src_tag, const MyParIter &pti)
Definition: AMReX_NeighborParticlesI.H:535
Long num_snds
Definition: AMReX_NeighborParticles.H:419
int m_num_neighbor_cells
Definition: AMReX_NeighborParticles.H:408
void setRealCommComp(int i, bool value)
Definition: AMReX_NeighborParticlesI.H:58
void initializeCommComps()
Definition: AMReX_NeighborParticlesI.H:45
void setEnableInverse(bool flag)
Definition: AMReX_NeighborParticles.H:341
void calcCommSize()
Definition: AMReX_NeighborParticlesI.H:74
void printNeighborList()
Definition: AMReX_NeighborParticlesI.H:1093
Vector< std::map< PairIndex, Vector< InverseCopyTag > > > inverse_tags
Definition: AMReX_NeighborParticles.H:401
typename ParticleContainerType::ParticleType ParticleType
Definition: AMReX_NeighborParticles.H:38
Vector< int > ghost_real_comp
Definition: AMReX_NeighborParticles.H:422
Vector< std::map< PairIndex, int > > local_neighbor_sizes
Definition: AMReX_NeighborParticles.H:413
void GetCommTagsBox(Vector< NeighborCommTag > &tags, int lev, const Box &in_box)
Definition: AMReX_NeighborParticlesI.H:265
void clearNeighborsGPU()
Definition: AMReX_NeighborParticlesGPUImpl.H:301
void buildNeighborMask()
Definition: AMReX_NeighborParticlesGPUImpl.H:51
void buildNeighborList(CheckPair const &check_pair, int type_ind, int *ref_ratio, int num_bin_types=1, bool sort=false)
Vector< std::unique_ptr< iMultiFab > > mask_ptr
Definition: AMReX_NeighborParticles.H:410
void Regrid(const DistributionMapping &dmap, const BoxArray &ba)
Definition: AMReX_NeighborParticlesI.H:93
std::map< int, amrex::Gpu::DeviceVector< int > > m_code_offsets
Definition: AMReX_NeighborParticles.H:464
std::map< int, amrex::Gpu::DeviceVector< NeighborCode > > m_code_array
Definition: AMReX_NeighborParticles.H:461
typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleVector ParticleVector
Definition: AMReX_NeighborParticles.H:199
NeighborParticleContainer(const NeighborParticleContainer &)=delete
std::map< NeighborCommTag, Vector< char > > NeighborCommMap
Definition: AMReX_NeighborParticles.H:197
static constexpr int num_mask_comps
grid, tile, level
Definition: AMReX_NeighborParticles.H:406
NeighborParticleContainer(ParGDBBase *gdb, int ncells)
Definition: AMReX_NeighborParticlesI.H:10
amrex::PODVector< char, PolymorphicArenaAllocator< char > > rcv_buffer
Definition: AMReX_NeighborParticles.H:470
IntVect computeRefFac(int src_lev, int lev)
Definition: AMReX_NeighborParticlesI.H:246
friend std::ostream & operator<<(std::ostream &os, const InverseCopyTag &tag)
Definition: AMReX_NeighborParticles.H:143
void fillNeighborsMPI(bool reuse_rcv_counts)
Definition: AMReX_NeighborParticlesCPUImpl.H:507
void BuildMasks()
Definition: AMReX_NeighborParticlesI.H:151
Definition: AMReX_PODVector.H:246
Definition: AMReX_ParGDB.H:13
Definition: AMReX_ParIter.H:113
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition: AMReX_ParticleContainer.H:145
void AddIntComp(std::string const &name, int communicate=1)
Definition: AMReX_ParticleContainer.H:1298
Particle< NStructReal+NArrayReal, NStructInt+NArrayInt > SuperParticleType
The type of the "SuperParticle" which stored all components in AoS form.
Definition: AMReX_ParticleContainer.H:170
typename ParticleTileType::AoS AoS
Definition: AMReX_ParticleContainer.H:187
typename AoS::ParticleVector ParticleVector
Definition: AMReX_ParticleContainer.H:192
typename SoA::IntVector IntVector
Definition: AMReX_ParticleContainer.H:191
void AddRealComp(std::string const &name, int communicate=1)
Definition: AMReX_ParticleContainer.H:1270
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:1100
T_ParticleType ParticleType
Definition: AMReX_ParticleContainer.H:147
Definition: AMReX_Amr.cpp:49
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition: AMReX.cpp:219
Definition: AMReX_NeighborParticles.H:16
IntVect periodic_shift
Definition: AMReX_NeighborParticles.H:18
int grid_id
Definition: AMReX_NeighborParticles.H:17
Definition: AMReX_NeighborParticles.H:136
int src_level
Definition: AMReX_NeighborParticles.H:140
int src_index
Definition: AMReX_NeighborParticles.H:139
int src_tile
Definition: AMReX_NeighborParticles.H:138
int src_grid
Definition: AMReX_NeighborParticles.H:137
Definition: AMReX_NeighborParticles.H:43
@ tile
Definition: AMReX_NeighborParticles.H:46
@ level
Definition: AMReX_NeighborParticles.H:47
@ grid
Definition: AMReX_NeighborParticles.H:45
Definition: AMReX_NeighborParticles.H:152
friend std::ostream & operator<<(std::ostream &os, const NeighborCommTag &tag)
Definition: AMReX_NeighborParticles.H:183
bool operator<(const NeighborCommTag &other) const
Definition: AMReX_NeighborParticles.H:163
NeighborCommTag(int pid, int lid, int gid, int tid)
Definition: AMReX_NeighborParticles.H:154
int level_id
Definition: AMReX_NeighborParticles.H:159
int tile_id
Definition: AMReX_NeighborParticles.H:161
bool operator==(const NeighborCommTag &other) const
Definition: AMReX_NeighborParticles.H:176
int grid_id
Definition: AMReX_NeighborParticles.H:160
int proc_id
Definition: AMReX_NeighborParticles.H:158
Definition: AMReX_NeighborParticles.H:82
bool operator==(const NeighborCopyTag &other) const
Definition: AMReX_NeighborParticles.H:111
bool operator<(const NeighborCopyTag &other) const
Definition: AMReX_NeighborParticles.H:96
friend std::ostream & operator<<(std::ostream &os, const NeighborCopyTag &tag)
Definition: AMReX_NeighborParticles.H:125
int src_index
Definition: AMReX_NeighborParticles.H:86
NeighborCopyTag(int a_level, int a_grid, int a_tile)
Definition: AMReX_NeighborParticles.H:92
int dst_index
Definition: AMReX_NeighborParticles.H:87
int tile
Definition: AMReX_NeighborParticles.H:85
bool operator!=(const NeighborCopyTag &other) const
Definition: AMReX_NeighborParticles.H:120
int grid
Definition: AMReX_NeighborParticles.H:84
int level
Definition: AMReX_NeighborParticles.H:83
IntVect periodic_shift
Definition: AMReX_NeighborParticles.H:88
Definition: AMReX_NeighborParticles.H:51
friend std::ostream & operator<<(std::ostream &os, const NeighborIndexMap &nim)
Definition: AMReX_NeighborParticles.H:69
int thread_num
Definition: AMReX_NeighborParticles.H:60
int src_level
Definition: AMReX_NeighborParticles.H:56
int src_index
Definition: AMReX_NeighborParticles.H:59
int dst_tile
Definition: AMReX_NeighborParticles.H:54
int src_grid
Definition: AMReX_NeighborParticles.H:57
int dst_index
Definition: AMReX_NeighborParticles.H:55
int dst_grid
Definition: AMReX_NeighborParticles.H:53
NeighborIndexMap(int dlevel, int dgrid, int dtile, int dindex, int slevel, int sgrid, int stile, int sindex, int tnum)
Definition: AMReX_NeighborParticles.H:62
int dst_level
Definition: AMReX_NeighborParticles.H:52
int src_tile
Definition: AMReX_NeighborParticles.H:58
Definition: AMReX_NeighborParticles.H:431
bool operator<(const NeighborTask &other) const
Definition: AMReX_NeighborParticles.H:439
IntVect periodic_shift
Definition: AMReX_NeighborParticles.H:434
Box box
Definition: AMReX_NeighborParticles.H:433
int grid_id
Definition: AMReX_NeighborParticles.H:432
NeighborTask(int a_grid_id, const Box &a_box, const IntVect &a_periodic_shift)
Definition: AMReX_NeighborParticles.H:436
Definition: AMReX_ParticleCommunication.H:58
Definition: AMReX_ParticleCommunication.H:81
Definition: AMReX_ParticleTile.H:693