Block-Structured AMR Software Framework
amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt > Class Template Reference

#include <AMReX_NeighborParticles.H>

Inheritance diagram for amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >:
amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor > amrex::ParticleContainerBase

Classes

struct  InverseCopyTag
 
struct  MaskComps
 
struct  NeighborCommTag
 
struct  NeighborCopyTag
 
struct  NeighborIndexMap
 
struct  NeighborTask
 

Public Types

using ParticleContainerType = ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >
 
using ParticleType = typename ParticleContainerType::ParticleType
 
using SuperParticleType = typename ParticleContainerType::SuperParticleType
 
using NeighborListContainerType = Vector< std::map< std::pair< int, int >, amrex::NeighborList< ParticleType > > >
 
using MyParIter = ParIter< NStructReal, NStructInt, NArrayReal, NArrayInt >
 
using PairIndex = std::pair< int, int >
 
using NeighborCommMap = std::map< NeighborCommTag, Vector< char > >
 
using AoS = typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::AoS
 
using ParticleVector = typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleVector
 
using ParticleTile = typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleTileType
 
using IntVector = typename ParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::IntVector
 
- Public Types inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
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

 NeighborParticleContainer (ParGDBBase *gdb, int ncells)
 
 NeighborParticleContainer (const Geometry &geom, const DistributionMapping &dmap, const BoxArray &ba, int nneighbor)
 
 NeighborParticleContainer (const Vector< Geometry > &geom, const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba, const Vector< int > &rr, int nneighbor)
 
 ~NeighborParticleContainer () override=default
 
 NeighborParticleContainer (const NeighborParticleContainer &)=delete
 
NeighborParticleContaineroperator= (const NeighborParticleContainer &)=delete
 
 NeighborParticleContainer (NeighborParticleContainer &&)=default
 
NeighborParticleContaineroperator= (NeighborParticleContainer &&)=default
 
void Regrid (const DistributionMapping &dmap, const BoxArray &ba)
 
void Regrid (const DistributionMapping &dmap, const BoxArray &ba, int lev)
 
void Regrid (const Vector< DistributionMapping > &dmap, const Vector< BoxArray > &ba)
 
void fillNeighbors ()
 
void sumNeighbors (int real_start_comp, int real_num_comp, int int_start_comp, int int_num_comp)
 
void updateNeighbors (bool boundary_neighbors_only=false)
 
void clearNeighbors ()
 
template<class CheckPair >
void buildNeighborList (CheckPair const &check_pair, bool sort=false)
 
template<class CheckPair , class OtherPCType >
void buildNeighborList (CheckPair const &check_pair, OtherPCType &other, Vector< std::map< std::pair< int, int >, amrex::NeighborList< typename OtherPCType::ParticleType > > > &neighbor_lists, bool sort=false)
 
template<class CheckPair >
void buildNeighborList (CheckPair const &check_pair, int type_ind, int *ref_ratio, int num_bin_types=1, bool sort=false)
 
template<class CheckPair >
void selectActualNeighbors (CheckPair const &check_pair, int num_cells=1)
 
void printNeighborList ()
 
void setRealCommComp (int i, bool value)
 
void setIntCommComp (int i, bool value)
 
ParticleTileGetNeighbors (int lev, int grid, int tile)
 
const ParticleTileGetNeighbors (int lev, int grid, int tile) const
 
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void AddRealComp (T communicate=true)
 
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void AddIntComp (T communicate=true)
 
void Redistribute (int lev_min=0, int lev_max=-1, int nGrow=0, int local=0)
 
void RedistributeLocal ()
 
void fillNeighborsGPU ()
 
void updateNeighborsGPU (bool boundary_neighbors_only=false)
 
void clearNeighborsGPU ()
 
void setEnableInverse (bool flag)
 
bool enableInverse ()
 
void buildNeighborMask ()
 
void buildNeighborCopyOp (bool use_boundary_neighbor=false)
 
template<class CheckPair >
void buildNeighborList (CheckPair const &check_pair, bool)
 
