ESyS-Particle
4.0.1
|
parrallel particle storage array with neighborsearch and variable exchange More...
#include <pp_array.h>
Classes | |
class | ParticleIterator |
Public Member Functions | |
ParallelParticleArray (TML_Comm *comm, const vector< unsigned int > &dims, const Vec3 &min, const Vec3 &max, double rmax, double alpha) | |
ParallelParticleArray (TML_Comm *comm, const vector< unsigned int > &dims, const vector< bool > &circ, const Vec3 &min, const Vec3 &max, double rmax, double alpha) | |
~ParallelParticleArray () | |
Vec3 | getMinPos () const |
Vec3 | getMaxPos () const |
vector< int > | getCommCoords () const |
vector< int > | getCommDims () const |
int | size () |
int | getInnerSize () |
void | insert (const T &) |
particle insertion | |
void | insert (const vector< T > &) |
multi particle insert | |
virtual bool | isInInner (const Vec3 &) |
T * | getParticlePtrByIndex (int) |
T * | getParticlePtrByPosition (const Vec3 &) |
void | rebuild () |
template<typename P > | |
void | exchange (P(T::*rdf)(), void(T::*wrtf)(const P &)) |
void | forParticle (int, void(T::*rdf)()) |
template<typename P > | |
void | forParticle (int, void(T::*rdf)(P), const P &) |
void | forParticleTag (int, void(T::*rdf)()) |
template<typename P > | |
void | forParticleTag (int, void(T::*rdf)(P), const P &) |
void | forParticleTagMask (int, int, void(T::*rdf)()) |
template<typename P > | |
void | forParticleTagMask (int, int, void(T::*rdf)(P), const P &) |
void | forAllParticles (void(T::*rdf)()) |
void | forAllParticles (void(T::*rdf)() const) |
template<typename P > | |
void | forAllParticles (void(T::*rdf)(P), const P &) |
template<typename P > | |
void | forAllInnerParticles (void(T::*rdf)(P &), P &) |
ParticleIterator | getInnerParticleIterator () |
template<typename P > | |
void | forAllParticlesGet (P &, typename P::value_type(T::*rdf)() const) |
template<typename P > | |
void | forAllInnerParticlesGet (P &, typename P::value_type(T::*rdf)() const) |
template<typename P > | |
vector< pair< int, P > > | forAllParticlesGetIndexed (P(T::*rdf)() const) |
template<typename P > | |
vector< pair< int, P > > | forAllInnerParticlesGetIndexed (P(T::*rdf)() const) |
template<typename P > | |
void | forAllTaggedParticlesGet (P &, typename P::value_type(T::*rdf)() const, int, int) |
template<typename P > | |
void | forAllTaggedInnerParticlesGet (P &, typename P::value_type(T::*rdf)() const, int, int) |
template<typename P > | |
vector< pair< int, P > > | forAllTaggedParticlesGetIndexed (P(T::*rdf)() const, int, int) |
template<typename P > | |
vector< pair< int, P > > | forAllInnerTaggedParticlesGetIndexed (P(T::*rdf)() const, int, int) |
template<typename P > | |
void | forPointsGetNearest (P &, typename P::value_type(T::*rdf)() const, const Vec3 &, double, double, double, int, int, int) |
virtual set< int > | getBoundarySlabIds (int, int) const |
virtual set< int > | get2ndSlabIds (int, int) const |
PairListHandle | getFullPairList () |
Get list of all pairs. Forwards to NTable::getFullList(). | |
PairListHandle | getNewPairList () |
Get list of new pairs. Forwards to NTable::getNewList(). | |
ParticleListHandle | getParticlesAtPlane (Vec3 o, Vec3 n) |
Get list of particles along a plane. Forwards to NTable::getParticlesAtPlane. | |
ParticleListHandle | getParticlesNearTriangle (const Triangle &t) |
Get list of particles near a triangle. Forwards to NTable::getParticlesNearTriangle. | |
ParticleListHandle | getParticlesNearEdge (const AEdge *e) |
Get list of particles near an edge. Forwards to NTable::getParticlesNearEdge. | |
ParticleListHandle | getParticlesNearPoint (const Vec3 &v) |
Get list of particles near a point. Forwards to NTable::getParticlesNearEdge. | |
ParticleListHandle | getAllParticles () |
Get list of all particles. Forwards to NTable. | |
void | getAllInnerParticles (vector< T > &) |
get all particles in inner block and put them into a vector | |
void | saveCheckPointData (std::ostream &) |
void | loadCheckPointData (std::istream &) |
![]() | |
AParallelParticleArray (TML_Comm *comm, const std::vector< unsigned int > &dims) | |
AParallelParticleArray (TML_Comm *comm, const std::vector< unsigned int > &dims, const std::vector< bool > &circ) | |
TML_CartComm | getComm () const |
int | getTimeStamp () |
return time stamp of last rebuild |
Friends | |
template<typename TT > | |
ostream & | operator<< (ostream &, const ParallelParticleArray< TT > &) |
Additional Inherited Members | |
![]() | |
TML_CartComm | m_comm |
int | m_timestamp |
parrallel particle storage array with neighborsearch and variable exchange
ParallelParticleArray< T >::ParallelParticleArray | ( | TML_Comm * | comm, |
const vector< unsigned int > & | dims, | ||
const vector< bool > & | circ, | ||
const Vec3 & | min, | ||
const Vec3 & | max, | ||
double | range, | ||
double | alpha | ||
) |
Construct a parallel particle array from a given communicator and geometr, i.e. minimum and maximum corners and search range. The process topology is generated from the communicator (via MPI_Dims_create). The boundary conditions i.e. circular or open are given as parameter.
comm | the communicator |
dims | the dimensions the process space. {dims[0]=0; dims[1]=0; dims[2]=0;}–is 3D allocation of processors. {dims[0]=0; dims[1]=0; dims[2]=1;}–is 2D allocation of processors. {dims[0]=0; dims[1]=1; dims[2]=1;}–is 1D allocation of processors. |
circ | circular/open boundary conditions {circ[0] : x-direction, circ[1] : y-direction and circ[2] : z-direction, {true : circular, false : open} |
min | the (global) minimum corner of the model space |
max | the (global) maximum corner of the model space |
range | the search range |
alpha | the pair search cutoff |
References TML_CartComm::get_coords(), and TML_CartComm::get_dim().
ParallelParticleArray< T >::~ParallelParticleArray | ( | ) |
destructor
void ParallelParticleArray< T >::exchange | ( | P(T::*)() | rdf, |
void(T::*)(const P &) | wrtf | ||
) |
For all particles shared with neighboring nodes, exchange some value accessible by read and write functions.
rdf | the particle member function to read the value |
wrtf | the particle member function to write the value |
void ParallelParticleArray< T >::forAllInnerParticles | ( | void(T::*)(P &) | fnc, |
P & | arg | ||
) |
call a particle member function taking one argument for all inner particles
fnc | the particle member function |
arg | the argument to the particle member function |
void ParallelParticleArray< T >::forAllInnerParticlesGet | ( | P & | cont, |
typename P::value_type(T::*)() const | rdf | ||
) |
Get a value for all inner particle using a particle member function and return the values in a container.
cont | the container |
rdf | the particle member function |
vector< pair< int, P > > ParallelParticleArray< T >::forAllInnerParticlesGetIndexed | ( | P(T::*)() const | rdf | ) |
Get a value all inner particles using a particle member function and return a vector of pairs of the particle id and the value.
rdf | the particle member function |
vector< pair< int, P > > ParallelParticleArray< T >::forAllInnerTaggedParticlesGetIndexed | ( | P(T::*)() const | rdf, |
int | tag, | ||
int | mask | ||
) |
Get a value all inner particles which have a tag fitting a given tag and mask using a particle member function and return a vector of pairs of the particle id and the value.
rdf | the particle member function |
tag | the particle tag |
mask | the mask |
void ParallelParticleArray< T >::forAllParticles | ( | void(T::*)() | fnc | ) |
call a particle member function taking no argument for all particles
call a const particle member function taking no argument for all particles
void ParallelParticleArray< T >::forAllParticles | ( | void(T::*)(P) | fnc, |
const P & | arg | ||
) |
call a particle member function taking one argument for all particles
fnc | the particle member function |
arg | the argument to the particle member function |
void ParallelParticleArray< T >::forAllParticlesGet | ( | P & | cont, |
typename P::value_type(T::*)() const | rdf | ||
) |
Call a constant particle member function taking no argument and returning a value for all particles and collect the return values in a container. The container has to be an STL sequence container (vector,list...) or something with the same interface. The template parameter P is a type of container of the return type of the particle member function, not the return type itself. The container had to be reference argument because template instantiation based only on return type is impossible.
cont | the container |
rdf | the particle member function |
vector< pair< int, P > > ParallelParticleArray< T >::forAllParticlesGetIndexed | ( | P(T::*)() const | rdf | ) |
Get a value for each particle using a particle member function and return a vector of pairs of the particle id and the value.
rdf | the particle member function |
void ParallelParticleArray< T >::forAllTaggedInnerParticlesGet | ( | P & | cont, |
typename P::value_type(T::*)() const | rdf, | ||
int | tag, | ||
int | mask | ||
) |
Get a value for all inner particle which have a tag fitting a given tag and mask using a particle member function and return the values in a container.
cont | the container |
rdf | the particle member function |
tag | the particle tag |
mask | the mask |
void ParallelParticleArray< T >::forAllTaggedParticlesGet | ( | P & | cont, |
typename P::value_type(T::*)() const | rdf, | ||
int | tag, | ||
int | mask | ||
) |
Call a constant particle member function taking no argument and returning a value for all particles which have a tag fitting a given tag and mask and collect the return values in a container. The container has to be an STL sequence container (vector,list...) or something with the same interface. The template parameter P is a type of container of the return type of the particle member function, not the return type itself. The container had to be reference argument because template instantiation based only on return type is impossible.
cont | the container |
rdf | the particle member function |
tag | the particle tag |
mask | the mask |
vector< pair< int, P > > ParallelParticleArray< T >::forAllTaggedParticlesGetIndexed | ( | P(T::*)() const | rdf, |
int | tag, | ||
int | mask | ||
) |
Get a value for each particle which has a tag fitting a given tag and mask using a particle member function and return a vector of pairs of the particle id and the value.
rdf | the particle member function |
tag | the particle tag |
mask | the mask |
void ParallelParticleArray< T >::forParticle | ( | int | id, |
void(T::*)() | mf | ||
) |
Call a member function taking no argument for one particle. Do nothing if the particle with the id is not in the ntable.
id | the id of the particle |
mf | the member function |
void ParallelParticleArray< T >::forParticle | ( | int | id, |
void(T::*)(P) | mf, | ||
const P & | arg | ||
) |
Call a member function taking one argument for one particle. Do nothing if the particle with the id is not in the ntable.
id | the id of the particle |
mf | the member function |
arg | the argument to the function call |
void ParallelParticleArray< T >::forParticleTag | ( | int | tag, |
void(T::*)() | mf | ||
) |
Call a member function taking no argument for all particles with a given tag.
tag | the tag |
mf | the member function |
void ParallelParticleArray< T >::forParticleTag | ( | int | tag, |
void(T::*)(P) | mf, | ||
const P & | arg | ||
) |
Call a member function taking one argument for all particleswith a given tag.
tag | the tag |
mf | the member function |
arg | the argument to the function call |
void ParallelParticleArray< T >::forParticleTagMask | ( | int | tag, |
int | mask, | ||
void(T::*)() | mf | ||
) |
Call a member function taking no argument for all particles with a given tag and mask. The functions is called if the masked bits in the particle tag and the given tag are identical, i.e. if ptag & mask == tag & mask
tag | the tag |
mask | the mask |
mf | the member function |
void ParallelParticleArray< T >::forParticleTagMask | ( | int | tag, |
int | mask, | ||
void(T::*)(P) | mf, | ||
const P & | arg | ||
) |
Call a member function taking one argument for all particles with a given tag and mask. The functions is called if the masked bits in the particle tag and the given tag are identical, i.e. if ptag & mask == tag & mask
tag | the tag |
mask | the mask |
mf | the member function |
arg | the argument to the function call |
void ParallelParticleArray< T >::forPointsGetNearest | ( | P & | cont, |
typename P::value_type(T::*)() const | rdf, | ||
const Vec3 & | orig, | ||
double | dx, | ||
double | dy, | ||
double | dz, | ||
int | nx, | ||
int | ny, | ||
int | nz | ||
) |
get a value for the nearest particle to each point of a grid using a particle member function and return a container with the values
cont | the container |
rdf | the particle member function returning the value |
orig | the base point of the grid |
dx | the grid spacing in x-direction |
dy | the grid spacing in y-direction |
dz | the grid spacing in z-direction |
nx | the grid size in x-direction |
ny | the grid size in y-direction |
nz | the grid size in z-direction |
References BasicCon::Debug().
|
virtual |
Get the Ids of all particles in the slab next to the boundary.
dir | the direction ,i.e. 0->x, 1->y and 2->z |
up | up (1) or down (-1) |
Implements AParallelParticleArray.
void ParallelParticleArray< T >::getAllInnerParticles | ( | vector< T > & | pv | ) |
get all particles in inner block and put them into a vector
get all particles in inner block and put them into a vector
pv | a reference to the vector |
|
virtual |
Get the Ids of all particles in the boundary slab.
dir | the direction ,i.e. 0->x, 1->y and 2->z |
up | up (1) or down (-1) |
Implements AParallelParticleArray.
T * ParallelParticleArray< T >::getParticlePtrByIndex | ( | int | id | ) |
Get the pointer to a particle with a given id. Return NULL if there is no particle with this index.
id | the particle id. |
Referenced by ParallelInteractionStorage_EB< P, I >::loadCheckPointData(), TriMesh_PIS_EB< ParticleType, IType >::rebuild(), ParallelInteractionStorage_E< P, I >::rebuild(), Mesh2D_PIS_EB< ParticleType, IType >::rebuild(), and Mesh2D_PIS_EB< ParticleType, IType >::tryInsert().
T * ParallelParticleArray< T >::getParticlePtrByPosition | ( | const Vec3 & | pos | ) |
Get the pointer to a particle closest to a given position. Return NULL if the position is outside the area.
pos | the position. |
void ParallelParticleArray< T >::insert | ( | const T & | p | ) |
particle insertion
insert a single particle into the storage
p | the particle |
void ParallelParticleArray< T >::insert | ( | const vector< T > & | vp | ) |
multi particle insert
insert a STL vector of particles into the storage
vp | the vector of particles |
|
virtual |
check if a position is in the inner part
pos | the position |
Implements AParallelParticleArray.
Referenced by ParallelParticleArray< T >::loadCheckPointData(), CViscWallIG< T >::Update(), and CBWallInteractionGroup< T >::Update().
void ParallelParticleArray< T >::loadCheckPointData | ( | std::istream & | ist | ) |
load checkpoint data from an istream
ist | the input stream |
References BasicCon::Debug(), and ParallelParticleArray< T >::isInInner().
void ParallelParticleArray< T >::rebuild | ( | ) |
Rebuild the neighbor table, i.e. relocate particles to the appropriate gridpoints and exchange boundary particles with neighboring nodes. No (geometric) resizing done.
void ParallelParticleArray< T >::saveCheckPointData | ( | std::ostream & | ost | ) |
save checkpoint data into an ostream
ost | the output stream |
References BasicCon::Debug().