Block-Structured AMR Software Framework
AMReX_ParticleContainer.H
Go to the documentation of this file.
1 #ifndef AMREX_PARTICLE_CONTAINER_H_
2 #define AMREX_PARTICLE_CONTAINER_H_
3 #include <AMReX_Config.H>
4 
6 #include <AMReX_ParmParse.H>
7 #include <AMReX_ParGDB.H>
8 #include <AMReX_REAL.H>
9 #include <AMReX_IntVect.H>
10 #include <AMReX_Array.H>
11 #include <AMReX_Vector.H>
12 #include <AMReX_Utility.H>
13 #include <AMReX_Geometry.H>
14 #include <AMReX_VisMF.H>
15 #include <AMReX_RealBox.H>
16 #include <AMReX_Print.H>
17 #include <AMReX_MultiFabUtil.H>
18 #include <AMReX_NFiles.H>
19 #include <AMReX_VectorIO.H>
20 #include <AMReX_Particle_mod_K.H>
21 #include <AMReX_ParticleMPIUtil.H>
22 #include <AMReX_StructOfArrays.H>
23 #include <AMReX_ArrayOfStructs.H>
24 #include <AMReX_Particle.H>
25 #include <AMReX_ParticleTile.H>
26 #include <AMReX_TypeTraits.H>
27 #include <AMReX_GpuContainers.H>
28 #include <AMReX_ParticleUtil.H>
29 #include <AMReX_ParticleReduce.H>
32 #include <AMReX_ParticleLocator.H>
33 #include <AMReX_Scan.H>
34 #include <AMReX_DenseBins.H>
35 #include <AMReX_SparseBins.H>
37 #include <AMReX_ParticleMesh.H>
38 #include <AMReX_OpenMP.H>
39 #include <AMReX_ParIter.H>
40 
41 #ifdef AMREX_LAZY
42 #include <AMReX_Lazy.H>
43 #endif
44 
45 #ifdef AMREX_USE_OMP
46 #include <omp.h>
47 #endif
48 
49 #ifdef AMREX_USE_HDF5
50 #include <hdf5.h>
51 #endif
52 
53 #include <algorithm>
54 #include <array>
55 #include <cstring>
56 #include <fstream>
57 #include <iostream>
58 #include <limits>
59 #include <map>
60 #include <memory>
61 #include <numeric>
62 #include <random>
63 #include <string>
64 #include <tuple>
65 #include <type_traits>
66 #include <utility>
67 #include <vector>
68 
69 namespace amrex {
70 
71 #ifdef AMREX_USE_HDF5_ASYNC
72  extern hid_t es_par_g;
73 #endif
79 {
80  using RealType = ParticleReal;
81  int m_lev;
82  int m_grid;
84  RealType m_data[1 + AMREX_SPACEDIM];
85 };
86 
91 {
92  int m_lev = -1;
93  int m_grid = -1;
94  int m_tile = -1;
99 };
100 
114 template<int NStructReal, int NStructInt, int NArrayReal, int NArrayInt>
116 {
117  std::array<double, NStructReal> real_struct_data;
118  std::array<int, NStructInt > int_struct_data;
119  std::array<double, NArrayReal > real_array_data;
120  std::array<int, NArrayInt > int_array_data;
121 };
122 
123 template <bool is_const, typename T_ParticleType, int NArrayReal, int NArrayInt,
124  template<class> class Allocator, class CellAssignor>
125 class ParIterBase_impl;
126 
140 template <typename T_ParticleType, int T_NArrayReal, int T_NArrayInt,
141  template<class> class Allocator=DefaultAllocator,
142  class T_CellAssignor=DefaultAssignor>
143 
145 {
146 public:
147  using ParticleType = T_ParticleType;
148  using ConstParticleType = typename ParticleType::ConstType;
149  using CellAssignor = T_CellAssignor;
150 
152  static constexpr int NStructReal = ParticleType::NReal;
154  static constexpr int NStructInt = ParticleType::NInt;
156  static constexpr int NArrayReal = T_NArrayReal;
158  static constexpr int NArrayInt = T_NArrayInt;
160 
161 private:
162  friend class ParIterBase_impl<true,ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>;
163  friend class ParIterBase_impl<false,ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>;
164 
165 public:
167  template <typename T>
168  using AllocatorType = Allocator<T>;
173 
174 #ifdef AMREX_SINGLE_PRECISION_PARTICLES
176 #else
178 #endif
179 
183 
186  using ParticleLevel = std::map<std::pair<int, int>, ParticleTileType>;
187  using AoS = typename ParticleTileType::AoS;
188  using SoA = typename ParticleTileType::SoA;
189 
190  using RealVector = typename SoA::RealVector;
191  using IntVector = typename SoA::IntVector;
192  using ParticleVector = typename AoS::ParticleVector;
196 
200  :
202  h_redistribute_real_comp(AMREX_SPACEDIM + NStructReal + NArrayReal, true),
204  {
205  Initialize ();
206  }
207 
216  :
218  h_redistribute_real_comp(AMREX_SPACEDIM + NStructReal + NArrayReal, true),
220  {
221  Initialize ();
224  }
225 
234  const DistributionMapping & dmap,
235  const BoxArray & ba)
236  :
237  ParticleContainerBase(geom, dmap, ba),
238  h_redistribute_real_comp(AMREX_SPACEDIM + NStructReal + NArrayReal, true),
240  {
241  Initialize ();
244  }
245 
256  const Vector<DistributionMapping> & dmap,
257  const Vector<BoxArray> & ba,
258  const Vector<int> & rr)
259  :
260  ParticleContainerBase(geom, dmap, ba, rr),
261  h_redistribute_real_comp(AMREX_SPACEDIM + NStructReal + NArrayReal, true),
263  {
264  Initialize ();
267  }
268 
278  const Vector<DistributionMapping> & dmap,
279  const Vector<BoxArray> & ba,
280  const Vector<IntVect> & rr)
281  :
282  ParticleContainerBase(geom, dmap, ba, rr),
283  h_redistribute_real_comp(AMREX_SPACEDIM + NStructReal + NArrayReal, true),
285  {
286  Initialize ();
289  }
290 
291  ~ParticleContainer_impl () override = default;
292 
295 
297  ParticleContainer_impl& operator= ( ParticleContainer_impl && ) noexcept = default;
298 
299 
307  void Define (ParGDBBase* gdb)
308  {
310  reserveData();
311  resizeData();
312  }
313 
321  void Define (const Geometry & geom,
322  const DistributionMapping & dmap,
323  const BoxArray & ba)
324  {
325  this->ParticleContainerBase::Define(geom, dmap, ba);
326  reserveData();
327  resizeData();
328  }
329 
339  void Define (const Vector<Geometry> & geom,
340  const Vector<DistributionMapping> & dmap,
341  const Vector<BoxArray> & ba,
342  const Vector<int> & rr)
343  {
344  this->ParticleContainerBase::Define(geom, dmap, ba, rr);
345  reserveData();
346  resizeData();
347  }
348 
358  void Define (const Vector<Geometry> & geom,
359  const Vector<DistributionMapping> & dmap,
360  const Vector<BoxArray> & ba,
361  const Vector<IntVect> & rr)
362  {
363  this->ParticleContainerBase::Define(geom, dmap, ba, rr);
364  reserveData();
365  resizeData();
366  }
367 
369  int numLocalTilesAtLevel (int lev) const {
370  return (lev < m_particles.size()) ? m_particles[lev].size() : 0;
371  }
372 
377  void reserveData () override;
378 
385  void resizeData () override;
386 
387  void InitFromAsciiFile (const std::string& file, int extradata,
388  const IntVect* Nrep = nullptr);
389 
390  void InitFromBinaryFile (const std::string& file, int extradata);
391 
392  void InitFromBinaryMetaFile (const std::string& file, int extradata);
393 
410  void InitRandom (Long icount, ULong iseed,
411  const ParticleInitData& pdata,
412  bool serialize = false, RealBox bx = RealBox());
413 
414 
430  void InitRandomPerBox (Long icount, ULong iseed, const ParticleInitData& pdata);
431 
432 
447  void InitOnePerCell (Real x_off, Real y_off, Real z_off,
448  const ParticleInitData& pdata);
449 
450 
462  void InitNRandomPerCell (int n_per_cell, const ParticleInitData& pdata);
463 
464  void Increment (MultiFab& mf, int level);
465 
466  Long IncrementWithTotal (MultiFab& mf, int level, bool local = false);
467 
504  void Redistribute (int lev_min = 0, int lev_max = -1, int nGrow = 0, int local=0,
505  bool remove_negative=true);
506 
507 
519  template <class index_type>
520  void ReorderParticles (int lev, const MFIter& mfi, const index_type* permutations);
521 
536  void SortParticlesForDeposition (IntVect idx_type);
537 
541  void SortParticlesByCell ();
542 
549  void SortParticlesByBin (IntVect bin_size);
550 
561  bool OK (int lev_min = 0, int lev_max = -1, int nGrow = 0) const;
562 
563  std::array<Long, 3> ByteSpread () const;
564 
565  std::array<Long, 3> PrintCapacity () const;
566 
567  void ShrinkToFit ();
568 
579  Long NumberOfParticlesAtLevel (int level, bool only_valid = true, bool only_local = false) const;
580 
581  Vector<Long> NumberOfParticlesInGrid (int level, bool only_valid = true, bool only_local = false) const;
582 
591  Long TotalNumberOfParticles (bool only_valid=true, bool only_local=false) const;
592 
593 
601  void RemoveParticlesAtLevel (int level);
602 
604 
612  void CreateVirtualParticles (int level, AoS& virts) const;
613 
622  void CreateGhostParticles (int level, int ngrow, AoS& ghosts) const;
623 
631  void AddParticlesAtLevel (AoS& particles, int level, int nGrow=0);
632 
640  void CreateVirtualParticles (int level, ParticleTileType& virts) const;
641 
650  void CreateGhostParticles (int level, int ngrow, ParticleTileType& ghosts) const;
651 
659  void AddParticlesAtLevel (ParticleTileType& particles, int level, int nGrow=0);
660 
661 
665  void clearParticles ();
666 
667 
676  template <class PCType,
677  std::enable_if_t<IsParticleContainer<PCType>::value, int> foo = 0>
678  void copyParticles (const PCType& other, bool local=false);
679 
687  template <class PCType,
688  std::enable_if_t<IsParticleContainer<PCType>::value, int> foo = 0>
689  void addParticles (const PCType& other, bool local=false);
690 
705  template <class F, class PCType,
706  std::enable_if_t<IsParticleContainer<PCType>::value, int> foo = 0,
707  std::enable_if_t<! std::is_integral_v<F>, int> bar = 0>
708  void copyParticles (const PCType& other, F&&f, bool local=false);
709 
723  template <class F, class PCType,
724  std::enable_if_t<IsParticleContainer<PCType>::value, int> foo = 0,
725  std::enable_if_t<! std::is_integral_v<F>, int> bar = 0>
726  void addParticles (const PCType& other, F const& f, bool local=false);
727 
735  void WriteParticleRealData (void* data, size_t size, std::ostream& os) const;
736 
745  void ReadParticleRealData (void* data, size_t size, std::istream& is);
746 
755  void Checkpoint (const std::string& dir, const std::string& name,
756  const Vector<std::string>& real_comp_names = Vector<std::string>(),
757  const Vector<std::string>& int_comp_names = Vector<std::string>()) const
758  {
759  Checkpoint(dir, name, true, real_comp_names, int_comp_names);
760  }
761 
767  void Checkpoint (const std::string& dir, const std::string& name, bool is_checkpoint,
768  const Vector<std::string>& real_comp_names = Vector<std::string>(),
769  const Vector<std::string>& int_comp_names = Vector<std::string>()) const;
770 
783  void Checkpoint (const std::string& dir, const std::string& name,
784  const Vector<int>& write_real_comp,
785  const Vector<int>& write_int_comp,
786  const Vector<std::string>& real_comp_names,
787  const Vector<std::string>& int_comp_names) const;
788 
803  template <class F>
804  void WriteBinaryParticleData (const std::string& dir,
805  const std::string& name,
806  const Vector<int>& write_real_comp,
807  const Vector<int>& write_int_comp,
808  const Vector<std::string>& real_comp_names,
809  const Vector<std::string>& int_comp_names,
810  F&& f, bool is_checkpoint=false) const;
811 
812  void CheckpointPre ();
813 
814  void CheckpointPost ();
815 
822  void Restart (const std::string& dir, const std::string& file);
823 
831  void Restart (const std::string& dir, const std::string& file, bool is_checkpoint);
832 
839  void WritePlotFile (const std::string& dir, const std::string& name) const;
840 
852  template <class F, std::enable_if_t<!std::is_same_v<std::decay_t<F>, Vector<std::string>>>* = nullptr>
853  void WritePlotFile (const std::string& dir, const std::string& name, F&& f) const;
854 
863  void WritePlotFile (const std::string& dir, const std::string& name,
864  const Vector<std::string>& real_comp_names,
865  const Vector<std::string>& int_comp_names) const;
866 
880  template <class F>
881  void WritePlotFile (const std::string& dir, const std::string& name,
882  const Vector<std::string>& real_comp_names,
883  const Vector<std::string>& int_comp_names, F&& f) const;
884 
893  void WritePlotFile (const std::string& dir, const std::string& name,
894  const Vector<std::string>& real_comp_names) const;
895 
909  template <class F, std::enable_if_t<!std::is_same_v<std::decay_t<F>, Vector<std::string>>>* = nullptr>
910  void WritePlotFile (const std::string& dir, const std::string& name,
911  const Vector<std::string>& real_comp_names, F&& f) const;
912 
922  void WritePlotFile (const std::string& dir,
923  const std::string& name,
924  const Vector<int>& write_real_comp,
925  const Vector<int>& write_int_comp) const;
926 
941  template <class F>
942  void WritePlotFile (const std::string& dir,
943  const std::string& name,
944  const Vector<int>& write_real_comp,
945  const Vector<int>& write_int_comp, F&& f) const;
946 
960  void WritePlotFile (const std::string& dir,
961  const std::string& name,
962  const Vector<int>& write_real_comp,
963  const Vector<int>& write_int_comp,
964  const Vector<std::string>& real_comp_names,
965  const Vector<std::string>& int_comp_names) const;
966 
985  template <class F>
986  void WritePlotFile (const std::string& dir,
987  const std::string& name,
988  const Vector<int>& write_real_comp,
989  const Vector<int>& write_int_comp,
990  const Vector<std::string>& real_comp_names,
991  const Vector<std::string>& int_comp_names,
992  F&& f) const;
993 
994  void WritePlotFilePre ();
995 
996  void WritePlotFilePost ();
997 
998  void WriteAsciiFile (const std::string& file);
999 
1004  const Vector<ParticleLevel>& GetParticles () const { return m_particles; }
1005 
1011 
1025  const ParticleLevel& GetParticles (int lev) const { return m_particles[lev]; }
1026 
1040  ParticleLevel & GetParticles (int lev) { return m_particles[lev]; }
1041 
1064  const ParticleTileType& ParticlesAt (int lev, int grid, int tile) const
1065  { return m_particles[lev].at(std::make_pair(grid, tile)); }
1066 
1089  ParticleTileType& ParticlesAt (int lev, int grid, int tile)
1090  { return m_particles[lev].at(std::make_pair(grid, tile)); }
1091 
1113  template <class Iterator>
1114  const ParticleTileType& ParticlesAt (int lev, const Iterator& iter) const
1115  { return ParticlesAt(lev, iter.index(), iter.LocalTileIndex()); }
1116 
1138  template <class Iterator>
1139  ParticleTileType& ParticlesAt (int lev, const Iterator& iter)
1140  { return ParticlesAt(lev, iter.index(), iter.LocalTileIndex()); }
1141 
1164  ParticleTileType& DefineAndReturnParticleTile (int lev, int grid, int tile)
1165  {
1166  m_particles[lev][std::make_pair(grid, tile)].define(NumRuntimeRealComps(), NumRuntimeIntComps(), &m_soa_rdata_names, &m_soa_idata_names);
1167 
1168  return ParticlesAt(lev, grid, tile);
1169  }
1170 
1192  template <class Iterator>
1193  ParticleTileType& DefineAndReturnParticleTile (int lev, const Iterator& iter)
1194  {
1195  auto index = std::make_pair(iter.index(), iter.LocalTileIndex());
1196  m_particles[lev][index].define(NumRuntimeRealComps(), NumRuntimeIntComps());
1197  return ParticlesAt(lev, iter);
1198  }
1199 
1210  void AssignDensity (int rho_index,
1211  Vector<std::unique_ptr<MultiFab> >& mf_to_be_filled,
1212  int lev_min, int ncomp, int finest_level, int ngrow=2) const;
1213 
1214  void AssignCellDensitySingleLevel (int rho_index, MultiFab& mf, int level,
1215  int ncomp=1, int particle_lvl_offset = 0) const;
1216 
1217  template <typename P, typename Assignor=CellAssignor>
1218  IntVect Index (const P& p, int lev) const;
1219 
1229  ParticleLocData Reset (ParticleType& prt, bool update, bool verbose=true,
1230  ParticleLocData pld = ParticleLocData()) const;
1231 
1237  template <typename P>
1238  bool PeriodicShift (P& p) const;
1239 
1241 
1243 
1244  void SetUsePrePost (bool tf) const {
1245  usePrePost = tf;
1246  }
1247  bool GetUsePrePost () const {
1248  return usePrePost;
1249  }
1250 
1251  int GetMaxNextIDPrePost () const { return maxnextidPrePost; }
1252  Long GetNParticlesPrePost () const { return nparticlesPrePost; }
1253 
1254  void SetUseUnlink (bool tf) const {
1255  doUnlink = tf;
1256  }
1257 
1258  bool GetUseUnlink () const {
1259  return doUnlink;
1260  }
1261 
1262  void RedistributeCPU (int lev_min = 0, int lev_max = -1, int nGrow = 0, int local=0,
1263  bool remove_negative=true);
1264 
1265  void RedistributeGPU (int lev_min = 0, int lev_max = -1, int nGrow = 0, int local=0,
1266  bool remove_negative=true);
1267 
1268  Long superParticleSize() const { return superparticle_size; }
1269 
1270  void AddRealComp (std::string const & name, int communicate=1)
1271  {
1272  m_soa_rdata_names.push_back(name);
1273 
1274  m_runtime_comps_defined = true;
1276  h_redistribute_real_comp.push_back(communicate);
1277  SetParticleSize();
1278  this->resizeData();
1279 
1280  // resize runtime SoA
1281  for (int lev = 0; lev < numLevels(); ++lev) {
1282  for (ParIterType pti(*this,lev); pti.isValid(); ++pti) {
1283  auto& tile = DefineAndReturnParticleTile(lev, pti);
1284  auto np = tile.numParticles();
1285  if (np > 0) {
1286  auto& soa = tile.GetStructOfArrays();
1287  soa.resize(np);
1288  }
1289  }
1290  }
1291  }
1292 
1293  void AddRealComp (int communicate=1)
1294  {
1295  AddRealComp(getDefaultCompNameReal<ParticleType>(NArrayReal+m_num_runtime_real), communicate);
1296  }
1297 
1298  void AddIntComp (std::string const & name, int communicate=1)
1299  {
1300  m_soa_idata_names.push_back(name);
1301 
1302  m_runtime_comps_defined = true;
1304  h_redistribute_int_comp.push_back(communicate);
1305  SetParticleSize();
1306  this->resizeData();
1307 
1308  // resize runtime SoA
1309  for (int lev = 0; lev < numLevels(); ++lev) {
1310  for (ParIterType pti(*this,lev); pti.isValid(); ++pti) {
1311  auto& tile = DefineAndReturnParticleTile(lev, pti);
1312  auto np = tile.numParticles();
1313  if (np > 0) {
1314  auto& soa = tile.GetStructOfArrays();
1315  soa.resize(np);
1316  }
1317  }
1318  }
1319  }
1320 
1321  void AddIntComp (int communicate=1)
1322  {
1323  AddIntComp(getDefaultCompNameInt<ParticleType>(NArrayInt+m_num_runtime_int), communicate);
1324  }
1325 
1326  int NumRuntimeRealComps () const { return m_num_runtime_real; }
1327  int NumRuntimeIntComps () const { return m_num_runtime_int; }
1328 
1329  int NumRealComps () const { return NArrayReal + NumRuntimeRealComps(); }
1330  int NumIntComps () const { return NArrayInt + NumRuntimeIntComps() ; }
1331 
1337  void ResizeRuntimeRealComp (int new_size, bool communicate);
1338 
1344  void ResizeRuntimeIntComp (int new_size, bool communicate);
1345 
1347  template <template<class> class NewAllocator=amrex::DefaultAllocator>
1349 
1360  template <template<class> class NewAllocator=amrex::DefaultAllocator>
1362  make_alike () const
1363  {
1365 
1366  // add runtime real comps to tmp
1367  for (int ic = 0; ic < this->NumRuntimeRealComps(); ++ic) { tmp.AddRealComp(false); }
1368 
1369  // add runtime int comps to tmp
1370  for (int ic = 0; ic < this->NumRuntimeIntComps(); ++ic) { tmp.AddIntComp(false); }
1371 
1372  return tmp;
1373  }
1374 
1377 
1380  mutable bool usePrePost;
1381  mutable bool doUnlink;
1383  mutable int nOutFilesPrePost;
1389  mutable std::string HdrFileNamePrePost;
1391 
1392 protected:
1393 
1407  template <typename P>
1408  bool Where (const P& prt, ParticleLocData& pld,
1409  int lev_min = 0, int lev_max = -1, int nGrow=0, int local_grid=-1) const;
1410 
1411 
1422  template <typename P>
1424  int lev_min = 0, int lev_max = -1, int local_grid=-1) const;
1425 
1426 public:
1427  void
1428  WriteParticles (int level, std::ofstream& ofs, int fnum,
1429  Vector<int>& which, Vector<int>& count, Vector<Long>& where,
1430  const Vector<int>& write_real_comp, const Vector<int>& write_int_comp,
1431  const Vector<std::map<std::pair<int, int>,IntVector>>& particle_io_flags, bool is_checkpoint) const;
1432 #ifdef AMREX_USE_HDF5
1433 #include "AMReX_ParticlesHDF5.H"
1434 #endif
1435 
1437  void SetSoACompileTimeNames (std::vector<std::string> const & rdata_name, std::vector<std::string> const & idata_name);
1438 
1440  std::vector<std::string> GetRealSoANames () const {return m_soa_rdata_names;}
1441 
1443  std::vector<std::string> GetIntSoANames () const {return m_soa_idata_names;}
1444 
1445 protected:
1446 
1447  template <class RTYPE>
1448  void ReadParticles (int cnt, int grd, int lev, std::ifstream& ifs, int finest_level_in_file, bool convert_ids);
1449 
1450  void SetParticleSize ();
1451 
1453 
1454 private:
1455  virtual void particlePostLocate (ParticleType& /*p*/, const ParticleLocData& /*pld*/,
1456  const int /*lev*/) {}
1457 
1458  virtual void correctCellVectors (int /*old_index*/, int /*new_index*/,
1459  int /*grid*/, const ParticleType& /*p*/) {}
1460 
1461  void RedistributeMPI (std::map<int, Vector<char> >& not_ours,
1462  int lev_min = 0, int lev_max = 0, int nGrow = 0, int local=0);
1463 
1464  template <typename P>
1466  int lev_min, int lev_max, int nGrow, int local_grid=-1) const;
1467 
1468  void Initialize ();
1469 
1473 
1477 
1478  // names of both compile-time and runtime Real and Int SoA data
1479  std::vector<std::string> m_soa_rdata_names;
1480  std::vector<std::string> m_soa_idata_names;
1481 };
1482 
1483 template <int T_NStructReal, int T_NStructInt, int T_NArrayReal, int T_NArrayInt, template<class> class Allocator, class CellAssignor>
1484 using ParticleContainer = ParticleContainer_impl<Particle<T_NStructReal, T_NStructInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;
1485 
1486 template <int T_NArrayReal, int T_NArrayInt, template<class> class Allocator=DefaultAllocator, class CellAssignor=DefaultAssignor>
1487 using ParticleContainerPureSoA = ParticleContainer_impl<SoAParticle<T_NArrayReal, T_NArrayInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;
1488 
1489 
1490 #include "AMReX_ParticleInit.H"
1491 #include "AMReX_ParticleContainerI.H"
1492 #include "AMReX_ParticleIO.H"
1493 
1494 #ifdef AMREX_USE_HDF5
1495 #include "AMReX_ParticleHDF5.H"
1496 #endif
1497 
1498 }
1499 
1500 #endif /*_PARTICLES_H_*/
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
Definition: AMReX_GpuAllocators.H:114
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:550
A container for storing items in a set of bins.
Definition: AMReX_DenseBins.H:77
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
static const RealDescriptor & Native64RealDescriptor()
Definition: AMReX_FPC.cpp:137
static const RealDescriptor & Native32RealDescriptor()
NativeRealDescriptor is equivalent to Native32RealDescriptor if BL_FLOAT is used. Otherwise,...
Definition: AMReX_FPC.cpp:124
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_MFIter.H:57
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition: AMReX_MFIter.H:141
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_PODVector.H:246
Definition: AMReX_ParIter.H:142
Definition: AMReX_ParGDB.H:13
Definition: AMReX_ParIter.H:32
Definition: AMReX_ParIter.H:113
Definition: AMReX_ParticleContainerBase.H:23
ParGDBBase * m_gdb
Definition: AMReX_ParticleContainerBase.H:269
void Define(ParGDBBase *gdb)
Definition: AMReX_ParticleContainerBase.H:83
int numLevels() const
the number of defined levels in the ParticleContainer
Definition: AMReX_ParticleContainerBase.H:222
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition: AMReX_ParticleContainer.H:145
void AssignDensity(int rho_index, Vector< std::unique_ptr< MultiFab > > &mf_to_be_filled, int lev_min, int ncomp, int finest_level, int ngrow=2) const
Functions depending the layout of the data. Use with caution.
Definition: AMReX_AmrParticles.H:17
void SetUseUnlink(bool tf) const
Definition: AMReX_ParticleContainer.H:1254
Vector< ParticleLevel > m_particles
Definition: AMReX_ParticleContainer.H:1476
Vector< Long > nParticlesAtLevelPrePost
Definition: AMReX_ParticleContainer.H:1385
void WriteBinaryParticleData(const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names, F &&f, bool is_checkpoint=false) const
Writes particle data to disk in the AMReX native format.
void InitFromBinaryFile(const std::string &file, int extradata)
Definition: AMReX_ParticleInit.H:483
bool GetLevelDirectoriesCreated() const
Definition: AMReX_ParticleContainer.H:1242
size_t superparticle_size
Definition: AMReX_ParticleContainer.H:1474
void AddIntComp(std::string const &name, int communicate=1)
Definition: AMReX_ParticleContainer.H:1298
std::array< Long, 3 > ByteSpread() const
Definition: AMReX_ParticleContainerI.H:501
void clearParticles()
Clear all the particles in this container. This does not free memory.
Definition: AMReX_ParticleContainerI.H:1010
void copyParticles(const PCType &other, bool local=false)
Copy particles from other to this ParticleContainer. Will clear all the particles from this container...
bool doUnlink
Definition: AMReX_ParticleContainer.H:1381
Vector< Vector< int > > whichPrePost
Definition: AMReX_ParticleContainer.H:1386
void WriteParticleRealData(void *data, size_t size, std::ostream &os) const
Write a contiguous chunk of real particle data to an ostream.
Definition: AMReX_ParticleIO.H:11
const ParticleTileType & ParticlesAt(int lev, const Iterator &iter) const
Return the ParticleTile for level "lev" and Iterator "iter". Const version.
Definition: AMReX_ParticleContainer.H:1114
ParticleContainer_impl(const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< IntVect > &rr)
Same as the above, but accepts different refinement ratios in each direction.
Definition: AMReX_ParticleContainer.H:277
std::string HdrFileNamePrePost
Definition: AMReX_ParticleContainer.H:1389
Vector< Vector< Long > > wherePrePost
Definition: AMReX_ParticleContainer.H:1388
void WritePlotFile(const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, F &&f) const
This version of WritePlotFile writes all components and allows the user to specify the names of the c...
RealDescriptor ParticleRealDescriptor
Definition: AMReX_ParticleContainer.H:177
ParticleTileType & DefineAndReturnParticleTile(int lev, int grid, int tile)
Define and return the ParticleTile for level "lev", grid "grid" and tile "tile.".
Definition: AMReX_ParticleContainer.H:1164
int nOutFilesPrePost
Definition: AMReX_ParticleContainer.H:1383
int maxnextidPrePost
Definition: AMReX_ParticleContainer.H:1382
void WritePlotFile(const std::string &dir, const std::string &name, F &&f) const
This version of WritePlotFile writes all components and assigns component names.
ParticleContainer_impl(ParticleContainer_impl &&) noexcept=default
void Checkpoint(const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names=Vector< std::string >(), const Vector< std::string > &int_comp_names=Vector< std::string >()) const
Writes a particle checkpoint to file, suitable for restarting.
Definition: AMReX_ParticleContainer.H:755
void addParticles(const PCType &other, bool local=false)
Add particles from other to this ParticleContainer. local controls whether or not to call Redistribut...
std::map< std::pair< int, int >, ParticleTileType > ParticleLevel
Definition: AMReX_ParticleContainer.H:186
bool levelDirectoriesCreated
Variables for i/o optimization saved for pre and post checkpoint.
Definition: AMReX_ParticleContainer.H:1379
ContainerLike< NewAllocator > make_alike() const
Definition: AMReX_ParticleContainer.H:1362
void WriteAsciiFile(const std::string &file)
Definition: AMReX_ParticleIO.H:1119
std::vector< std::string > m_soa_idata_names
Definition: AMReX_ParticleContainer.H:1480
static constexpr int NArrayInt
Number of extra integer components stored in struct-of-array form.
Definition: AMReX_ParticleContainer.H:158
void Initialize()
Definition: AMReX_ParticleContainerI.H:37
static constexpr int NArrayReal
Number of extra Real components stored in struct-of-array form.
Definition: AMReX_ParticleContainer.H:156
int GetMaxNextIDPrePost() const
Definition: AMReX_ParticleContainer.H:1251
std::array< Long, 3 > PrintCapacity() const
Definition: AMReX_ParticleContainerI.H:545
bool GetUsePrePost() const
Definition: AMReX_ParticleContainer.H:1247
ParticleContainer_impl & operator=(const ParticleContainer_impl &)=delete
bool PeriodicShift(P &p) const
Returns true if the particle was shifted.
typename ParticleTileType::AoS AoS
Definition: AMReX_ParticleContainer.H:187
ParticleInitType< NStructReal, NStructInt, NArrayReal, NArrayInt > ParticleInitData
Definition: AMReX_ParticleContainer.H:182
typename SoA::RealVector RealVector
Definition: AMReX_ParticleContainer.H:190
typename ParticleType::ConstType ConstParticleType
Definition: AMReX_ParticleContainer.H:148
ParticleContainer_impl(const ParticleContainer_impl &)=delete
void WriteParticles(int level, std::ofstream &ofs, int fnum, Vector< int > &which, Vector< int > &count, Vector< Long > &where, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, const Vector< std::map< std::pair< int, int >, IntVector >> &particle_io_flags, bool is_checkpoint) const
Definition: AMReX_ParticleIO.H:571
ParticleContainer_impl(const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba)
Construct a particle container using a given Geometry, DistributionMapping, and BoxArray....
Definition: AMReX_ParticleContainer.H:233
Long NumberOfParticlesAtLevel(int level, bool only_valid=true, bool only_local=false) const
Returns # of particles at specified the level.
Definition: AMReX_ParticleContainerI.H:455
void AssignCellDensitySingleLevel(int rho_index, MultiFab &mf, int level, int ncomp=1, int particle_lvl_offset=0) const
Definition: AMReX_ParticleContainerI.H:2401
void Increment(MultiFab &mf, int level)
Definition: AMReX_ParticleContainerI.H:605
void SetLevelDirectoriesCreated(bool tf)
Definition: AMReX_ParticleContainer.H:1240
void ReorderParticles(int lev, const MFIter &mfi, const index_type *permutations)
Reorder particles on the tile given by lev and mfi using a the permutations array.
typename AoS::ParticleVector ParticleVector
Definition: AMReX_ParticleContainer.H:192
const ParticleLevel & GetParticles(int lev) const
Return the ParticleLevel for level "lev". Const version.
Definition: AMReX_ParticleContainer.H:1025
void Define(const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba)
Define a default-constructed ParticleContainer using a ParGDB object. Single-level version.
Definition: AMReX_ParticleContainer.H:321
static constexpr int NStructInt
Number of extra integer components in the particle struct.
Definition: AMReX_ParticleContainer.H:154
ParticleContainer_impl()
Default constructor - construct an empty particle container that has no concept of a level hierarchy....
Definition: AMReX_ParticleContainer.H:199
void SetUsePrePost(bool tf) const
Definition: AMReX_ParticleContainer.H:1244
int NumRealComps() const
Definition: AMReX_ParticleContainer.H:1329
void WritePlotFilePre()
Definition: AMReX_ParticleIO.H:551
bool EnforcePeriodicWhere(P &prt, ParticleLocData &pld, int lev_min=0, int lev_max=-1, int local_grid=-1) const
Checks whether the particle has crossed a periodic boundary in such a way that it is on levels lev_mi...
void RemoveParticlesAtLevel(int level)
The Following methods are for managing Virtual and Ghost Particles.
Definition: AMReX_ParticleContainerI.H:642
void InitFromAsciiFile(const std::string &file, int extradata, const IntVect *Nrep=nullptr)
Definition: AMReX_ParticleInit.H:37
ParticleTileType & DefineAndReturnParticleTile(int lev, const Iterator &iter)
Define and return the ParticleTile for level "lev", and Iterator "iter".
Definition: AMReX_ParticleContainer.H:1193
Long TotalNumberOfParticles(bool only_valid=true, bool only_local=false) const
Returns # of particles at all levels.
Definition: AMReX_ParticleContainerI.H:385
Vector< int > h_redistribute_int_comp
Definition: AMReX_ParticleContainer.H:1376
std::vector< std::string > m_soa_rdata_names
Definition: AMReX_ParticleContainer.H:1479
typename ParticleTileType::SoA SoA
Definition: AMReX_ParticleContainer.H:188
virtual void correctCellVectors(int, int, int, const ParticleType &)
Definition: AMReX_ParticleContainer.H:1458
void WritePlotFile(const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names, F &&f) const
This version of WritePlotFile writes all components and allows the user to specify the names of the c...
bool OK(int lev_min=0, int lev_max=-1, int nGrow=0) const
OK checks that all particles are in the right places (for some value of right)
Definition: AMReX_ParticleContainerI.H:2340
void locateParticle(P &p, ParticleLocData &pld, int lev_min, int lev_max, int nGrow, int local_grid=-1) const
int NumRuntimeIntComps() const
Definition: AMReX_ParticleContainer.H:1327
Long GetNParticlesPrePost() const
Definition: AMReX_ParticleContainer.H:1252
void InitRandom(Long icount, ULong iseed, const ParticleInitData &pdata, bool serialize=false, RealBox bx=RealBox())
This initializes the particle container with icount randomly distributed particles....
Definition: AMReX_ParticleInit.H:968
void ResizeRuntimeRealComp(int new_size, bool communicate)
Definition: AMReX_ParticleContainerI.H:2541
T_CellAssignor CellAssignor
Definition: AMReX_ParticleContainer.H:149
void RemoveParticlesNotAtFinestLevel()
Definition: AMReX_ParticleContainerI.H:656
DenseBins< typename ParticleTileType::ParticleTileDataType > m_bins
Definition: AMReX_ParticleContainer.H:1452
void ReadParticleRealData(void *data, size_t size, std::istream &is)
Read a contiguous chunk of real particle data from an istream.
Definition: AMReX_ParticleIO.H:25
void RedistributeCPU(int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true)
Definition: AMReX_ParticleContainerI.H:1479
int m_num_runtime_int
Definition: AMReX_ParticleContainer.H:1472
ParticleContainer_impl(ParGDBBase *gdb)
Construct a particle container using a ParGDB object. The container will track changes in the grid st...
Definition: AMReX_ParticleContainer.H:215
void Restart(const std::string &dir, const std::string &file)
Restart from checkpoint.
Definition: AMReX_ParticleIO.H:635
void WritePlotFilePost()
Definition: AMReX_ParticleIO.H:561
void Define(const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< IntVect > &rr)
Define a default-constructed ParticleContainer using a ParGDB object. Multi-level version.
Definition: AMReX_ParticleContainer.H:358
void ReadParticles(int cnt, int grd, int lev, std::ifstream &ifs, int finest_level_in_file, bool convert_ids)
void CreateVirtualParticles(int level, AoS &virts) const
Creates virtual particles for a given level that represent in some capacity all particles at finer le...
Definition: AMReX_ParticleContainerI.H:723
int NumRuntimeRealComps() const
Definition: AMReX_ParticleContainer.H:1326
void Checkpoint(const std::string &dir, const std::string &name, bool is_checkpoint, const Vector< std::string > &real_comp_names=Vector< std::string >(), const Vector< std::string > &int_comp_names=Vector< std::string >()) const
Writes a particle checkpoint to file, suitable for restarting. This version allows the particle compo...
void AddIntComp(int communicate=1)
Definition: AMReX_ParticleContainer.H:1321
Long nparticlesPrePost
Definition: AMReX_ParticleContainer.H:1384
void InitNRandomPerCell(int n_per_cell, const ParticleInitData &pdata)
This initializes the particle container with n_per_cell randomly distributed particles per cell,...
Definition: AMReX_ParticleInit.H:1547
void WritePlotFile(const std::string &dir, const std::string &name) const
This version of WritePlotFile writes all components and assigns component names.
Definition: AMReX_ParticleIO.H:108
void WritePlotFile(const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, F &&f) const
This version of WritePlotFile assigns component names, but allows the user to pass in a vector of int...
int m_num_runtime_real
Definition: AMReX_ParticleContainer.H:1471
void copyParticles(const PCType &other, F &&f, bool local=false)
Copy particles from other to this ParticleContainer. Will clear all the particles from this container...
void CheckpointPre()
Definition: AMReX_ParticleIO.H:438
ParticleLocData Reset(ParticleType &prt, bool update, bool verbose=true, ParticleLocData pld=ParticleLocData()) const
Updates a particle's location (Where), tries to periodic shift any particles that have left the domai...
Definition: AMReX_ParticleContainerI.H:296
Vector< std::string > filePrefixPrePost
Definition: AMReX_ParticleContainer.H:1390
void RedistributeGPU(int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true)
Definition: AMReX_ParticleContainerI.H:1283
int numLocalTilesAtLevel(int lev) const
The total number of tiles on this rank on this level.
Definition: AMReX_ParticleContainer.H:369
void reserveData() override
This reserves data in the vector of dummy MultiFabs used by the ParticleContainer for the maximum num...
Definition: AMReX_ParticleContainerI.H:330
void WritePlotFile(const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names, F &&f) const
This is the most general version of WritePlotFile, which takes component names and flags for whether ...
std::vector< std::string > GetRealSoANames() const
Definition: AMReX_ParticleContainer.H:1440
static constexpr int NStructReal
Number of extra Real components in the particle struct.
Definition: AMReX_ParticleContainer.H:152
Vector< int > h_redistribute_real_comp
Definition: AMReX_ParticleContainer.H:1375
std::vector< std::string > GetIntSoANames() const
Definition: AMReX_ParticleContainer.H:1443
typename Particle< NStructReal, NStructInt >::RealType RealType
The type of the Real data.
Definition: AMReX_ParticleContainer.H:172
bool GetUseUnlink() const
Definition: AMReX_ParticleContainer.H:1258
Vector< Long > NumberOfParticlesInGrid(int level, bool only_valid=true, bool only_local=false) const
Definition: AMReX_ParticleContainerI.H:400
int NumIntComps() const
Definition: AMReX_ParticleContainer.H:1330
Allocator< T > AllocatorType
The memory allocator in use.
Definition: AMReX_ParticleContainer.H:168
void RedistributeMPI(std::map< int, Vector< char > > &not_ours, int lev_min=0, int lev_max=0, int nGrow=0, int local=0)
Definition: AMReX_ParticleContainerI.H:1993
ParticleLevel & GetParticles(int lev)
Return the ParticleLevel for level "lev". Non-const version.
Definition: AMReX_ParticleContainer.H:1040
void CreateGhostParticles(int level, int ngrow, ParticleTileType &ghosts) const
Create ghost particles for a given level that are copies of particles near coarse->fine boundaries in...
void AddParticlesAtLevel(ParticleTileType &particles, int level, int nGrow=0)
Add particles from a pbox to the grid at this level.
void ShrinkToFit()
Definition: AMReX_ParticleContainerI.H:585
void addParticles(const PCType &other, F const &f, bool local=false)
Add particles from other to this ParticleContainer. local controls whether or not to call Redistribut...
Vector< ParticleLevel > & GetParticles()
Return the underlying Vector (over AMR levels) of ParticleLevels. Non-const version.
Definition: AMReX_ParticleContainer.H:1010
bool Where(const P &prt, ParticleLocData &pld, int lev_min=0, int lev_max=-1, int nGrow=0, int local_grid=-1) const
Checks a particle's location on levels lev_min and higher. Returns false if the particle does not exi...
void Restart(const std::string &dir, const std::string &file, bool is_checkpoint)
Older version, for backwards compatibility.
void Define(ParGDBBase *gdb)
Define a default-constructed ParticleContainer using a ParGDB object. The container will track change...
Definition: AMReX_ParticleContainer.H:307
ParticleContainer_impl(const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr)
Construct a particle container using a given Geometry, DistributionMapping, BoxArray and Vector of re...
Definition: AMReX_ParticleContainer.H:255
Long superParticleSize() const
Definition: AMReX_ParticleContainer.H:1268
typename SoA::IntVector IntVector
Definition: AMReX_ParticleContainer.H:191
int num_int_comm_comps
Definition: AMReX_ParticleContainer.H:1475
size_t particle_size
Definition: AMReX_ParticleContainer.H:1474
void SortParticlesByBin(IntVect bin_size)
Sort the particles on each tile by groups of cells, given an IntVect bin_size.
Definition: AMReX_ParticleContainerI.H:1220
virtual void particlePostLocate(ParticleType &, const ParticleLocData &, const int)
Definition: AMReX_ParticleContainer.H:1455
void CreateGhostParticles(int level, int ngrow, AoS &ghosts) const
Create ghost particles for a given level that are copies of particles near coarse->fine boundaries in...
void Define(const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr)
Define a default-constructed ParticleContainer using a ParGDB object. Multi-level version.
Definition: AMReX_ParticleContainer.H:339
void SetSoACompileTimeNames(std::vector< std::string > const &rdata_name, std::vector< std::string > const &idata_name)
Definition: AMReX_ParticleContainerI.H:84
void AddParticlesAtLevel(AoS &particles, int level, int nGrow=0)
Add particles from a pbox to the grid at this level.
void SortParticlesByCell()
Sort the particles on each tile by cell, using Fortran ordering.
Definition: AMReX_ParticleContainerI.H:1211
ParticleTileType & ParticlesAt(int lev, int grid, int tile)
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Non-const version.
Definition: AMReX_ParticleContainer.H:1089
void ResizeRuntimeIntComp(int new_size, bool communicate)
Definition: AMReX_ParticleContainerI.H:2567
void InitFromBinaryMetaFile(const std::string &file, int extradata)
Definition: AMReX_ParticleInit.H:929
void resizeData() override
This resizes the vector of dummy MultiFabs used by the ParticleContainer for the current number of le...
Definition: AMReX_ParticleContainerI.H:339
void AddRealComp(std::string const &name, int communicate=1)
Definition: AMReX_ParticleContainer.H:1270
int num_real_comm_comps
Definition: AMReX_ParticleContainer.H:1475
ParticleTileType & ParticlesAt(int lev, const Iterator &iter)
Return the ParticleTile for level "lev" and Iterator "iter". Non-const version.
Definition: AMReX_ParticleContainer.H:1139
IntVect Index(const P &p, int lev) const
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
Long IncrementWithTotal(MultiFab &mf, int level, bool local=false)
Definition: AMReX_ParticleContainerI.H:632
const Vector< ParticleLevel > & GetParticles() const
Return the underlying Vector (over AMR levels) of ParticleLevels. Const version.
Definition: AMReX_ParticleContainer.H:1004
void InitOnePerCell(Real x_off, Real y_off, Real z_off, const ParticleInitData &pdata)
This initializes the particle container with one particle per cell, where the other particle data and...
Definition: AMReX_ParticleInit.H:1463
const ParticleTileType & ParticlesAt(int lev, int grid, int tile) const
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Const version.
Definition: AMReX_ParticleContainer.H:1064
void SortParticlesForDeposition(IntVect idx_type)
Sort particles on each tile such that particles adjacent in memory are likely to map to adjacent cell...
Definition: AMReX_ParticleContainerI.H:1253
void AddRealComp(int communicate=1)
Definition: AMReX_ParticleContainer.H:1293
~ParticleContainer_impl() override=default
void CheckpointPost()
Definition: AMReX_ParticleIO.H:495
T_ParticleType ParticleType
Definition: AMReX_ParticleContainer.H:147
bool m_runtime_comps_defined
Definition: AMReX_ParticleContainer.H:1470
Vector< Vector< int > > countPrePost
Definition: AMReX_ParticleContainer.H:1387
void InitRandomPerBox(Long icount, ULong iseed, const ParticleInitData &pdata)
This initializes the container with icount randomly distributed particles per box,...
Definition: AMReX_ParticleInit.H:1362
bool usePrePost
Definition: AMReX_ParticleContainer.H:1380
void SetParticleSize()
Definition: AMReX_ParticleContainerI.H:11
A Box with real dimensions. A RealBox is OK iff volume >= 0.
Definition: AMReX_RealBox.H:21
A Descriptor of the Real Type.
Definition: AMReX_FabConv.H:105
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
Long size() const noexcept
Definition: AMReX_Vector.H:50
AMREX_GPU_HOST_DEVICE Long size(T const &b) noexcept
integer version
Definition: AMReX_GpuRange.H:26
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
static constexpr int P
Definition: AMReX_OpenBC.H:14
Definition: AMReX_Amr.cpp:49
amrex::ArenaAllocator< T > DefaultAllocator
Definition: AMReX_GpuAllocators.H:194
int verbose
Definition: AMReX_DistributionMapping.cpp:36
Definition: AMReX_ParticleUtil.H:432
A struct used for communicating particle data across processes during multi-level operations.
Definition: AMReX_ParticleContainer.H:79
ParticleReal RealType
Definition: AMReX_ParticleContainer.H:80
int m_grid
Definition: AMReX_ParticleContainer.H:82
RealType m_data[1+AMREX_SPACEDIM]
Definition: AMReX_ParticleContainer.H:84
IntVect m_cell
Definition: AMReX_ParticleContainer.H:83
int m_lev
Definition: AMReX_ParticleContainer.H:81
A struct used to pass initial data into the various Init methods. This struct is used to pass initial...
Definition: AMReX_ParticleContainer.H:116
std::array< int, NStructInt > int_struct_data
Definition: AMReX_ParticleContainer.H:118
std::array< int, NArrayInt > int_array_data
Definition: AMReX_ParticleContainer.H:120
std::array< double, NArrayReal > real_array_data
Definition: AMReX_ParticleContainer.H:119
std::array< double, NStructReal > real_struct_data
Definition: AMReX_ParticleContainer.H:117
A struct used for storing a particle's position in the AMR hierarchy.
Definition: AMReX_ParticleContainer.H:91
Box m_grown_gridbox
Definition: AMReX_ParticleContainer.H:98
IntVect m_cell
Definition: AMReX_ParticleContainer.H:95
int m_grid
Definition: AMReX_ParticleContainer.H:93
int m_tile
Definition: AMReX_ParticleContainer.H:94
int m_lev
Definition: AMReX_ParticleContainer.H:92
Box m_tilebox
Definition: AMReX_ParticleContainer.H:97
Box m_gridbox
Definition: AMReX_ParticleContainer.H:96
Definition: AMReX_ParticleTile.H:693
std::conditional_t< ParticleType::is_soa_particle, StructOfArrays< NArrayReal, NArrayInt, Allocator, true >, StructOfArrays< NArrayReal, NArrayInt, Allocator, false > > SoA
Definition: AMReX_ParticleTile.H:716
std::conditional_t< ParticleType::is_soa_particle, ThisParticleTileHasNoAoS, ArrayOfStructs< ParticleType, Allocator > > AoS
Definition: AMReX_ParticleTile.H:710
The struct used to store particles.
Definition: AMReX_Particle.H:295
ParticleReal RealType
The floating point type used for the particles.
Definition: AMReX_Particle.H:307