A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured AMR hierarchy. More...
#include <AMReX_ParticleContainer.H>
Public Types | |
using | ParticleType = T_ParticleType |
using | ConstParticleType = typename ParticleType::ConstType |
using | CellAssignor = T_CellAssignor |
template<typename T > | |
using | AllocatorType = Allocator< T > |
The memory allocator in use. More... | |
using | SuperParticleType = Particle< NStructReal+NArrayReal, NStructInt+NArrayInt > |
The type of the "SuperParticle" which stored all components in AoS form. More... | |
using | RealType = typename Particle< NStructReal, NStructInt >::RealType |
The type of the Real data. More... | |
using | ParticleContainerType = ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > |
using | ParticleTileType = ParticleTile< ParticleType, NArrayReal, NArrayInt, Allocator > |
using | ParticleInitData = ParticleInitType< NStructReal, NStructInt, NArrayReal, NArrayInt > |
using | ParticleLevel = std::map< std::pair< int, int >, ParticleTileType > |
using | AoS = typename ParticleTileType::AoS |
using | SoA = typename ParticleTileType::SoA |
using | RealVector = typename SoA::RealVector |
using | IntVector = typename SoA::IntVector |
using | ParticleVector = typename AoS::ParticleVector |
using | CharVector = Gpu::DeviceVector< char > |
using | ParIterType = ParIter_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > |
using | ParConstIterType = ParConstIter_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > |
template<template< class > class NewAllocator = amrex::DefaultAllocator> | |
using | ContainerLike = amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, NewAllocator > |
Public Member Functions | |
ParticleContainer_impl () | |
Default constructor - construct an empty particle container that has no concept of a level hierarchy. Must be properly initialized later. More... | |
ParticleContainer_impl (ParGDBBase *gdb) | |
Construct a particle container using a ParGDB object. The container will track changes in the grid structure of the ParGDB automatically. More... | |
ParticleContainer_impl (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba) | |
Construct a particle container using a given Geometry, DistributionMapping, and BoxArray. Single level version. More... | |
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 refinement ratios. Multi-level version. More... | |
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. More... | |
~ParticleContainer_impl () override=default | |
ParticleContainer_impl (const ParticleContainer_impl &)=delete | |
ParticleContainer_impl & | operator= (const ParticleContainer_impl &)=delete |
ParticleContainer_impl (ParticleContainer_impl &&) noexcept=default | |
ParticleContainer_impl & | operator= (ParticleContainer_impl &&) noexcept=default |
void | Define (ParGDBBase *gdb) |
Define a default-constructed ParticleContainer using a ParGDB object. The container will track changes in the grid structure of the ParGDB automatically. More... | |
void | Define (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba) |
Define a default-constructed ParticleContainer using a ParGDB object. Single-level version. More... | |
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. More... | |
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. More... | |
int | numLocalTilesAtLevel (int lev) const |
The total number of tiles on this rank on this level. More... | |
void | reserveData () override |
This reserves data in the vector of dummy MultiFabs used by the ParticleContainer for the maximum number of levels possible. More... | |
void | resizeData () override |
This resizes the vector of dummy MultiFabs used by the ParticleContainer for the current number of levels and calls RedefineDummyMF on each level. Note that this must be done prior to using ParticleIterator. More... | |
void | InitFromAsciiFile (const std::string &file, int extradata, const IntVect *Nrep=nullptr) |
void | InitFromBinaryFile (const std::string &file, int extradata) |
void | InitFromBinaryMetaFile (const std::string &file, int extradata) |
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. If serialize is true, then the particles will all be generated on the IO Process, and the particle positions will be broadcast to all other process. If serialize is false, then the particle positions will be randomly generated in parallel, which each process using the random seed iseed + MyProc. The particles can be constrained to lie within the RealBox bx, if so desired. The default is the full domain. More... | |
void | InitRandomPerBox (Long icount, ULong iseed, const ParticleInitData &pdata) |
This initializes the container with icount randomly distributed particles per box, using the random seed iseed. All the particles have the same data and attributes, which are passed using the pdata struct. More... | |
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 attributes are all constant. The coarsest level is used to generate the particle positions. The particle variable values are passed in through the pdata struct. The parameters x_off, y_off, and z_off represent offsets between 0 and 1 that show where inside the cells to place the particles. 0.5 means cell centered. More... | |
void | InitNRandomPerCell (int n_per_cell, const ParticleInitData &pdata) |
This initializes the particle container with n_per_cell randomly distributed particles per cell, where the other particle data and and attributes are all constant. The cells on the coarsest level are used to generate the particle positions. The particle variable values are passed in through the pdata struct. More... | |
void | Increment (MultiFab &mf, int level) |
Long | IncrementWithTotal (MultiFab &mf, int level, bool local=false) |
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) More... | |
template<class index_type > | |
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. More... | |
void | SortParticlesForDeposition (IntVect idx_type) |
Sort particles on each tile such that particles adjacent in memory are likely to map to adjacent cells. This ordering can be beneficial for performance on GPU when deposition quantities onto a grid. More... | |
void | SortParticlesByCell () |
Sort the particles on each tile by cell, using Fortran ordering. More... | |
void | SortParticlesByBin (IntVect bin_size) |
Sort the particles on each tile by groups of cells, given an IntVect bin_size. More... | |
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) More... | |
std::array< Long, 3 > | ByteSpread () const |
std::array< Long, 3 > | PrintCapacity () const |
void | ShrinkToFit () |
Long | NumberOfParticlesAtLevel (int level, bool only_valid=true, bool only_local=false) const |
Returns # of particles at specified the level. More... | |
Vector< Long > | NumberOfParticlesInGrid (int level, bool only_valid=true, bool only_local=false) const |
Long | TotalNumberOfParticles (bool only_valid=true, bool only_local=false) const |
Returns # of particles at all levels. More... | |
void | RemoveParticlesAtLevel (int level) |
The Following methods are for managing Virtual and Ghost Particles. More... | |
void | RemoveParticlesNotAtFinestLevel () |
void | CreateVirtualParticles (int level, AoS &virts) const |
Creates virtual particles for a given level that represent in some capacity all particles at finer levels. More... | |
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 level-1. More... | |
void | AddParticlesAtLevel (AoS &particles, int level, int nGrow=0) |
Add particles from a pbox to the grid at this level. More... | |
void | CreateVirtualParticles (int level, ParticleTileType &virts) const |
Creates virtual particles for a given level that represent in some capacity all particles at finer levels. More... | |
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 level-1. More... | |
void | AddParticlesAtLevel (ParticleTileType &particles, int level, int nGrow=0) |
Add particles from a pbox to the grid at this level. More... | |
void | clearParticles () |
Clear all the particles in this container. This does not free memory. More... | |
template<class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo = 0> | |
void | copyParticles (const PCType &other, bool local=false) |
Copy particles from other to this ParticleContainer. Will clear all the particles from this container first. local controls whether or not to call Redistribute() after adding the particles. More... | |
template<class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo = 0> | |
void | addParticles (const PCType &other, bool local=false) |
Add particles from other to this ParticleContainer. local controls whether or not to call Redistribute after adding the particles. More... | |
template<class F , class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo = 0, std::enable_if_t<! std::is_integral_v< F >, int > bar = 0> | |
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 first. local controls whether or not to call Redistribute() after adding the particles. More... | |
template<class F , class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo = 0, std::enable_if_t<! std::is_integral_v< F >, int > bar = 0> | |
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 Redistribute after adding the particles. More... | |
void | WriteParticleRealData (void *data, size_t size, std::ostream &os) const |
Write a contiguous chunk of real particle data to an ostream. More... | |
void | ReadParticleRealData (void *data, size_t size, std::istream &is) |
Read a contiguous chunk of real particle data from an istream. More... | |
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. More... | |
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 component names to be passed in. This overload exists for backwards compatibility. The is_checkpoint parameter is ignored. More... | |
void | Checkpoint (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) const |
Writes a particle checkpoint to file, suitable for restarting. This version allows some components to be toggled off, if they don't need to be stored in the chk file. More... | |
template<class F > | |
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. More... | |
void | CheckpointPre () |
void | CheckpointPost () |
void | Restart (const std::string &dir, const std::string &file) |
Restart from checkpoint. More... | |
void | Restart (const std::string &dir, const std::string &file, bool is_checkpoint) |
Older version, for backwards compatibility. More... | |
void | WritePlotFile (const std::string &dir, const std::string &name) const |
This version of WritePlotFile writes all components and assigns component names. More... | |
template<class F , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string >>> * = nullptr> | |
void | WritePlotFile (const std::string &dir, const std::string &name, F &&f) const |
This version of WritePlotFile writes all components and assigns component names. More... | |
void | WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names) const |
This version of WritePlotFile writes all components and allows the user to specify the names of the components. More... | |
template<class F > | |
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 components. More... | |
void | WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names) const |
This version of WritePlotFile writes all components and allows the user to specify the names of the components. More... | |
template<class F , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string >>> * = nullptr> | |
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 components. More... | |
void | WritePlotFile (const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp) const |
This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components. More... | |
template<class F > | |
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 ints that toggle on / off the writing of specific components. More... | |
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) const |
This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not. More... | |
template<class F > | |
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 to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not. More... | |
void | WritePlotFilePre () |
void | WritePlotFilePost () |
void | WriteAsciiFile (const std::string &file) |
const Vector< ParticleLevel > & | GetParticles () const |
Return the underlying Vector (over AMR levels) of ParticleLevels. Const version. More... | |
Vector< ParticleLevel > & | GetParticles () |
Return the underlying Vector (over AMR levels) of ParticleLevels. Non-const version. More... | |
const ParticleLevel & | GetParticles (int lev) const |
Return the ParticleLevel for level "lev". Const version. More... | |
ParticleLevel & | GetParticles (int lev) |
Return the ParticleLevel for level "lev". Non-const version. More... | |
const ParticleTileType & | ParticlesAt (int lev, int grid, int tile) const |
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Const version. More... | |
ParticleTileType & | ParticlesAt (int lev, int grid, int tile) |
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Non-const version. More... | |
template<class Iterator > | |
const ParticleTileType & | ParticlesAt (int lev, const Iterator &iter) const |
Return the ParticleTile for level "lev" and Iterator "iter". Const version. More... | |
template<class Iterator > | |
ParticleTileType & | ParticlesAt (int lev, const Iterator &iter) |
Return the ParticleTile for level "lev" and Iterator "iter". Non-const version. More... | |
ParticleTileType & | DefineAndReturnParticleTile (int lev, int grid, int tile) |
Define and return the ParticleTile for level "lev", grid "grid" and tile "tile.". More... | |
template<class Iterator > | |
ParticleTileType & | DefineAndReturnParticleTile (int lev, const Iterator &iter) |
Define and return the ParticleTile for level "lev", and Iterator "iter". More... | |
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. More... | |
void | AssignCellDensitySingleLevel (int rho_index, MultiFab &mf, int level, int ncomp=1, int particle_lvl_offset=0) const |
template<typename P , typename Assignor = CellAssignor> | |
IntVect | Index (const P &p, int lev) const |
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 domain. May need work (see inline comments) More... | |
template<typename P > | |
bool | PeriodicShift (P &p) const |
Returns true if the particle was shifted. More... | |
void | SetLevelDirectoriesCreated (bool tf) |
bool | GetLevelDirectoriesCreated () const |
void | SetUsePrePost (bool tf) const |
bool | GetUsePrePost () const |
int | GetMaxNextIDPrePost () const |
Long | GetNParticlesPrePost () const |
void | SetUseUnlink (bool tf) const |
bool | GetUseUnlink () const |
void | RedistributeCPU (int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true) |
void | RedistributeGPU (int lev_min=0, int lev_max=-1, int nGrow=0, int local=0, bool remove_negative=true) |
Long | superParticleSize () const |
void | AddRealComp (std::string const &name, int communicate=1) |
void | AddRealComp (int communicate=1) |
void | AddIntComp (std::string const &name, int communicate=1) |
void | AddIntComp (int communicate=1) |
int | NumRuntimeRealComps () const |
int | NumRuntimeIntComps () const |
int | NumRealComps () const |
int | NumIntComps () const |
void | ResizeRuntimeRealComp (int new_size, bool communicate) |
void | ResizeRuntimeIntComp (int new_size, bool communicate) |
template<template< class > class NewAllocator = amrex::DefaultAllocator> | |
ContainerLike< NewAllocator > | make_alike () const |
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 |
void | SetSoACompileTimeNames (std::vector< std::string > const &rdata_name, std::vector< std::string > const &idata_name) |
std::vector< std::string > | GetRealSoANames () const |
std::vector< std::string > | GetIntSoANames () const |
template<typename P , typename Assignor > | |
IntVect | Index (const P &p, int lev) const |
template<typename P > | |
bool | Where (const P &p, ParticleLocData &pld, int lev_min, int lev_max, int nGrow, int local_grid) const |
template<typename P > | |
bool | EnforcePeriodicWhere (P &p, ParticleLocData &pld, int lev_min, int lev_max, int local_grid) const |
template<typename P > | |
bool | PeriodicShift (P &p) const |
template<typename P > | |
void | locateParticle (P &p, ParticleLocData &pld, int lev_min, int lev_max, int nGrow, int local_grid) const |
template<class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo> | |
void | copyParticles (const PCType &other, bool local) |
template<class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo> | |
void | addParticles (const PCType &other, bool local) |
template<class F , class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo, std::enable_if_t<! std::is_integral_v< F >, int > bar> | |
void | copyParticles (const PCType &other, F &&f, bool local) |
template<class F , class PCType , std::enable_if_t< IsParticleContainer< PCType >::value, int > foo, std::enable_if_t<! std::is_integral_v< F >, int > bar> | |
void | addParticles (const PCType &other, F const &f, bool local) |
template<class index_type > | |
void | ReorderParticles (int lev, const MFIter &mfi, const index_type *permutations) |
template<class F , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string >>> * > | |
void | WritePlotFile (const std::string &dir, const std::string &name, F &&f) const |
template<class F > | |
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 |
template<class F , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string >>> * > | |
void | WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, F &&f) const |
template<class F > | |
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 |
template<class F > | |
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 |
template<class F > | |
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) const |
template<class RTYPE > | |
void | ReadParticles (int cnt, int grd, int lev, std::ifstream &ifs, int finest_level_in_file, bool convert_ids) |
Public Member Functions inherited from amrex::ParticleContainerBase | |
ParticleContainerBase ()=default | |
ParticleContainerBase (ParGDBBase *gdb) | |
ParticleContainerBase (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba) | |
ParticleContainerBase (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr) | |
ParticleContainerBase (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< IntVect > &rr) | |
virtual | ~ParticleContainerBase ()=default |
ParticleContainerBase (const ParticleContainerBase &)=delete | |
ParticleContainerBase & | operator= (const ParticleContainerBase &)=delete |
ParticleContainerBase (ParticleContainerBase &&)=default | |
ParticleContainerBase & | operator= (ParticleContainerBase &&)=default |
void | Define (ParGDBBase *gdb) |
void | Define (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba) |
void | Define (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr) |
void | Define (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< IntVect > &rr) |
bool | isDefined () const |
void | RedefineDummyMF (int lev) |
MFIter | MakeMFIter (int lev, const MFItInfo &info) const |
MFIter | MakeMFIter (int lev) const |
MFIter | MakeMFIter (int lev, bool tile) const |
void | SetParGDB (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba) |
Set the particle Geometry, DistributionMapping, and BoxArray. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. This is the single-level version. More... | |
void | SetParGDB (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< IntVect > &rr) |
Set the particle Geometry, DistributionMapping, ref ratios, and BoxArray. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. This is the multi-level version. More... | |
void | SetParGDB (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr) |
Set the particle Geometry, DistributionMapping, ref ratios, and BoxArray. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. This is the multi-level version. More... | |
void | SetParticleBoxArray (int lev, BoxArray new_ba) |
Set the particle BoxArray. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. More... | |
void | SetParticleDistributionMap (int lev, DistributionMapping new_dmap) |
Set the particle DistributionMapping. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. More... | |
void | SetParticleGeometry (int lev, Geometry new_geom) |
Set the particle Geometry. If the container was previously set to to track the AMR hierarchy of an AmrCore or AmrLevel object, that correspondence will be broken here. More... | |
const BoxArray & | ParticleBoxArray (int lev) const |
Get the BoxArray for a given level. More... | |
const DistributionMapping & | ParticleDistributionMap (int lev) const |
Get the DistributionMapping for a given level. More... | |
const Geometry & | Geom (int lev) const |
Get the Geometry for a given level. More... | |
const Geometry & | ParticleGeom (int lev) const |
Get the particle Geometry for a given level. More... | |
int | finestLevel () const |
the finest level actually defined for the ParticleContainer More... | |
int | maxLevel () const |
the finest allowed level in the ParticleContainer, whether it is defined or not. More... | |
int | numLevels () const |
the number of defined levels in the ParticleContainer More... | |
const ParGDBBase * | GetParGDB () const |
Get the ParGDB object used to define this container (const version) More... | |
ParGDBBase * | GetParGDB () |
Get the ParGDB object used to define this container. More... | |
int | Verbose () const |
void | SetVerbose (int verbose) |
int | stableRedistribute () const |
void | setStableRedistribute (int stable) |
const ParticleBufferMap & | BufferMap () const |
Vector< int > | NeighborProcs (int ngrow) const |
template<class MF > | |
bool | OnSameGrids (int level, const MF &mf) const |
Public Attributes | |
RealDescriptor | ParticleRealDescriptor = FPC::Native64RealDescriptor() |
Vector< int > | h_redistribute_real_comp |
Vector< int > | h_redistribute_int_comp |
bool | levelDirectoriesCreated |
Variables for i/o optimization saved for pre and post checkpoint. More... | |
bool | usePrePost |
bool | doUnlink |
int | maxnextidPrePost |
int | nOutFilesPrePost |
Long | nparticlesPrePost |
Vector< Long > | nParticlesAtLevelPrePost |
Vector< Vector< int > > | whichPrePost |
Vector< Vector< int > > | countPrePost |
Vector< Vector< Long > > | wherePrePost |
std::string | HdrFileNamePrePost |
Vector< std::string > | filePrefixPrePost |
Public Attributes inherited from amrex::ParticleContainerBase | |
AmrParticleLocator< DenseBins< Box > > | m_particle_locator |
Static Public Attributes | |
static constexpr int | NStructReal = ParticleType::NReal |
Number of extra Real components in the particle struct. More... | |
static constexpr int | NStructInt = ParticleType::NInt |
Number of extra integer components in the particle struct. More... | |
static constexpr int | NArrayReal = T_NArrayReal |
Number of extra Real components stored in struct-of-array form. More... | |
static constexpr int | NArrayInt = T_NArrayInt |
Number of extra integer components stored in struct-of-array form. More... | |
Static Public Attributes inherited from amrex::ParticleContainerBase | |
static AMREX_EXPORT bool | do_tiling = false |
static AMREX_EXPORT IntVect | tile_size { AMREX_D_DECL(1024000,8,8) } |
static AMREX_EXPORT bool | memEfficientSort = true |
Protected Member Functions | |
template<typename P > | |
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 exist on that level. Only if lev_min == lev_max, nGrow can be > 0 (i.e., including nGrow ghost cells). More... | |
template<typename P > | |
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_min and higher. More... | |
template<class RTYPE > | |
void | ReadParticles (int cnt, int grd, int lev, std::ifstream &ifs, int finest_level_in_file, bool convert_ids) |
void | SetParticleSize () |
Protected Member Functions inherited from amrex::ParticleContainerBase | |
void | BuildRedistributeMask (int lev, int nghost=1) const |
void | defineBufferMap () const |
Protected Attributes | |
DenseBins< typename ParticleTileType::ParticleTileDataType > | m_bins |
Protected Attributes inherited from amrex::ParticleContainerBase | |
int | m_verbose {0} |
int | m_stable_redistribute = 0 |
std::unique_ptr< ParGDB > | m_gdb_object = std::make_unique<ParGDB>() |
ParGDBBase * | m_gdb {nullptr} |
Vector< std::unique_ptr< MultiFab > > | m_dummy_mf |
std::unique_ptr< iMultiFab > | redistribute_mask_ptr |
int | redistribute_mask_nghost = std::numeric_limits<int>::min() |
amrex::Vector< int > | neighbor_procs |
ParticleBufferMap | m_buffer_map |
Private Member Functions | |
virtual void | particlePostLocate (ParticleType &, const ParticleLocData &, const int) |
virtual void | correctCellVectors (int, int, int, const ParticleType &) |
void | RedistributeMPI (std::map< int, Vector< char > > ¬_ours, int lev_min=0, int lev_max=0, int nGrow=0, int local=0) |
template<typename P > | |
void | locateParticle (P &p, ParticleLocData &pld, int lev_min, int lev_max, int nGrow, int local_grid=-1) const |
void | Initialize () |
Private Attributes | |
bool | m_runtime_comps_defined {false} |
int | m_num_runtime_real {0} |
int | m_num_runtime_int {0} |
size_t | particle_size |
size_t | superparticle_size |
int | num_real_comm_comps |
int | num_int_comm_comps |
Vector< ParticleLevel > | m_particles |
std::vector< std::string > | m_soa_rdata_names |
std::vector< std::string > | m_soa_idata_names |
Friends | |
class | ParIterBase_impl< true, ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > |
The type of the "Particle". More... | |
class | ParIterBase_impl< false, ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > |
Additional Inherited Members | |
Static Public Member Functions inherited from amrex::ParticleContainerBase | |
static const std::string & | CheckpointVersion () |
static const std::string & | PlotfileVersion () |
static const std::string & | DataPrefix () |
static int | MaxReaders () |
static Long | MaxParticlesPerRead () |
static const std::string & | AggregationType () |
static int | AggregationBuffer () |
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured AMR hierarchy.
The data layout on a single tile is determined by the value of the following template parameters:
T_NStructReal | The number of extra Real components in the particle struct |
T_NStructInt | The number of extra integer components in the particle struct |
T_NArrayReal | The number of extra Real components stored in struct-of-array form |
T_NArrayInt | The number of extra integer components stored in struct-of-array form |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::AllocatorType = Allocator<T> |
The memory allocator in use.
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::AoS = typename ParticleTileType::AoS |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::CellAssignor = T_CellAssignor |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::CharVector = Gpu::DeviceVector<char> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ConstParticleType = typename ParticleType::ConstType |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ContainerLike = amrex::ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, NewAllocator> |
type trait to translate one particle container to another, with changed allocator
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::IntVector = typename SoA::IntVector |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParConstIterType = ParConstIter_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParIterType = ParIter_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleContainerType = ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleInitData = ParticleInitType<NStructReal, NStructInt, NArrayReal, NArrayInt> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleLevel = std::map<std::pair<int, int>, ParticleTileType> |
A single level worth of particles is indexed (grid id, tile id) for both SoA and AoS data.
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleTileType = ParticleTile<ParticleType, NArrayReal, NArrayInt, Allocator> |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleType = T_ParticleType |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleVector = typename AoS::ParticleVector |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::RealType = typename Particle<NStructReal, NStructInt>::RealType |
The type of the Real data.
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::RealVector = typename SoA::RealVector |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::SoA = typename ParticleTileType::SoA |
using amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::SuperParticleType = Particle<NStructReal+NArrayReal, NStructInt+NArrayInt> |
The type of the "SuperParticle" which stored all components in AoS form.
|
inline |
Default constructor - construct an empty particle container that has no concept of a level hierarchy. Must be properly initialized later.
|
inline |
Construct a particle container using a ParGDB object. The container will track changes in the grid structure of the ParGDB automatically.
gdb | A pointer to a ParGDBBase, which contains pointers to the Geometry, DistributionMapping, and BoxArray objects that define the AMR hierarchy. Usually, this is generated by an AmrCore or AmrLevel object. |
|
inline |
Construct a particle container using a given Geometry, DistributionMapping, and BoxArray. Single level version.
the | Geometry object, which describes the problem domain |
A | DistributionMapping, which describes how the boxes are distributed onto MPI tasks |
A | BoxArray, which gives the set of grid boxes |
|
inline |
Construct a particle container using a given Geometry, DistributionMapping, BoxArray and Vector of refinement ratios. Multi-level version.
|
inline |
Same as the above, but accepts different refinement ratios in each direction.
|
overridedefault |
|
delete |
|
defaultnoexcept |
|
inline |
|
inline |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::addParticles | ( | const PCType & | other, |
bool | local | ||
) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::addParticles | ( | const PCType & | other, |
bool | local = false |
||
) |
Add particles from other to this ParticleContainer. local controls whether or not to call Redistribute after adding the particles.
other | the other pc to copy from |
local | whether to call redistribute after |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::addParticles | ( | const PCType & | other, |
F const & | f, | ||
bool | local | ||
) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::addParticles | ( | const PCType & | other, |
F const & | f, | ||
bool | local = false |
||
) |
Add particles from other to this ParticleContainer. local controls whether or not to call Redistribute after adding the particles.
This version conditionally copies based on a predicate function applied to each particle.
callable | that takes a SuperParticle and returns a bool |
other | the other pc to copy from |
f | function to apply to each particle as a filter |
local | whether to call redistribute after |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::AddParticlesAtLevel | ( | AoS & | particles, |
int | level, | ||
int | nGrow = 0 |
||
) |
Add particles from a pbox to the grid at this level.
particles | |
level | |
nGrow |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::AddParticlesAtLevel | ( | ParticleTileType & | particles, |
int | level, | ||
int | nGrow = 0 |
||
) |
Add particles from a pbox to the grid at this level.
particles | |
level | |
nGrow |
|
inline |
|
inline |
void ParticleContainer_impl::AssignCellDensitySingleLevel | ( | int | rho_index, |
MultiFab & | mf, | ||
int | level, | ||
int | ncomp = 1 , |
||
int | particle_lvl_offset = 0 |
||
) | const |
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::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.
rho_index | |
mf_to_be_filled | |
lev_min | |
ncomp | |
finest_level | |
ngrow |
std::array< Long, 3 > ParticleContainer_impl::ByteSpread | ( | ) | const |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 component names to be passed in. This overload exists for backwards compatibility. The is_checkpoint parameter is ignored.
void ParticleContainer_impl::Checkpoint | ( | 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 | ||
) | const |
Writes a particle checkpoint to file, suitable for restarting. This version allows some components to be toggled off, if they don't need to be stored in the chk file.
dir | The base directory into which to write (i.e. "plt00000") |
name | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether or not we include that component in the file |
write_int_comp | for each integer component, whether or not we include that component in the file |
real_comp_names | vector of real component names |
int_comp_names | vector of int component names |
|
inline |
Writes a particle checkpoint to file, suitable for restarting.
dir | The base directory into which to write (i.e. "plt00000") |
name | The name of the sub-directory for this particle type (i.e. "Tracer") |
real_comp_names | vector of real component names, optional |
int_comp_names | vector of int component names, optional |
void ParticleContainer_impl::CheckpointPost | ( | ) |
void ParticleContainer_impl::CheckpointPre | ( | ) |
void ParticleContainer_impl::clearParticles | ( | ) |
Clear all the particles in this container. This does not free memory.
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::copyParticles | ( | const PCType & | other, |
bool | local | ||
) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::copyParticles | ( | const PCType & | other, |
bool | local = false |
||
) |
Copy particles from other to this ParticleContainer. Will clear all the particles from this container first. local controls whether or not to call Redistribute() after adding the particles.
other | the other pc to copy from |
local | whether to call redistribute after |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::copyParticles | ( | const PCType & | other, |
F && | f, | ||
bool | local | ||
) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::copyParticles | ( | const PCType & | other, |
F && | f, | ||
bool | local = false |
||
) |
Copy particles from other to this ParticleContainer. Will clear all the particles from this container first. local controls whether or not to call Redistribute() after adding the particles.
This version conditionally copies based on a predicate function applied to each particle.
callable | that takes a SuperParticle and returns a bool |
other | the other pc to copy from |
f | function to apply to each particle as a filter |
local | whether to call redistribute after |
|
inlineprivatevirtual |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 level-1.
level | |
ngrow | |
ghosts |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 level-1.
level | |
ngrow | |
ghosts |
void ParticleContainer_impl::CreateVirtualParticles | ( | int | level, |
AoS & | virts | ||
) | const |
Creates virtual particles for a given level that represent in some capacity all particles at finer levels.
level | |
virts |
void ParticleContainer_impl::CreateVirtualParticles | ( | int | level, |
ParticleTileType & | virts | ||
) | const |
Creates virtual particles for a given level that represent in some capacity all particles at finer levels.
level | |
virts |
|
inline |
Define a default-constructed ParticleContainer using a ParGDB object. Single-level version.
the | Geometry object, which describes the problem domain |
A | DistributionMapping, which describes how the boxes are distributed onto MPI tasks |
A | BoxArray, which gives the set of grid boxes |
|
inline |
Define a default-constructed ParticleContainer using a ParGDB object. Multi-level version.
|
inline |
Define a default-constructed ParticleContainer using a ParGDB object. Multi-level version.
|
inline |
Define a default-constructed ParticleContainer using a ParGDB object. The container will track changes in the grid structure of the ParGDB automatically.
gdb | A pointer to a ParGDBBase, which contains pointers to the Geometry, DistributionMapping, and BoxArray objects that define the AMR hierarchy. Usually, this is generated by an AmrCore or AmrLevel object. |
|
inline |
Define and return the ParticleTile for level "lev", and Iterator "iter".
Here, iter is either an MFIter or ParIter object pointing to the tile you want. If a ParticleTile at "grid" and "tile" has not been created yet, this function call will add it. This call will also allocate space for any runtime-added particle components. The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called. Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called *after* the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made. \param lev the level at which to get the particles \param iter MFIter or ParIter pointing to the tile to return
|
inline |
Define and return the ParticleTile for level "lev", grid "grid" and tile "tile.".
Here, grid and tile are integers that give the index and LocalTileIndex of the tile you want. If a ParticleTile at "grid" and "tile" has not been created yet, this function call will add it. This call will also allocate space for any runtime-added particle components. The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called. Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called *after* the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made. \param lev the level at which to get the particles \param grid the index of the grid at which to get the particles \param tile the LocalTileIndex of the tile at which to get the particles
bool amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::EnforcePeriodicWhere | ( | P & | p, |
ParticleLocData & | pld, | ||
int | lev_min, | ||
int | lev_max, | ||
int | local_grid | ||
) | const |
|
protected |
Checks whether the particle has crossed a periodic boundary in such a way that it is on levels lev_min and higher.
prt | |
pld | |
lev_min | |
lev_max | |
local_grid |
|
inline |
Get the names for the int SoA components
|
inline |
|
inline |
|
inline |
|
inline |
Return the underlying Vector (over AMR levels) of ParticleLevels. Non-const version.
|
inline |
Return the underlying Vector (over AMR levels) of ParticleLevels. Const version.
|
inline |
Return the ParticleLevel for level "lev". Non-const version.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called. Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called *after* the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made. \param lev the level at which to get the particles
|
inline |
Return the ParticleLevel for level "lev". Const version.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called. Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called *after* the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made. \param lev the level at which to get the particles
|
inline |
Get the names for the real SoA components
|
inline |
|
inline |
void ParticleContainer_impl::Increment | ( | MultiFab & | mf, |
int | lev | ||
) |
Adds the number of particles in each cell to the values currently located in the input MultiFab.
Long ParticleContainer_impl::IncrementWithTotal | ( | MultiFab & | mf, |
int | level, | ||
bool | local = false |
||
) |
IntVect amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::Index | ( | const P & | p, |
int | lev | ||
) | const |
IntVect amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::Index | ( | const P & | p, |
int | lev | ||
) | const |
void ParticleContainer_impl::InitFromAsciiFile | ( | const std::string & | file, |
int | extradata, | ||
const IntVect * | Nrep = nullptr |
||
) |
void ParticleContainer_impl::InitFromBinaryFile | ( | const std::string & | file, |
int | extradata | ||
) |
void ParticleContainer_impl::InitFromBinaryMetaFile | ( | const std::string & | file, |
int | extradata | ||
) |
|
private |
void ParticleContainer_impl::InitNRandomPerCell | ( | int | n_per_cell, |
const ParticleInitData & | pdata | ||
) |
This initializes the particle container with n_per_cell randomly distributed particles per cell, where the other particle data and and attributes are all constant. The cells on the coarsest level are used to generate the particle positions. The particle variable values are passed in through the pdata struct.
n_per_cell | |
pdata |
void ParticleContainer_impl::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 attributes are all constant. The coarsest level is used to generate the particle positions. The particle variable values are passed in through the pdata struct. The parameters x_off, y_off, and z_off represent offsets between 0 and 1 that show where inside the cells to place the particles. 0.5 means cell centered.
x_off | |
y_off | |
z_off | |
pdata |
void ParticleContainer_impl::InitRandom | ( | Long | icount, |
ULong | iseed, | ||
const ParticleInitData & | pdata, | ||
bool | serialize = false , |
||
RealBox | bx = RealBox() |
||
) |
This initializes the particle container with icount randomly distributed particles. If serialize is true, then the particles will all be generated on the IO Process, and the particle positions will be broadcast to all other process. If serialize is false, then the particle positions will be randomly generated in parallel, which each process using the random seed iseed + MyProc. The particles can be constrained to lie within the RealBox bx, if so desired. The default is the full domain.
icount | |
iseed | |
mass | |
serialize | |
bx |
void ParticleContainer_impl::InitRandomPerBox | ( | Long | icount, |
ULong | iseed, | ||
const ParticleInitData & | pdata | ||
) |
This initializes the container with icount randomly distributed particles per box, using the random seed iseed. All the particles have the same data and attributes, which are passed using the pdata struct.
This routine is used when we want to replicate a box for a scaling study – within each box the distribution is random but the particle data is replicated across all boxes in the container. The boxes are assumed to be those on the coarsest level.
icount | |
iseed | |
pdata |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::locateParticle | ( | P & | p, |
ParticleLocData & | pld, | ||
int | lev_min, | ||
int | lev_max, | ||
int | nGrow, | ||
int | local_grid | ||
) | const |
|
private |
|
inline |
Create an empty particle container
This creates a new AMReX particle container type with same compile-time and run-time attributes. But, it can change its allocator. This is helpful when creating temporary particle buffers for filter operations and device-to-host copies.
Allocator | AMReX allocator, e.g., amrex::PinnedArenaAllocator |
Long ParticleContainer_impl::NumberOfParticlesAtLevel | ( | int | level, |
bool | only_valid = true , |
||
bool | only_local = false |
||
) | const |
Returns # of particles at specified the level.
If "only_valid" is true it only counts valid particles.
level | |
only_valid | |
only_local |
Vector< Long > ParticleContainer_impl::NumberOfParticlesInGrid | ( | int | level, |
bool | only_valid = true , |
||
bool | only_local = false |
||
) | const |
|
inline |
|
inline |
The total number of tiles on this rank on this level.
|
inline |
|
inline |
|
inline |
bool ParticleContainer_impl::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)
These flags are used to do proper checking for subcycling particles the default values are fine for non-subcycling methods
lev_min | |
lev_max | |
nGrow |
|
delete |
|
defaultnoexcept |
|
inlineprivatevirtual |
|
inline |
Return the ParticleTile for level "lev" and Iterator "iter". Non-const version.
Here, iter is either an MFIter or ParIter object pointing to the tile you want.
This is a runtime error if a ParticleTile at "iter" has not been created yet.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called.
Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called after the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made.
lev | the level at which to get the particles |
iter | MFIter or ParIter pointing to the tile to return |
|
inline |
Return the ParticleTile for level "lev" and Iterator "iter". Const version.
Here, iter is either an MFIter or ParIter object pointing to the tile you want.
This is a runtime error if a ParticleTile at "iter" has not been created yet.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called.
Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called after the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made.
lev | the level at which to get the particles |
iter | MFIter or ParIter pointing to the tile to return |
|
inline |
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Non-const version.
Here, grid and tile are integers that give the index and LocalTileIndex of the tile you want.
This is a runtime error if a ParticleTile at "grid" and "tile" has not been created yet.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called.
Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called after the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made.
lev | the level at which to get the particles |
grid | the index of the grid at which to get the particles |
tile | the LocalTileIndex of the tile at which to get the particles |
|
inline |
Return the ParticleTile for level "lev", grid "grid" and tile "tile." Const version.
Here, grid and tile are integers that give the index and LocalTileIndex of the tile you want.
This is a runtime error if a ParticleTile at "grid" and "tile" has not been created yet.
The ParticleLevel must already exist, meaning that the "resizeData()" method of this ParticleContainer has been called.
Note that, when using a ParticleContainer that has been constructed with an AmrCore*, "resizeData()" must be called after the grids have been created, meaning after the call to AmrCore::InitFromScratch or AmrCore::InitFromCheckpoint has been made.
lev | the level at which to get the particles |
grid | the index of the grid at which to get the particles |
tile | the LocalTileIndex of the tile at which to get the particles |
bool amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::PeriodicShift | ( | P & | p | ) | const |
Returns true if the particle was shifted.
prt |
bool amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::PeriodicShift | ( | P & | p | ) | const |
std::array< Long, 3 > ParticleContainer_impl::PrintCapacity | ( | ) | const |
void ParticleContainer_impl::ReadParticleRealData | ( | void * | data, |
size_t | size, | ||
std::istream & | is | ||
) |
Read a contiguous chunk of real particle data from an istream.
data | A pointer to the start of the buffer into which to read |
size | The number of elements to read |
os | The istream from which to read the data |
rd | A RealDescriptor describing the type of the floating point data |
|
protected |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ReadParticles | ( | int | cnt, |
int | grd, | ||
int | lev, | ||
std::ifstream & | ifs, | ||
int | finest_level_in_file, | ||
bool | convert_ids | ||
) |
void ParticleContainer_impl::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)
Assigns particles to the levels, grids, and tiles that contain their current positions. If periodic boundary conditions are used, those will be enforced here.
If Redistribute is called with default arguments, all particles will be placed on the finest level that covers their current positions.
The lev_min, lev_max, and nGrow flags are used to do proper checking for subcycling particles. The default values are fine for non-subcycling methods
The local flag controls whether this is local
or global
Redistribute. In a local Redistribute, particles can only have moved a certain distance since the last time Redistribute() was called. Thus, communication only needs to happen between neighboring ranks. In a global Redistribute, the particles can potentially go from any rank to any rank. This usually happens after initialization or when doing dynamic load balancing.
lev_min | The minimum level consider. Particles on levels less than this will not be touched, and particles on finer levels will not be assigned to levels less than this, either. Default: 0. |
lev_max | The maximum level consider. Particles on levels greater than this will not be touched, and particles on coarser levels will not be assigned to levels greater than this, either. If negative, will use the finest level in the hierarchy. Default: -1. |
nGrow | If particles are within nGrow cells of their current box, they will not moved. This is useful for subcycling methods, when fine level particles need to be redistributed but are not necessarily at the same time as those on the coarse level. Default: 0 |
local | If 0, this will be a non-local redistribute, meaning that particle can potentially go to any other box in the simulation. If > 0, this is the maximum number of cells a particle can have moved since the last Redistribute() call. Knowing this number allows an optimized MPI communication pattern to be used. |
void ParticleContainer_impl::RedistributeCPU | ( | int | lev_min = 0 , |
int | lev_max = -1 , |
||
int | nGrow = 0 , |
||
int | local = 0 , |
||
bool | remove_negative = true |
||
) |
void ParticleContainer_impl::RedistributeGPU | ( | int | lev_min = 0 , |
int | lev_max = -1 , |
||
int | nGrow = 0 , |
||
int | local = 0 , |
||
bool | remove_negative = true |
||
) |
|
private |
void ParticleContainer_impl::RemoveParticlesAtLevel | ( | int | level | ) |
The Following methods are for managing Virtual and Ghost Particles.
Removes all particles at a given level
level |
void ParticleContainer_impl::RemoveParticlesNotAtFinestLevel | ( | ) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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.
permutations is a pointer to an array on the GPU of size numParticles() with permutations[new index] = old index.
lev | |
mfi | |
permutations |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ReorderParticles | ( | int | lev, |
const MFIter & | mfi, | ||
const index_type * | permutations | ||
) |
|
overridevirtual |
This reserves data in the vector of dummy MultiFabs used by the ParticleContainer for the maximum number of levels possible.
Reimplemented from amrex::ParticleContainerBase.
ParticleLocData ParticleContainer_impl::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 domain. May need work (see inline comments)
prt | |
update | |
verbose | |
pld |
|
overridevirtual |
This resizes the vector of dummy MultiFabs used by the ParticleContainer for the current number of levels and calls RedefineDummyMF on each level. Note that this must be done prior to using ParticleIterator.
Reimplemented from amrex::ParticleContainerBase.
void ParticleContainer_impl::ResizeRuntimeIntComp | ( | int | new_size, |
bool | communicate | ||
) |
Resize the Int runtime components (SoA)
new_size | new number of integer runtime components |
communicate | participate this component in redistribute |
void ParticleContainer_impl::ResizeRuntimeRealComp | ( | int | new_size, |
bool | communicate | ||
) |
Resize the Real runtime components (SoA)
new_size | new number of Real runtime components |
communicate | participate this component in redistribute |
void ParticleContainer_impl::Restart | ( | const std::string & | dir, |
const std::string & | file | ||
) |
Restart from checkpoint.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::Restart | ( | const std::string & | dir, |
const std::string & | file, | ||
bool | is_checkpoint | ||
) |
Older version, for backwards compatibility.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
is_checkpoint | Whether the particle id and cpu are included in the file. |
|
inline |
|
protected |
void ParticleContainer_impl::SetSoACompileTimeNames | ( | std::vector< std::string > const & | rdata_name, |
std::vector< std::string > const & | idata_name | ||
) |
Overwrite the default names for the compile-time SoA components
|
inline |
|
inline |
void ParticleContainer_impl::ShrinkToFit | ( | ) |
void ParticleContainer_impl::SortParticlesByBin | ( | IntVect | bin_size | ) |
Sort the particles on each tile by groups of cells, given an IntVect bin_size.
If bin_size is the zero vector, this operation is a no-op.
void ParticleContainer_impl::SortParticlesByCell | ( | ) |
Sort the particles on each tile by cell, using Fortran ordering.
void ParticleContainer_impl::SortParticlesForDeposition | ( | IntVect | idx_type | ) |
Sort particles on each tile such that particles adjacent in memory are likely to map to adjacent cells. This ordering can be beneficial for performance on GPU when deposition quantities onto a grid.
idx_type = {0, 0, 0}: Sort particles to a cell centered grid idx_type = {1, 1, 1}: Sort particles to a node centered grid idx_type = {2, 2, 2}: Compromise between a cell and node centered grid. This last option uses more memory than the fist two. Mixed versions are also possible.
idx_type |
|
inline |
Long ParticleContainer_impl::TotalNumberOfParticles | ( | bool | only_valid = true , |
bool | only_local = false |
||
) | const |
Returns # of particles at all levels.
If "only_valid" is true it only counts valid particles.
only_valid | |
only_local |
bool amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::Where | ( | const P & | p, |
ParticleLocData & | pld, | ||
int | lev_min, | ||
int | lev_max, | ||
int | nGrow, | ||
int | local_grid | ||
) | const |
|
protected |
Checks a particle's location on levels lev_min and higher. Returns false if the particle does not exist on that level. Only if lev_min == lev_max, nGrow can be > 0 (i.e., including nGrow ghost cells).
prt | |
pld | |
lev_min | |
lev_max | |
nGrow | |
local_grid |
void ParticleContainer_impl::WriteAsciiFile | ( | const std::string & | file | ) |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 | ||
) | const |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
name | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether or not we include that component in the file |
write_int_comp | for each integer component, whether or not we include that component in the file |
real_comp_names | for each real component, a name to label the data with |
int_comp_names | for each integer component, a name to label the data with |
f | callable that returns whether a given particle should be written or not |
is_checkpoint | whether the data is written to a checkpoint or plotfile |
void ParticleContainer_impl::WriteParticleRealData | ( | void * | data, |
size_t | size, | ||
std::ostream & | os | ||
) | const |
Write a contiguous chunk of real particle data to an ostream.
data | A pointer to the start of the buffer to write |
size | The number of elements to write |
os | The ostream into which to write the data |
void ParticleContainer_impl::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 |
void ParticleContainer_impl::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name | ||
) | const |
This version of WritePlotFile writes all components and assigns component names.
dir | The base directory into which to write (i.e. "plt00000") |
name | The name of the sub-directory for this particle type (i.e. "Tracer") |
void ParticleContainer_impl::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
const Vector< int > & | write_real_comp, | ||
const Vector< int > & | write_int_comp | ||
) | const |
This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether to include that comp in the file |
write_int_comp | for each integer component, whether to include that comp in the file |
void ParticleContainer_impl::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 | ||
) | const |
This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether to include that comp in the file |
write_int_comp | for each integer component, whether to include that comp in the file |
real_comp_names | for each real component, a name to label the data with |
int_comp_names | for each integer component, a name to label the data with |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.
This version also lets you pass in a functor to toggle whether each particle gets output.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether to include that comp in the file |
write_int_comp | for each integer component, whether to include that comp in the file |
real_comp_names | for each real component, a name to label the data with |
int_comp_names | for each integer component, a name to label the data with |
f | callable that returns whether or not to write each particle |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 ints that toggle on / off the writing of specific components.
This version also lets you pass in a functor to toggle whether each particle gets output.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
write_real_comp | for each real component, whether to include that comp in the file |
write_int_comp | for each integer component, whether to include that comp in the file |
f | callable that returns whether or not to write each particle |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
const Vector< int > & | write_real_comp, | ||
const Vector< int > & | write_int_comp, | ||
F && | f | ||
) | const |
void ParticleContainer_impl::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
const Vector< std::string > & | real_comp_names | ||
) | const |
This version of WritePlotFile writes all components and allows the user to specify the names of the components.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
real_comp_names | for each real component, a name to label the data with |
void ParticleContainer_impl::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
const Vector< std::string > & | real_comp_names, | ||
const Vector< std::string > & | int_comp_names | ||
) | const |
This version of WritePlotFile writes all components and allows the user to specify the names of the components.
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
real_comp_names | for each real component, a name to label the data with |
int_comp_names | for each integer component, a name to label the data with |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 components.
This version also lets you pass in a functor to toggle whether each particle gets output.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
real_comp_names | for each real component, a name to label the data with |
int_comp_names | for each integer component, a name to label the data with |
f | callable that returns whether or not to write each particle |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::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 components.
This version also lets you pass in a functor to toggle whether each particle gets output.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
file | The name of the sub-directory for this particle type (i.e. "Tracer") |
real_comp_names | for each real component, a name to label the data with |
f | callable that returns whether or not to write each particle |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
const Vector< std::string > & | real_comp_names, | ||
F && | f | ||
) | const |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
F && | f | ||
) | const |
This version of WritePlotFile writes all components and assigns component names.
This version also lets you pass in a functor to toggle whether each particle gets output.
F | function type |
dir | The base directory into which to write (i.e. "plt00000") |
name | The name of the sub-directory for this particle type (i.e. "Tracer") |
f | callable that returns whether or not to write each particle |
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile | ( | const std::string & | dir, |
const std::string & | name, | ||
F && | f | ||
) | const |
void ParticleContainer_impl::WritePlotFilePost | ( | ) |
void ParticleContainer_impl::WritePlotFilePre | ( | ) |
|
friend |
|
friend |
The type of the "Particle".
|
mutable |
|
mutable |
|
mutable |
Vector<int> amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::h_redistribute_int_comp |
Vector<int> amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::h_redistribute_real_comp |
|
mutable |
|
mutable |
Variables for i/o optimization saved for pre and post checkpoint.
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
int amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::maxnextidPrePost |
|
staticconstexpr |
Number of extra integer components stored in struct-of-array form.
|
staticconstexpr |
Number of extra Real components stored in struct-of-array form.
|
mutable |
Vector<Long> amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::nParticlesAtLevelPrePost |
Long amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::nparticlesPrePost |
|
staticconstexpr |
Number of extra integer components in the particle struct.
|
staticconstexpr |
Number of extra Real components in the particle struct.
|
private |
|
private |
|
private |
RealDescriptor amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::ParticleRealDescriptor = FPC::Native64RealDescriptor() |
|
private |
|
mutable |
|
mutable |
|
mutable |