CellModules
MecaCell::Grid< O > Class Template Reference

Infinite grid of fixed cell size for space partitioning. More...

#include <grid.hpp>

Public Member Functions

 Grid (double cs)
 
size_t size ()
 
std::vector< std::pair< Vec, std::vector< O > > > & getOrderedVec ()
 
std::unordered_map< Vec, size_t > & getUnorderedMap ()
 
double getCellSize () const
 
const std::vector< std::pair< Vec, std::vector< O > > > & getContent () const
 
std::array< vector< vector< O > >, 8 > getThreadSafeGrid () const
 
std::array< vector< vector< O > >, 8 > getThreadSafeGrid (size_t minEl) const
 
size_t vecToColor (const Vec &v) const
 
template<typename V >
void insert (V &&k, const O &o)
 
void insertOnlyCenter (const O &obj)
 
void insert (const O &obj)
 
void insertPrecise (const O &obj)
 
void insert (const O &obj, const Vec &p0, const Vec &p1, const Vec &p2)
 
Vec getIndexFromPosition (const Vec &v) const
 
vector< O > retrieve (const Vec &center, double radius) const
 
vector< O > retrieve (const O &obj) const
 
double computeSurface () const
 
double getVolume () const
 
double computeSphericity () const
 
int getNbNeighbours (const Vec &cell) const
 
void clear ()
 

Private Attributes

double cellSize
 
std::unordered_map< Vec, size_t > um
 
std::vector< std::pair< Vec, std::vector< O > > > orderedVec
 

Detailed Description

template<typename O>
class MecaCell::Grid< O >

Infinite grid of fixed cell size for space partitioning.

Template Parameters
Othe type of object that are stored

Definition at line 21 of file grid.hpp.

Constructor & Destructor Documentation

◆ Grid()

template<typename O >
MecaCell::Grid< O >::Grid ( double  cs)
inline

Definition at line 28 of file grid.hpp.

Member Function Documentation

◆ clear()

template<typename O >
void MecaCell::Grid< O >::clear ( )
inline

Definition at line 228 of file grid.hpp.

◆ computeSphericity()

template<typename O >
double MecaCell::Grid< O >::computeSphericity ( ) const
inline

Definition at line 210 of file grid.hpp.

◆ computeSurface()

template<typename O >
double MecaCell::Grid< O >::computeSurface ( ) const
inline

Definition at line 192 of file grid.hpp.

◆ getCellSize()

template<typename O >
double MecaCell::Grid< O >::getCellSize ( ) const
inline

Definition at line 33 of file grid.hpp.

◆ getContent()

template<typename O >
const std::vector< std::pair< Vec, std::vector< O > > > & MecaCell::Grid< O >::getContent ( ) const
inline

Definition at line 35 of file grid.hpp.

◆ getIndexFromPosition()

template<typename O >
Vec MecaCell::Grid< O >::getIndexFromPosition ( const Vec v) const
inline

Definition at line 166 of file grid.hpp.

◆ getNbNeighbours()

template<typename O >
int MecaCell::Grid< O >::getNbNeighbours ( const Vec cell) const
inline

Definition at line 217 of file grid.hpp.

◆ getOrderedVec()

template<typename O >
std::vector< std::pair< Vec, std::vector< O > > > & MecaCell::Grid< O >::getOrderedVec ( )
inline

Definition at line 30 of file grid.hpp.

◆ getThreadSafeGrid() [1/2]

template<typename O >
std::array< vector< vector< O > >, 8 > MecaCell::Grid< O >::getThreadSafeGrid ( ) const
inline

Definition at line 39 of file grid.hpp.

◆ getThreadSafeGrid() [2/2]

template<typename O >
std::array< vector< vector< O > >, 8 > MecaCell::Grid< O >::getThreadSafeGrid ( size_t  minEl) const
inline

Definition at line 46 of file grid.hpp.

◆ getUnorderedMap()

template<typename O >
std::unordered_map< Vec, size_t > & MecaCell::Grid< O >::getUnorderedMap ( )
inline

Definition at line 31 of file grid.hpp.

◆ getVolume()

template<typename O >
double MecaCell::Grid< O >::getVolume ( ) const
inline

Definition at line 204 of file grid.hpp.

◆ insert() [1/3]

template<typename O >
void MecaCell::Grid< O >::insert ( const O &  obj)
inline

Definition at line 87 of file grid.hpp.

◆ insert() [2/3]

template<typename O >
void MecaCell::Grid< O >::insert ( const O &  obj,
const Vec p0,
const Vec p1,
const Vec p2 
)
inline

Definition at line 148 of file grid.hpp.

◆ insert() [3/3]

template<typename O >
template<typename V >
void MecaCell::Grid< O >::insert ( V &&  k,
const O &  o 
)
inline

Definition at line 75 of file grid.hpp.

◆ insertOnlyCenter()

template<typename O >
void MecaCell::Grid< O >::insertOnlyCenter ( const O &  obj)
inline

Definition at line 83 of file grid.hpp.

◆ insertPrecise()

template<typename O >
void MecaCell::Grid< O >::insertPrecise ( const O &  obj)
inline

Definition at line 108 of file grid.hpp.

◆ retrieve() [1/2]

template<typename O >
vector< O > MecaCell::Grid< O >::retrieve ( const O &  obj) const
inline

Definition at line 188 of file grid.hpp.

◆ retrieve() [2/2]

template<typename O >
vector< O > MecaCell::Grid< O >::retrieve ( const Vec center,
double  radius 
) const
inline

Definition at line 171 of file grid.hpp.

◆ size()

template<typename O >
size_t MecaCell::Grid< O >::size ( )
inline

Definition at line 29 of file grid.hpp.

◆ vecToColor()

template<typename O >
size_t MecaCell::Grid< O >::vecToColor ( const Vec v) const
inline

Definition at line 71 of file grid.hpp.

Member Data Documentation

◆ cellSize

template<typename O >
double MecaCell::Grid< O >::cellSize
private

Definition at line 23 of file grid.hpp.

◆ orderedVec

template<typename O >
std::vector<std::pair<Vec, std::vector<O> > > MecaCell::Grid< O >::orderedVec
private

Definition at line 25 of file grid.hpp.

◆ um

template<typename O >
std::unordered_map<Vec, size_t> MecaCell::Grid< O >::um
private

Definition at line 24 of file grid.hpp.


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