template<class CheckPair , class OtherPCType >
void buildNeighborList (CheckPair const &check_pair, OtherPCType &other, Vector< std::map< std::pair< int, int >, amrex::NeighborList< typename OtherPCType::ParticleType > > > &neighbor_lists, bool)
 
template<class CheckPair >
void buildNeighborList (CheckPair const &check_pair, int type_ind, int *ref_ratio, int num_bin_types, bool)
 
template<class CheckPair >
void selectActualNeighbors (CheckPair const &check_pair, int num_cells)
 
- Public Member Functions inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
 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_imploperator= (const ParticleContainer_impl &)=delete
 
 ParticleContainer_impl (ParticleContainer_impl &&) noexcept=default
 
ParticleContainer_imploperator= (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...
 
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 ParticleLevelGetParticles (int lev) const
 Return the ParticleLevel for level "lev". Const version. More...
 
ParticleLevelGetParticles (int lev)
 Return the ParticleLevel for level "lev". Non-const version. More...
 
const ParticleTileTypeParticlesAt (int lev, int grid, int tile) const
 Return the ParticleTile for level "lev", grid "grid" and tile "tile." Const version. More...
 
ParticleTileTypeParticlesAt (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 ParticleTileTypeParticlesAt (int lev, const Iterator &iter) const
 Return the ParticleTile for level "lev" and Iterator "iter". Const version. More...
 
template<class Iterator >
ParticleTileTypeParticlesAt (int lev, const Iterator &iter)
 Return the ParticleTile for level "lev" and Iterator "iter". Non-const version. More...
 
ParticleTileTypeDefineAndReturnParticleTile (int lev, int grid, int tile)
 Define and return the ParticleTile for level "lev", grid "grid" and tile "tile.". More...
 
template<class Iterator >
ParticleTileTypeDefineAndReturnParticleTile (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
 
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void AddRealComp (T communicate=true)
 
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void AddIntComp (T communicate=true)
 
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
 
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
 
ParticleContainerBaseoperator= (const ParticleContainerBase &)=delete
 
 ParticleContainerBase (ParticleContainerBase &&)=default
 
ParticleContainerBaseoperator= (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 BoxArrayParticleBoxArray (int lev) const
 Get the BoxArray for a given level. More...
 
const DistributionMappingParticleDistributionMap (int lev) const
 Get the DistributionMapping for a given level. More...
 
const GeometryGeom (int lev) const
 Get the Geometry for a given level. More...
 
const GeometryParticleGeom (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 ParGDBBaseGetParGDB () const
 Get the ParGDB object used to define this container (const version) More...
 
ParGDBBaseGetParGDB ()
 Get the ParGDB object used to define this container. More...
 
int Verbose () const
 
void SetVerbose (int verbose)
 
const ParticleBufferMapBufferMap () const
 
Vector< intNeighborProcs (int ngrow) const
 
template<class MF >
bool OnSameGrids (int level, const MF &mf) const
 

Protected Member Functions

void cacheNeighborInfo ()
 
void BuildMasks ()
 
bool areMasksValid ()
 
void GetNeighborCommTags ()
 
void GetCommTagsBox (Vector< NeighborCommTag > &tags, int lev, const Box &in_box)
 
void resizeContainers (int num_levels)
 
void initializeCommComps ()
 
void calcCommSize ()
 
void fillNeighborsMPI (bool reuse_rcv_counts)
 
void sumNeighborsMPI (std::map< int, Vector< char > > &not_ours, int real_start_comp, int real_num_comp, int int_start_comp, int int_num_comp)
 
void getRcvCountsMPI ()
 
void getNeighborTags (Vector< NeighborCopyTag > &tags, const ParticleType &p, int nGrow, const NeighborCopyTag &src_tag, const MyParIter &pti)
 
void getNeighborTags (Vector< NeighborCopyTag > &tags, const ParticleType &p, const IntVect &nGrow, const NeighborCopyTag &src_tag, const MyParIter &pti)
 
IntVect computeRefFac (int src_lev, int lev)
 
bool hasNeighbors () const
 
- Protected Member Functions inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
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

Vector< std::map< PairIndex, Vector< InverseCopyTag > > > inverse_tags
 
Vector< std::map< PairIndex, ParticleTile > > neighbors
 
Vector< std::map< PairIndex, IntVector > > neighbor_list
 
size_t cdata_size
 
int m_num_neighbor_cells
 
Vector< NeighborCommTaglocal_neighbors
 
Vector< std::unique_ptr< iMultiFab > > mask_ptr
 
Vector< std::map< PairIndex, Vector< Vector< NeighborCopyTag > > > > buffer_tag_cache
 
Vector< std::map< PairIndex, int > > local_neighbor_sizes
 
Vector< intneighbor_procs
 
Vector< Long > rcvs
 
Long num_snds
 
std::map< int, Vector< char > > send_data
 
Vector< intghost_real_comp
 
Vector< intghost_int_comp
 
bool m_neighbor_mask_initialized = false
 
std::unique_ptr< amrex::iMultiFabm_neighbor_mask_ptr
 
std::map< int, std::vector< std::vector< NeighborCode > > > m_grid_map
 
std::map< int, amrex::Gpu::DeviceVector< NeighborCode > > m_code_array
 
std::map< int, amrex::Gpu::DeviceVector< Box > > m_isec_boxes
 
std::map< int, amrex::Gpu::DeviceVector< int > > m_code_offsets
 
ParticleCopyOp neighbor_copy_op
 
ParticleCopyPlan neighbor_copy_plan
 
amrex::PODVector< char, PolymorphicArenaAllocator< char > > snd_buffer
 
amrex::Gpu::DeviceVector< char > rcv_buffer
 
Gpu::PinnedVector< char > pinned_snd_buffer
 
Gpu::PinnedVector< char > pinned_rcv_buffer
 
NeighborListContainerType m_neighbor_list
 
Vector< std::map< std::pair< int, int >, amrex::Gpu::DeviceVector< int > > > m_boundary_particle_ids
 
bool m_has_neighbors = false
 
- Protected Attributes inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
DenseBins< typename ParticleTileType::ParticleTileDataTypem_bins
 
- Protected Attributes inherited from amrex::ParticleContainerBase
int m_verbose {0}
 
std::unique_ptr< ParGDBm_gdb_object = std::make_unique<ParGDB>()
 
ParGDBBasem_gdb {nullptr}
 
Vector< std::unique_ptr< MultiFab > > m_dummy_mf
 
std::unique_ptr< iMultiFabredistribute_mask_ptr
 
int redistribute_mask_nghost = std::numeric_limits<int>::min()
 
amrex::Vector< intneighbor_procs
 
ParticleBufferMap m_buffer_map
 

Static Protected Attributes

static constexpr size_t pdata_size = sizeof(ParticleType)
 
static constexpr int num_mask_comps = 3
 grid, tile, level More...
 
static bool use_mask = false
 
static bool enable_inverse = false
 

Friends

std::ostream & operator<< (std::ostream &os, const InverseCopyTag &tag)
 

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 ()
 
- Public Attributes inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
RealDescriptor ParticleRealDescriptor = FPC::Native64RealDescriptor()
 
Vector< inth_redistribute_real_comp
 
Vector< inth_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 inherited from amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >
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
 

Detailed Description

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
class amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >

This is a container for particles that undergo short-range interactions. In addition to the normal ParticleContainer methods, each tile contains a "neighbor buffer" that is filled with data corresponding to the particles within 1 neighbor cell of the tile boundaries. This allows the N^2 search over each pair of particles to proceed locally, instead of over the entire domain.

Note that neighbor particles are different than "ghost" particles, which are used in AMR subcycling to keep track of coarse level particles that may move on to fine levels during a fine level time step.

Member Typedef Documentation

◆ AoS

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::AoS = typename ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>::AoS

◆ IntVector

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::IntVector = typename ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>::IntVector

◆ MyParIter

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::MyParIter = ParIter<NStructReal, NStructInt, NArrayReal, NArrayInt>

◆ NeighborCommMap

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::NeighborCommMap = std::map<NeighborCommTag, Vector<char> >

◆ NeighborListContainerType

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::NeighborListContainerType = Vector<std::map<std::pair<int, int>, amrex::NeighborList<ParticleType> > >

◆ PairIndex

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::PairIndex = std::pair<int, int>

◆ ParticleContainerType

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleContainerType = ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>

◆ ParticleTile

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleTile = typename ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>::ParticleTileType

◆ ParticleType

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleType = typename ParticleContainerType::ParticleType

◆ ParticleVector

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ParticleVector = typename ParticleContainer<NStructReal, NStructInt, NArrayReal, NArrayInt>::ParticleVector

◆ SuperParticleType

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
using amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::SuperParticleType = typename ParticleContainerType::SuperParticleType

Constructor & Destructor Documentation

◆ NeighborParticleContainer() [1/5]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborParticleContainer::NeighborParticleContainer ( ParGDBBase gdb,
int  ncells 
)

◆ NeighborParticleContainer() [2/5]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborParticleContainer::NeighborParticleContainer ( const Geometry geom,
const DistributionMapping dmap,
const BoxArray ba,
int  nneighbor 
)

◆ NeighborParticleContainer() [3/5]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborParticleContainer::NeighborParticleContainer ( const Vector< Geometry > &  geom,
const Vector< DistributionMapping > &  dmap,
const Vector< BoxArray > &  ba,
const Vector< int > &  rr,
int  nneighbor 
)

◆ ~NeighborParticleContainer()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::~NeighborParticleContainer ( )
overridedefault

◆ NeighborParticleContainer() [4/5]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::NeighborParticleContainer ( const NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt > &  )
delete

◆ NeighborParticleContainer() [5/5]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::NeighborParticleContainer ( NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt > &&  )
default

Member Function Documentation

◆ AddIntComp()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::AddIntComp ( communicate = true)
inline

◆ AddRealComp()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<typename T , std::enable_if_t< std::is_same_v< T, bool >, int > = 0>
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::AddRealComp ( communicate = true)
inline

◆ areMasksValid()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool NeighborParticleContainer::areMasksValid ( )
protected

Are the masks computed by the above function still valid?

◆ BuildMasks()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::BuildMasks ( )
protected

This builds the internal mask data structure used for looking up neighbors

◆ buildNeighborCopyOp()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::buildNeighborCopyOp ( bool  use_boundary_neighbor = false)

◆ buildNeighborList() [1/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
bool  sort = false 
)

Build a Neighbor List for each tile

◆ buildNeighborList() [2/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
bool   
)

◆ buildNeighborList() [3/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
int  type_ind,
int ref_ratio,
int  num_bin_types,
bool   
)

◆ buildNeighborList() [4/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
int  type_ind,
int ref_ratio,
int  num_bin_types = 1,
bool  sort = false 
)

Build a Neighbor List for each tile

◆ buildNeighborList() [5/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair , class OtherPCType >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
OtherPCType &  other,
Vector< std::map< std::pair< int, int >, amrex::NeighborList< typename OtherPCType::ParticleType > > > &  neighbor_lists,
bool  sort = false 
)

Build a Neighbor List for each tile

◆ buildNeighborList() [6/6]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair , class OtherPCType >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buildNeighborList ( CheckPair const &  check_pair,
OtherPCType &  other,
Vector< std::map< std::pair< int, int >, amrex::NeighborList< typename OtherPCType::ParticleType > > > &  neighbor_lists,
bool   
)

◆ buildNeighborMask()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::buildNeighborMask ( )

◆ cacheNeighborInfo()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::cacheNeighborInfo ( )
protected

◆ calcCommSize()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::calcCommSize ( )
protected

◆ clearNeighbors()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::clearNeighbors ( )

Each tile clears its neighbors, freeing the memory

◆ clearNeighborsGPU()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::clearNeighborsGPU ( )

◆ computeRefFac()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
IntVect NeighborParticleContainer::computeRefFac ( int  src_lev,
int  lev 
)
protected

◆ enableInverse()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::enableInverse ( )
inline

◆ fillNeighbors()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::fillNeighbors ( )

This fills the neighbor buffers for each tile with the proper data

◆ fillNeighborsGPU()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::fillNeighborsGPU ( )

◆ fillNeighborsMPI()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::fillNeighborsMPI ( bool  reuse_rcv_counts)
protected

Perform the MPI communication necessary to fill neighbor buffers

◆ GetCommTagsBox()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::GetCommTagsBox ( Vector< NeighborCommTag > &  tags,
int  lev,
const Box in_box 
)
protected

◆ GetNeighborCommTags()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::GetNeighborCommTags ( )
protected

◆ GetNeighbors() [1/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
ParticleTile& amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::GetNeighbors ( int  lev,
int  grid,
int  tile 
)
inline

◆ GetNeighbors() [2/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
const ParticleTile& amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::GetNeighbors ( int  lev,
int  grid,
int  tile 
) const
inline

◆ getNeighborTags() [1/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::getNeighborTags ( Vector< NeighborCopyTag > &  tags,
const ParticleType p,
const IntVect nGrow,
const NeighborCopyTag src_tag,
const MyParIter pti 
)
protected

◆ getNeighborTags() [2/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::getNeighborTags ( Vector< NeighborCopyTag > &  tags,
const ParticleType p,
int  nGrow,
const NeighborCopyTag src_tag,
const MyParIter pti 
)
protected

◆ getRcvCountsMPI()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::getRcvCountsMPI ( )
protected

Perform handshake to figure out how many bytes each proc should receive

◆ hasNeighbors()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::hasNeighbors ( ) const
inlineprotected

◆ initializeCommComps()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::initializeCommComps ( )
protected

◆ operator=() [1/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborParticleContainer& amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::operator= ( const NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt > &  )
delete

◆ operator=() [2/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborParticleContainer& amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::operator= ( NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt > &&  )
default

◆ printNeighborList()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::printNeighborList ( )

◆ Redistribute()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::Redistribute ( int  lev_min = 0,
int  lev_max = -1,
int  nGrow = 0,
int  local = 0 
)
inline

◆ RedistributeLocal()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::RedistributeLocal ( )
inline

◆ Regrid() [1/3]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::Regrid ( const DistributionMapping dmap,
const BoxArray ba 
)

Regrid functions

◆ Regrid() [2/3]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::Regrid ( const DistributionMapping dmap,
const BoxArray ba,
int  lev 
)

◆ Regrid() [3/3]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::Regrid ( const Vector< DistributionMapping > &  dmap,
const Vector< BoxArray > &  ba 
)

◆ resizeContainers()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::resizeContainers ( int  num_levels)
protected

◆ selectActualNeighbors() [1/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::selectActualNeighbors ( CheckPair const &  check_pair,
int  num_cells 
)

◆ selectActualNeighbors() [2/2]

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
template<class CheckPair >
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::selectActualNeighbors ( CheckPair const &  check_pair,
int  num_cells = 1 
)

◆ setEnableInverse()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::setEnableInverse ( bool  flag)
inline

◆ setIntCommComp()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::setIntCommComp ( int  i,
bool  value 
)

◆ setRealCommComp()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::setRealCommComp ( int  i,
bool  value 
)

◆ sumNeighbors()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::sumNeighbors ( int  real_start_comp,
int  real_num_comp,
int  int_start_comp,
int  int_num_comp 
)

This does an "inverse" fillNeighbors operation, meaning that it adds data from the ghost particles to the corresponding real ones.

◆ sumNeighborsMPI()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::sumNeighborsMPI ( std::map< int, Vector< char > > &  not_ours,
int  real_start_comp,
int  real_num_comp,
int  int_start_comp,
int  int_num_comp 
)
protected

◆ updateNeighbors()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::updateNeighbors ( bool  boundary_neighbors_only = false)

This updates the neighbors with their current particle data.

◆ updateNeighborsGPU()

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
void NeighborParticleContainer::updateNeighborsGPU ( bool  boundary_neighbors_only = false)

Friends And Related Function Documentation

◆ operator<<

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::ostream& operator<< ( std::ostream &  os,
const InverseCopyTag tag 
)
friend

Member Data Documentation

◆ buffer_tag_cache

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<PairIndex, Vector<Vector<NeighborCopyTag> > > > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::buffer_tag_cache
protected

◆ cdata_size

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
size_t amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::cdata_size
protected

◆ enable_inverse

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool NeighborParticleContainer::enable_inverse = false
staticprotected

◆ ghost_int_comp

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<int> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ghost_int_comp
protected

◆ ghost_real_comp

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<int> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::ghost_real_comp
protected

◆ inverse_tags

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<PairIndex, Vector<InverseCopyTag> > > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::inverse_tags
protected

◆ local_neighbor_sizes

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<PairIndex, int> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::local_neighbor_sizes
protected

◆ local_neighbors

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<NeighborCommTag> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::local_neighbors
protected

◆ m_boundary_particle_ids

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<std::pair<int, int>, amrex::Gpu::DeviceVector<int> > > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_boundary_particle_ids
protected

◆ m_code_array

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::map<int, amrex::Gpu::DeviceVector<NeighborCode> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_code_array
protected

◆ m_code_offsets

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::map<int, amrex::Gpu::DeviceVector<int> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_code_offsets
protected

◆ m_grid_map

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::map<int, std::vector<std::vector<NeighborCode> > > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_grid_map
protected

◆ m_has_neighbors

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_has_neighbors = false
protected

◆ m_isec_boxes

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::map<int, amrex::Gpu::DeviceVector<Box> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_isec_boxes
protected

◆ m_neighbor_list

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
NeighborListContainerType amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_neighbor_list
protected

◆ m_neighbor_mask_initialized

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_neighbor_mask_initialized = false
protected

◆ m_neighbor_mask_ptr

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::unique_ptr<amrex::iMultiFab> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_neighbor_mask_ptr
protected

◆ m_num_neighbor_cells

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
int amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::m_num_neighbor_cells
protected

◆ mask_ptr

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::unique_ptr<iMultiFab> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::mask_ptr
protected

◆ neighbor_copy_op

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
ParticleCopyOp amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::neighbor_copy_op
protected

◆ neighbor_copy_plan

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
ParticleCopyPlan amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::neighbor_copy_plan
protected

◆ neighbor_list

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<PairIndex, IntVector> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::neighbor_list
protected

◆ neighbor_procs

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<int> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::neighbor_procs
protected

each proc knows how many sends it will do, and how many bytes it will rcv from each other proc.

◆ neighbors

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<std::map<PairIndex, ParticleTile> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::neighbors
protected

◆ num_mask_comps

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
constexpr int amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::num_mask_comps = 3
staticconstexprprotected

grid, tile, level

◆ num_snds

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Long amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::num_snds
protected

◆ pdata_size

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
constexpr size_t amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::pdata_size = sizeof(ParticleType)
staticconstexprprotected

◆ pinned_rcv_buffer

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Gpu::PinnedVector<char> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::pinned_rcv_buffer
protected

◆ pinned_snd_buffer

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Gpu::PinnedVector<char> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::pinned_snd_buffer
protected

◆ rcv_buffer

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
amrex::Gpu::DeviceVector<char> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::rcv_buffer
protected

◆ rcvs

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
Vector<Long> amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::rcvs
protected

◆ send_data

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
std::map<int, Vector<char> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::send_data
protected

◆ snd_buffer

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
amrex::PODVector<char, PolymorphicArenaAllocator<char> > amrex::NeighborParticleContainer< NStructReal, NStructInt, NArrayReal, NArrayInt >::snd_buffer
protected

◆ use_mask

template<int NStructReal, int NStructInt, int NArrayReal = 0, int NArrayInt = 0>
bool NeighborParticleContainer::use_mask = false
staticprotected

The documentation for this class was generated from the following files: