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

This class implement the Sphere concept in an N-dimensional space. More...

Detailed Description

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

This class implement the Sphere concept in an N-dimensional space.

This class implement the sphere shape in an N-dimensional space

Template Parameters
Ttype of the space
dimdimensionality

Definition at line 23 of file Sphere.hpp.

#include <Sphere.hpp>

Public Types

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

Public Member Functions

__device__ __host__ T center (unsigned int i)
 Get the component i of the center.
 
__device__ __host__ Sphere (const Sphere< dim, T > &sph)
 Sphere constructor.
 
template<unsigned int k>
 Sphere (boost::fusion::vector< T[k]> &c, T radius)
 Sphere constructor.
 
 Sphere (Point< dim, double > &c, T radius)
 Sphere constructor.
 
__device__ __host__ T radius () const
 Get the radius of the sphere.
 
__device__ __host__ bool isInside (Point< dim, T > p) const
 Check if a point is inside.
 
template<typename Distance >
__device__ __host__ bool isInside (Point< dim, T > p) const
 Check if a point is inside.
 
template<typename Distance >
bool __device__ __host__ isInside (float *pnt) const
 Is the point inside the sphere.
 
__device__ __host__ T distance (Point< dim, T > &p) const
 Return the distance from the surface.
 

Data Fields

type data
 Structure that store the data.
 

Static Public Attributes

static const unsigned int x = 0
 property id of the center position of the sphere
 
static const unsigned int r = 1
 property id of the radius of the sphere
 

Member Typedef Documentation

◆ type

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

boost fusion that store the point

Definition at line 28 of file Sphere.hpp.

Constructor & Destructor Documentation

◆ Sphere() [1/3]

template<unsigned int dim, typename T >
__device__ __host__ Sphere< dim, T >::Sphere ( const Sphere< dim, T > &  sph)
inline

Sphere constructor.

Sphere constructor

Template Parameters
kdimensionality of the center point (and the sphere)
Parameters
ccenter point
radius

Definition at line 58 of file Sphere.hpp.

◆ Sphere() [2/3]

template<unsigned int dim, typename T >
template<unsigned int k>
Sphere< dim, T >::Sphere ( boost::fusion::vector< T[k]> &  c,
radius 
)
inline

Sphere constructor.

Sphere constructor

Template Parameters
kdimensionality of the center point (and the sphere)
Parameters
ccenter point
radius

Definition at line 79 of file Sphere.hpp.

◆ Sphere() [3/3]

template<unsigned int dim, typename T >
Sphere< dim, T >::Sphere ( Point< dim, double > &  c,
radius 
)
inline

Sphere constructor.

Sphere constructor

Template Parameters
kdimensionality of the center point (and the sphere)
Parameters
ccenter point
radius

Definition at line 99 of file Sphere.hpp.

Member Function Documentation

◆ center()

template<unsigned int dim, typename T >
__device__ __host__ T Sphere< dim, T >::center ( unsigned int  i)
inline

Get the component i of the center.

Parameters
icoordinate
Returns
the coordinate i of the center

Definition at line 44 of file Sphere.hpp.

◆ distance()

template<unsigned int dim, typename T >
__device__ __host__ T Sphere< dim, T >::distance ( Point< dim, T > &  p) const
inline

Return the distance from the surface.

Parameters
ppoint
Returns
the distance from the surface. The sign indicate if is outside or inside the shape

Definition at line 216 of file Sphere.hpp.

◆ isInside() [1/3]

template<unsigned int dim, typename T >
template<typename Distance >
bool __device__ __host__ Sphere< dim, T >::isInside ( float *  pnt) const
inline

Is the point inside the sphere.

Parameters
pntcheck if the point is inside
Returns
true if it is inside

Definition at line 188 of file Sphere.hpp.

◆ isInside() [2/3]

template<unsigned int dim, typename T >
__device__ __host__ bool Sphere< dim, T >::isInside ( Point< dim, T >  p) const
inline

Check if a point is inside.

Template Parameters
distancedistance functor used to calculate the distance two points
Parameters
pPoint to check if it is inside
Returns
true if the point is inside

Definition at line 128 of file Sphere.hpp.

◆ isInside() [3/3]

template<unsigned int dim, typename T >
template<typename Distance >
__device__ __host__ bool Sphere< dim, T >::isInside ( Point< dim, T >  p) const
inline

Check if a point is inside.

Template Parameters
distancedistance functor used to calculate the distance two points
Parameters
pPoint to check if it is inside
Returns
true if the point is inside

Definition at line 157 of file Sphere.hpp.

◆ radius()

template<unsigned int dim, typename T >
__device__ __host__ T Sphere< dim, T >::radius ( ) const
inline

Get the radius of the sphere.

Returns
the radius of the sphere

Definition at line 115 of file Sphere.hpp.

Field Documentation

◆ data

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

Structure that store the data.

Definition at line 31 of file Sphere.hpp.

◆ r

template<unsigned int dim, typename T >
const unsigned int Sphere< dim, T >::r = 1
static

property id of the radius of the sphere

Definition at line 36 of file Sphere.hpp.

◆ x

template<unsigned int dim, typename T >
const unsigned int Sphere< dim, T >::x = 0
static

property id of the center position of the sphere

Definition at line 34 of file Sphere.hpp.


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