OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
AdaptiveCylinderCone< dim, T > Class Template Reference

This class represent an Adaptive cylinder cone. More...

Detailed Description

template<unsigned int dim, typename T>
class AdaptiveCylinderCone< dim, T >

This class represent an Adaptive cylinder cone.

This class represent an N-dimensional adaptive cylinder cone

Parameters
Ttype of space ... Real Complex Integer
Ndimensionality of the adaptive cylinder cone

This shape is useful for adaptive particle search, in order to explain how is defined we take a 1D space where particles can interact each other with different radius

Given one particle we want to know all the neighborhood particles, all the neighborhood particles are given by all the particles included in the radius of interaction of the particle, plus all the other particles with radius big enough to interact with this particle or in other word all the particles that has this particle as neighborhood

If we see the problem to find the neighborhood of the 1D particles in a 2D space (x,r) with x=position and r=interaction radius of the particles.

all the particles neighborhood of one particle (x_p,r_p) are all the particles in the rectangle (x-r_p,0) and (x+r_p,r_p)

in the area r < r_p

and the cone defined by the two bases

(x-r_p,r_p) - (x+r_p,r_p) and (x-r_max,r_max) - (x+r_max,r_max)

This mean that one point (x_p,r_p) and r_max define the shape

Definition at line 71 of file AdaptiveCylinderCone.hpp.

#include <AdaptiveCylinderCone.hpp>

Public Types

typedef boost::fusion::vector< T[dim]> type
 boost fusion that store the point
 

Public Member Functions

template<typename distance >
bool Intersect (Box< dim, T > b)
 This function check if a box intersect this shape.
 
template<typename distance >
bool Intersect (Box< dim, T > b, int div, T *dists, T &minsqdistance)
 This function check if a box intersect this shape.
 
 AdaptiveCylinderCone (const T *pt)
 Create an adaptive cylinder Cone for the point pt.
 
template<typename Distance >
bool isInside (Point< dim, T > pnt)
 Is a point inside the adaptive cone.
 
template<typename Distance >
bool isInside (float *pnt)
 Is a point inside the adaptive cone.
 

Data Fields

type data
 

Static Public Attributes

static const unsigned int p1 = 0
 Point where cone and cylinder base match.
 

Private Types

typedef Point< dim, T > PointA
 Base structure that define a Point.
 

Member Typedef Documentation

◆ PointA

template<unsigned int dim, typename T >
typedef Point<dim,T> AdaptiveCylinderCone< dim, T >::PointA
private

Base structure that define a Point.

Definition at line 74 of file AdaptiveCylinderCone.hpp.

◆ type

template<unsigned int dim, typename T >
typedef boost::fusion::vector<T[dim]> AdaptiveCylinderCone< dim, T >::type

boost fusion that store the point

Definition at line 79 of file AdaptiveCylinderCone.hpp.

Constructor & Destructor Documentation

◆ AdaptiveCylinderCone()

template<unsigned int dim, typename T >
AdaptiveCylinderCone< dim, T >::AdaptiveCylinderCone ( const T *  pt)
inline

Create an adaptive cylinder Cone for the point pt.

Parameters
ptarray storing the multidimensional point

Definition at line 164 of file AdaptiveCylinderCone.hpp.

Member Function Documentation

◆ Intersect() [1/2]

template<unsigned int dim, typename T >
template<typename distance >
bool AdaptiveCylinderCone< dim, T >::Intersect ( Box< dim, T >  b)
inline

This function check if a box intersect this shape.

Parameters
bis the box to check
Returns
true if the box intersect the cylinder cone shape

Definition at line 94 of file AdaptiveCylinderCone.hpp.

◆ Intersect() [2/2]

template<unsigned int dim, typename T >
template<typename distance >
bool AdaptiveCylinderCone< dim, T >::Intersect ( Box< dim, T >  b,
int  div,
T *  dists,
T &  minsqdistance 
)
inline

This function check if a box intersect this shape.

It differer from the previous one because it try to optimize the intersection calculation from the previous box intersection, usefull in KDTree, where the child are divisions of the root

Template Parameters
distancefunctor to calculate the distance between two points
Parameters
bthe bounding Box
[in]divwhere we are cutting from the previous box
[in]distsarray of the previous distances calculated on each dimension
[in]minsqdistanceminimum square distance
Returns
true if the Box intersect the adaptive cylinder cone

Definition at line 150 of file AdaptiveCylinderCone.hpp.

◆ isInside() [1/2]

template<unsigned int dim, typename T >
template<typename Distance >
bool AdaptiveCylinderCone< dim, T >::isInside ( float *  pnt)
inline

Is a point inside the adaptive cone.

Parameters
pntPoint to check
Returns
true if the point is inside false otherwise

Definition at line 205 of file AdaptiveCylinderCone.hpp.

◆ isInside() [2/2]

template<unsigned int dim, typename T >
template<typename Distance >
bool AdaptiveCylinderCone< dim, T >::isInside ( Point< dim, T >  pnt)
inline

Is a point inside the adaptive cone.

Parameters
pntPoint to check
Returns
true if the point is inside, false otherwise

Definition at line 183 of file AdaptiveCylinderCone.hpp.

Field Documentation

◆ data

template<unsigned int dim, typename T >
type AdaptiveCylinderCone< dim, T >::data

Center point of the cylynder cone (Where the cylinder finish), where the cone start

Definition at line 83 of file AdaptiveCylinderCone.hpp.

◆ p1

template<unsigned int dim, typename T >
const unsigned int AdaptiveCylinderCone< dim, T >::p1 = 0
static

Point where cone and cylinder base match.

Definition at line 86 of file AdaptiveCylinderCone.hpp.


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