|
ESyS-Particle
2.3.4
|
class for neighbor search More...
#include <ntable.h>


Public Types | |
| typedef valarray< vector< typename list< T >::iterator > > | arraytype |
| typedef vector< typename list< T >::iterator > | pointtype |
| typedef pair< int, int > | indextype |
| typedef list< pair< T *, T * > > | pairlist |
| typedef list< T * > | particlelist |
| typedef std::map< int, T * > | IdParticleMap |
| typedef list< T >::iterator | iterator |
Public Member Functions | |
| NeighborTable () | |
| Constructors. More... | |
| NeighborTable (int, int, int, double, double, const Vec3 &, int, int, int) | |
| ~NeighborTable () | |
| void | insert (const T &) |
| particle insertion More... | |
| void | insert (iterator i, const T &data) |
| void | build () |
| STL compat. insert. More... | |
| int | index (int, int, int) const |
| iterator | begin () |
| < iterators More... | |
| iterator | end () |
| unsigned int | nparts_at_gridpoint (unsigned int idx) const |
| number of particles at a given gridpoint More... | |
| bool | isInInner (const Vec3 &) |
| dimensions More... | |
| int | xsize () |
| int | ysize () |
| int | zsize () |
| int | size () |
| Vec3 | base_point () const |
| int | base_idx_x () const |
| int | base_idx_y () const |
| int | base_idx_z () const |
| NTSlab< T > | xy_slab (int) |
| partial access functions More... | |
| NTSlab< T > | xz_slab (int) |
| NTSlab< T > | yz_slab (int) |
| NTBlock< T > | block (int, int, int, int, int, int) |
| NTBlock< T > | block (const Vec3 &, const Vec3 &) |
| NTBlock< T > | inner () |
| T * | ptr (NeighborTable< T >::indextype) |
| T & | ref (NeighborTable< T >::indextype) |
| T * | ptr_by_id (int) |
| T * | getNearestPtr (const Vec3 &) |
| void | erase (NeighborTable< T >::indextype) |
| T_Handle< pairlist > | getFullList () |
| T_Handle< pairlist > | getNewList () |
| T_Handle< particlelist > | getParticlesAtPlane (const Vec3 &, const Vec3 &) |
| T_Handle< particlelist > | getParticlesNearSphere (const Vec3 &, const double &) |
| T_Handle< particlelist > | getParticlesNearTriangle (const Triangle &) |
| T_Handle< particlelist > | getParticlesNearEdge (const AEdge *) |
| T_Handle< particlelist > | getParticlesNearPoint (const Vec3 &) |
| T_Handle< particlelist > | getAllParticles () |
Private Member Functions | |
| void | clear_search_array () |
| int | index (const Vec3 &) |
| void | addPairsToList (T_Handle< pairlist >, int, int) |
| void | addPairsToListLocal (T_Handle< pairlist >, int) |
| void | addPairsToListFlagged (T_Handle< pairlist >, int, int) |
| void | addPairsToListLocalFlagged (T_Handle< pairlist >, int) |
| arraytype * | array () |
Private Attributes | |
| list< T > | m_list |
| list of particles More... | |
| arraytype | m_array |
| search array More... | |
| IdParticleMap | m_idParticleMap |
| mapping between particle-id and particle-pointer More... | |
| Vec3 | m_p0_global |
| minimum corner of global search space More... | |
| double | m_dim |
| grid spacing of search array More... | |
| double | m_alpha |
| padding factor (dim=2*rmax+alpha) More... | |
| int | m_global_idx |
| minimum corner index (x component) More... | |
| int | m_global_idy |
| minimum corner index (y component) More... | |
| int | m_global_idz |
| minimum corner index (z component) More... | |
| int | m_xsize |
| number of grid point, x direction More... | |
| int | m_ysize |
| number of grid point, y direction More... | |
| int | m_zsize |
| number of grid point, z direction More... | |
| bool | m_valid |
| Vec3 | m_min_corner |
| minimum corner of the search array More... | |
| Vec3 | m_max_corner |
| maximum corner of the search array More... | |
Friends | |
| template<typename TT > | |
| std::ostream & | operator<< (std::ostream &, const NeighborTable< TT > &) |
| output More... | |
class for neighbor search
| typedef valarray<vector<typename list<T>::iterator> > NeighborTable< T >::arraytype |
| typedef std::map<int, T*> NeighborTable< T >::IdParticleMap |
| typedef pair<int,int> NeighborTable< T >::indextype |
| typedef list<T>::iterator NeighborTable< T >::iterator |
| typedef list<pair<T*,T*> > NeighborTable< T >::pairlist |
| typedef list<T*> NeighborTable< T >::particlelist |
| typedef vector<typename list<T>::iterator> NeighborTable< T >::pointtype |
| NeighborTable< T >::NeighborTable |
Constructors.
construct an empty, uninitialized NeighborTable -> not usable
| NeighborTable< T >::NeighborTable | ( | int | x, |
| int | y, | ||
| int | z, | ||
| double | range, | ||
| double | alpha, | ||
| const Vec3 & | p0_global, | ||
| int | ix, | ||
| int | iy, | ||
| int | iz | ||
| ) |
construct neigbortable with known dimensions
| x | nr. of grid points in x-direction |
| y | nr. of grid points in y-direction |
| z | nr. of grid points in z-direction |
| range | grid spacing |
| alpha | pair search cutoff |
| p0_global | minimal corner (origin) of the global search space |
| ix | x-index of the local origin |
| iy | y-index of the local origin |
| iz | z-index of the local origin |
References console, Console::Debug(), NeighborTable< T >::m_array, NeighborTable< T >::m_dim, NeighborTable< T >::m_global_idx, NeighborTable< T >::m_global_idy, NeighborTable< T >::m_global_idz, NeighborTable< T >::m_max_corner, NeighborTable< T >::m_min_corner, NeighborTable< T >::m_p0_global, NeighborTable< T >::m_xsize, NeighborTable< T >::m_ysize, NeighborTable< T >::m_zsize, Vec3::X(), Vec3::Y(), and Vec3::Z().

