LBIBCell
 All Classes Functions Variables Friends Pages
UtilLib::geometry::fastneighborlist< T > Class Template Reference

The fastneighborlist class is a class template putting objects of type T into a celllist data structur for efficient range queries. More...

#include <FastNeighborList.hpp>

Public Member Functions

 fastneighborlist (const double LX, const double LY, const unsigned int NX, const unsigned int NY)
 fastneighborlist Constructor More...
 
void addElement (T element)
 addElement Adds an element into the fastneighborlist data structure. More...
 
bool removeElement (T element)
 removeElement Removes an element from the fastneighborlist data structure. More...
 
void reset (std::map< unsigned int, T > elementmap)
 Completely rebuilds the fastneighborlist. T must expose getXPos(), getYPos() More...
 
void getGeometryNodesWithinRadius (std::vector< T > &queryresult, const double posx, const double posy, const double radius) const
 range query, returns all elements wich are within the radius. More...
 
void getGeometryNodesWithinRadiusWithAvoidance (std::vector< T > &queryresult, const double posx, const double posy, const double radius, const unsigned int avoidDomainID) const
 range query, but only nodes with domainID different from avoidDomainID More...
 
void getGeometryNodesWithinRadiusWithAvoidanceClosest (std::vector< T > &queryresult, const double posx, const double posy, const double radius, const unsigned int avoidDomainID) const
 return closest GeometryNode, but only nodes with domainID different from avoidDomainID More...
 
void displayContent () const
 displayContent Displays all the content in form [xindex,yindex]: (posx,posy) ...
 

Detailed Description

template<typename T>
class UtilLib::geometry::fastneighborlist< T >

The fastneighborlist class is a class template putting objects of type T into a celllist data structur for efficient range queries.

Attention
The elements of type T must expose ->getPosX(), ->getPosY(), ->getDomainIdOfAdjacentConnections.

Definition at line 76 of file FastNeighborList.hpp.

Constructor & Destructor Documentation

template<typename T >
UtilLib::geometry::fastneighborlist< T >::fastneighborlist ( const double  LX,
const double  LY,
const unsigned int  NX,
const unsigned int  NY 
)

fastneighborlist Constructor

Parameters
LXThe x domain size.
LYThe y domain size.
NXThe number of bins in x direction.
NYThe number of bins in y direction.

Definition at line 227 of file FastNeighborList.hpp.

Member Function Documentation

template<typename T>
void UtilLib::geometry::fastneighborlist< T >::addElement ( element)

addElement Adds an element into the fastneighborlist data structure.

Parameters
elementThe element to add.

Definition at line 245 of file FastNeighborList.hpp.

template<typename T>
void UtilLib::geometry::fastneighborlist< T >::getGeometryNodesWithinRadius ( std::vector< T > &  queryresult,
const double  posx,
const double  posy,
const double  radius 
) const

range query, returns all elements wich are within the radius.

Parameters
queryresultvector reference to store the result in. will be emptied beforehand.
posxThe x coordinate.
posyThe ycoordinate.
radiusThe radius to search within.

Definition at line 404 of file FastNeighborList.hpp.

template<typename T>
void UtilLib::geometry::fastneighborlist< T >::getGeometryNodesWithinRadiusWithAvoidance ( std::vector< T > &  queryresult,
const double  posx,
const double  posy,
const double  radius,
const unsigned int  avoidDomainID 
) const

range query, but only nodes with domainID different from avoidDomainID

Parameters
queryresultvector reference to store the result in. will be emptied beforehand.
posxThe x coordinate.
posyThe ycoordinate.
radiusThe radius to search within.
avoidDomainIDThe domainID to be avoided when returning *GeometryNode*s.

Definition at line 426 of file FastNeighborList.hpp.

template<typename T>
void UtilLib::geometry::fastneighborlist< T >::getGeometryNodesWithinRadiusWithAvoidanceClosest ( std::vector< T > &  queryresult,
const double  posx,
const double  posy,
const double  radius,
const unsigned int  avoidDomainID 
) const

return closest GeometryNode, but only nodes with domainID different from avoidDomainID

Parameters
queryresultvector reference to store the result in. will be emptied beforehand.
posxThe x coordinate.
posyThe ycoordinate.
radiusThe radius to search within.
avoidDomainIDThe domainID to be avoided when returning *GeometryNode*s.
Returns
The vector with 0 or 1 GeometryNode

Definition at line 447 of file FastNeighborList.hpp.

template<typename T>
bool UtilLib::geometry::fastneighborlist< T >::removeElement ( element)

removeElement Removes an element from the fastneighborlist data structure.

Parameters
elementThe element which shall be removed.
Returns
true if found+removed; false otherwise

Definition at line 254 of file FastNeighborList.hpp.

template<typename T>
void UtilLib::geometry::fastneighborlist< T >::reset ( std::map< unsigned int, T >  elementmap)

Completely rebuilds the fastneighborlist. T must expose getXPos(), getYPos()

Parameters
elementmapThe map containing the elements{GeometryNodeID, std::shared_ptr<nodes::GeometryNode>}

Definition at line 394 of file FastNeighborList.hpp.


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