| NeighborTable< T >::~NeighborTable |
destruct NeighborTable
|
private |
Add pairs containing the particles at two given gridpoints to list.
| list | the pairlist |
| idx1 | the index of the first gridpoint |
| idx2 | the index of the second gridpoint |
References esys::lsm::bpu::iter().

|
private |
Add pairs containing at least one flagged particle at two given gridpoints to list.
| list | the pairlist |
| idx1 | the index of the first gridpoint |
| idx2 | the index of the second gridpoint |
References esys::lsm::bpu::iter().

|
private |
Add pairs containing the particles at one given gridpoint to list.
| list | the pairlist |
| idx | the index of the gridpoint |
References esys::lsm::bpu::iter().

|
private |
Add pairs containing at least one flagged particle at one given gridpoint to list.
| list | the pairlist |
| idx | the index of the gridpoint |
References esys::lsm::bpu::iter().

|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
< iterators
Referenced by DataExtractor::MaxShearToScalarData(), DataExtractor::StrainToTensorData(), and DataExtractor::writeScalarDataVtk().

| NTBlock< T > NeighborTable< T >::block | ( | const Vec3 & | vmin, |
| const Vec3 & | vmax | ||
| ) |
| NTBlock< T > NeighborTable< T >::block | ( | int | xmin, |
| int | xmax, | ||
| int | ymin, | ||
| int | ymax, | ||
| int | zmin, | ||
| int | zmax | ||
| ) |
| void NeighborTable< T >::build |
STL compat. insert.
build search array
Build or rebuild the search array, calls clean_search_array. Particles outside the search space are removed from the list
References esys::lsm::bpu::iter().

|
private |
clean up the search array
References esys::lsm::bpu::iter().

|
inline |
Referenced by DataExtractor::MaxShearToScalarData(), DataExtractor::StrainToTensorData(), and DataExtractor::writeScalarDataVtk().

| void NeighborTable< T >::erase | ( | NeighborTable< T >::indextype | idx | ) |
erase particle (not meant to be used directly)
| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getAllParticles |
Get list of all particles
References esys::lsm::bpu::iter().
Referenced by main().


| T_Handle< typename NeighborTable< T >::pairlist > NeighborTable< T >::getFullList |
Create a full list of pair of neighboring particles and return handle to it.
Referenced by main().

| T * NeighborTable< T >::getNearestPtr | ( | const Vec3 & | pos | ) |
Return pointer to particle nearest to given position. Returns NULL if position is outside search area.
| pos | position |
References esys::lsm::bpu::iter(), and NULL.
Referenced by main().


| T_Handle< typename NeighborTable< T >::pairlist > NeighborTable< T >::getNewList |
Create a list of all pairs of neighboring particles involving a "flagged" particles and return handle to it.
References esys::lsm::bpu::iter().

| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getParticlesAtPlane | ( | const Vec3 & | orig, |
| const Vec3 & | normal | ||
| ) |
Get list of all particles along a given plane. Naive implementation, i.e. check all particles for distance to plane. The plane is given by one point an the normal.
| orig | The origin of the plane |
| normal | The normal of the plane |
References console, Console::Debug(), and esys::lsm::bpu::iter().
Referenced by main().


| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getParticlesNearEdge | ( | const AEdge * | E | ) |
Get list of all particles near a given edge. Checks all particles at grid within range of the bounding box of the triangle; (could be improved - search area via Bresenham)
| E | the Edge |
References NTBlock< T >::begin(), NTBlock< T >::end(), AEdge::getBoundingBoxMax(), AEdge::getBoundingBoxMin(), esys::lsm::bpu::iter(), AEdge::sep(), Vec3::X(), Vec3::Y(), and Vec3::Z().

| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getParticlesNearPoint | ( | const Vec3 & | p | ) |
Get list of all particles near a given point.
| p | the point |
References NTBlock< T >::begin(), NTBlock< T >::end(), esys::lsm::bpu::iter(), Vec3::X(), Vec3::Y(), and Vec3::Z().
Referenced by DataExtractor::StrainToTensorData().


| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getParticlesNearSphere | ( | const Vec3 & | centre, |
| const double & | radius | ||
| ) |
Get list of all particles near a given sphere. Naive implementation, i.e. check all particles for distance to sphere.
| centre | The centre of the sphere |
| radius | The radius of the sphere |
References console, Console::Debug(), and esys::lsm::bpu::iter().

| T_Handle< typename NeighborTable< T >::particlelist > NeighborTable< T >::getParticlesNearTriangle | ( | const Triangle & | Tr | ) |
Get list of all particles near a given triangle. Checks all particles at grid within range of the bounding box of the triangle; (could be improved)
| T | the triangle |
References NTBlock< T >::begin(), NTBlock< T >::end(), Triangle::getBoundingBoxMax(), Triangle::getBoundingBoxMin(), esys::lsm::bpu::iter(), Triangle::sep(), Vec3::X(), Vec3::Y(), and Vec3::Z().

|
private |
helper function which returns the index in the search array into which a given position is mapped. Returns -1 if pos is outside the search space
| the | position |
References Vec3::X(), and Vec3::Y().
Referenced by operator<<(), NTBlock< T >::ptr(), and NTBlock< T >::ref().


|
inline |
helper function which returns the index in the search array from given x-,y- and z-indices.
| x | the x-index |
| y | the y-index |
| z | the z-index |
| NTBlock< T > NeighborTable< T >::inner |
| void NeighborTable< T >::insert | ( | const T & | t | ) |
particle insertion
insert a particle into the NeighborTable
| t | the particle |
Referenced by main(), and DataExtractor::read().

|
inline |
| bool NeighborTable< T >::isInInner | ( | const Vec3 & | pos | ) |
dimensions
check if a position is in the inner part
| pos | the position |
|
inline |
number of particles at a given gridpoint
Referenced by operator<<().

| T * NeighborTable< T >::ptr | ( | NeighborTable< T >::indextype | idx | ) |
Return pointer to particle at index.
Referenced by NTBlock< T >::ptr(), and NTSlab< T >::ptr().

| T * NeighborTable< T >::ptr_by_id | ( | int | id | ) |
Return pointer to particle with given id. Return NULL if the table doesn't contain the particle.
| id | the id of the particle |
References console, Console::Debug(), and NULL.
Referenced by main().


| T & NeighborTable< T >::ref | ( | NeighborTable< T >::indextype | idx | ) |
Return reference to particle at index.
Referenced by NTBlock< T >::ref(), and NTSlab< T >::ref().

|
inline |
Referenced by DataExtractor::read(), and DataExtractor::writeScalarDataVtk().

|
inline |
| NTSlab< T > NeighborTable< T >::xy_slab | ( | int | z | ) |
partial access functions
Return representation for a slab of the search array in the xy-plane.
| z | position of the slab in z-direction |
Referenced by main().

| NTSlab< T > NeighborTable< T >::xz_slab | ( | int | y | ) |
Return representation for a slab of the search array in the xz-plane.
| y | position of the slab in y-direction |
Referenced by main().

|
inline |
| NTSlab< T > NeighborTable< T >::yz_slab | ( | int | x | ) |
Return representation for a slab of the search array in the yz-plane.
| x | position of the slab in x-direction |
Referenced by main().

|
inline |
|
friend |
output
|
private |
padding factor (dim=2*rmax+alpha)
|
private |
search array
Referenced by NeighborTable< DataParticle >::array(), NeighborTable< T >::NeighborTable(), NeighborTable< DataParticle >::nparts_at_gridpoint(), and operator<<().
|
private |
grid spacing of search array
Referenced by NeighborTable< T >::NeighborTable(), and operator<<().
|
private |
minimum corner index (x component)
Referenced by NeighborTable< DataParticle >::base_idx_x(), and NeighborTable< T >::NeighborTable().
|
private |
minimum corner index (y component)
Referenced by NeighborTable< DataParticle >::base_idx_y(), and NeighborTable< T >::NeighborTable().
|
private |
minimum corner index (z component)
Referenced by NeighborTable< DataParticle >::base_idx_z(), and NeighborTable< T >::NeighborTable().
|
private |
mapping between particle-id and particle-pointer
|
private |
list of particles
Referenced by NeighborTable< DataParticle >::begin(), NeighborTable< DataParticle >::end(), operator<<(), and NeighborTable< DataParticle >::size().
|
private |
maximum corner of the search array
Referenced by NeighborTable< T >::NeighborTable().
|
private |
minimum corner of the search array
Referenced by NeighborTable< T >::NeighborTable().
|
private |
minimum corner of global search space
Referenced by NeighborTable< DataParticle >::base_point(), and NeighborTable< T >::NeighborTable().
|
private |
|
private |
number of grid point, x direction
Referenced by NeighborTable< T >::NeighborTable(), operator<<(), and NeighborTable< DataParticle >::xsize().
|
private |
number of grid point, y direction
Referenced by NeighborTable< T >::NeighborTable(), operator<<(), and NeighborTable< DataParticle >::ysize().
|
private |
number of grid point, z direction
Referenced by NeighborTable< T >::NeighborTable(), operator<<(), and NeighborTable< DataParticle >::zsize().