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

Test structure used for several test. More...

Detailed Description

template<typename T>
class Point_test< T >

Test structure used for several test.

It is a test structure used for several test it contain 4 scalar "x,y,z,s" one vector property v[3] and one tensor or rank 2 t[3][3]

It is the format for type parsing of in the openfpm structures see openFPM_data wiki for more information

Declaration of a point

Test structure used for several test.

Create a type definition

Access the members

p.get<P::v>()[0] = 1.0 + i;
p.get<P::v>()[1] = 2.0 + i;
p.get<P::v>()[2] = 7.0 + i;
p.get<P::t>()[0][0] = 10.0 + i;
p.get<P::t>()[0][1] = 13.0 + i;
p.get<P::t>()[0][2] = 8.0 + i;
p.get<P::t>()[1][0] = 19.0 + i;
p.get<P::t>()[1][1] = 23.0 + i;
p.get<P::t>()[1][2] = 5.0 + i;
p.get<P::t>()[2][0] = 4.0 + i;
p.get<P::t>()[2][1] = 3.0 + i;
p.get<P::t>()[2][2] = 11.0 + i;
auto get() -> decltype(boost::fusion::at_c< i >(data))
getter method for a general property i
static const unsigned int v
v property is at position 4 in the boost::fusion::vector
static const unsigned int t
t property is at position 5 in the boost::fusion::vector

Definition at line 105 of file Point_test.hpp.

#include <Point_test.hpp>

Public Types

typedef boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type
 declaration of what the Point_test store
 
typedef boost::fusion::vector< T, T, T, T, T[3], T[3][3]> type_real
 declaration of what the Point_test store
 

Public Member Functions

void setx (T x_)
 set the x property
 
void sety (T y_)
 set the y property
 
void setz (T z_)
 set the z property
 
void sets (T s_)
 set the s property
 
void setv (size_t i, T v_)
 set the v property
 
void sett (size_t i, size_t j, T t_)
 set the t property
 
template<unsigned int i>
auto get () -> decltype(boost::fusion::at_c< i >(data))
 getter method for a general property i
 
template<unsigned int i>
auto get () const -> decltype(boost::fusion::at_c< i >(data))
 getter method for a general property i
 
 Point_test ()
 Default constructor.
 
bool operator== (const Point_test< float > &p) const
 check if two point match
 
Point_test< float > & operator+= (const Point_test< float > &p)
 Sum the point.
 
template<unsigned int dim, typename Mem >
 Point_test (const encapc< dim, Point_test< T >, Mem > &p)
 Copy constructor from encapc (encapsulated point)
 
 Point_test (const Point_test< T > &p)
 constructor from another point
 
__device__ __host__ Point_test< T > & operator= (const Point_test< T > &p)
 Copy the point.
 
void fill ()
 fill
 

Static Public Member Functions

static bool noPointers ()
 noPointers function
 

Data Fields

type data
 The object itself.
 

Static Public Attributes

static constexpr bool stag_mask [] ={false,false,false,true,true,true}
 in case usage with a staggered grid indicate which properties are staggered in the cell
 
static const unsigned int x = 0
 x property is at position 0 in the boost::fusion::vector
 
static const unsigned int y = 1
 y property is at position 1 in the boost::fusion::vector
 
static const unsigned int z = 2
 z property is at position 2 in the boost::fusion::vector
 
static const unsigned int s = 3
 s property is at position 3 in the boost::fusion::vector
 
static const unsigned int v = 4
 v property is at position 4 in the boost::fusion::vector
 
static const unsigned int t = 5
 t property is at position 5 in the boost::fusion::vector
 
static const unsigned int max_prop = 6
 number of properties in the boost::fusion::vector
 
static const unsigned int max_prop_real = 6
 number of properties in the boost::fusion::vector
 

Member Typedef Documentation

◆ type

template<typename T >
typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]> Point_test< T >::type

declaration of what the Point_test store

Definition at line 120 of file Point_test.hpp.

◆ type_real

template<typename T >
typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]> Point_test< T >::type_real

declaration of what the Point_test store

Definition at line 123 of file Point_test.hpp.

Constructor & Destructor Documentation

◆ Point_test() [1/3]

template<typename T >
Point_test< T >::Point_test ( )
inline

Default constructor.

Definition at line 228 of file Point_test.hpp.

◆ Point_test() [2/3]

template<typename T >
template<unsigned int dim, typename Mem >
Point_test< T >::Point_test ( const encapc< dim, Point_test< T >, Mem > &  p)
inline

Copy constructor from encapc (encapsulated point)

Parameters
pecapsulated point

Definition at line 288 of file Point_test.hpp.

◆ Point_test() [3/3]

template<typename T >
Point_test< T >::Point_test ( const Point_test< T > &  p)
inline

constructor from another point

Parameters
ppoint to copy

Definition at line 312 of file Point_test.hpp.

Member Function Documentation

◆ fill()

template<typename T >
void Point_test< T >::fill ( )
inline

fill

Fill the point with data

Definition at line 373 of file Point_test.hpp.

◆ get() [1/2]

template<typename T >
template<unsigned int i>
auto Point_test< T >::get ( ) -> decltype(boost::fusion::at_c<i>(data))
inline

getter method for a general property i

Definition at line 219 of file Point_test.hpp.

◆ get() [2/2]

template<typename T >
template<unsigned int i>
auto Point_test< T >::get ( ) const -> decltype(boost::fusion::at_c<i>(data))
inline

getter method for a general property i

Definition at line 224 of file Point_test.hpp.

◆ noPointers()

template<typename T >
static bool Point_test< T >::noPointers ( )
inlinestatic

noPointers function

It notify that Point_test does not have any pointer and is safe to send

Returns
true

Definition at line 366 of file Point_test.hpp.

◆ operator+=()

template<typename T >
Point_test< float > & Point_test< T >::operator+= ( const Point_test< float > &  p)
inline

Sum the point.

Parameters
ppoint to sum
Returns
this

Definition at line 264 of file Point_test.hpp.

◆ operator=()

template<typename T >
__device__ __host__ Point_test< T > & Point_test< T >::operator= ( const Point_test< T > &  p)
inline

Copy the point.

Parameters
ppoint
Returns
this

Definition at line 338 of file Point_test.hpp.

◆ operator==()

template<typename T >
bool Point_test< T >::operator== ( const Point_test< float > &  p) const
inline

check if two point match

Parameters
ppoint to compare

Definition at line 236 of file Point_test.hpp.

◆ sets()

template<typename T >
void Point_test< T >::sets ( s_)
inline

set the s property

Parameters
s_

Definition at line 197 of file Point_test.hpp.

◆ sett()

template<typename T >
void Point_test< T >::sett ( size_t  i,
size_t  j,
t_ 
)
inline

set the t property

Parameters
icomponent to set
jcomponent to set
t_value

Definition at line 214 of file Point_test.hpp.

◆ setv()

template<typename T >
void Point_test< T >::setv ( size_t  i,
v_ 
)
inline

set the v property

Parameters
icomponent to set
v_value

Definition at line 205 of file Point_test.hpp.

◆ setx()

template<typename T >
void Point_test< T >::setx ( x_)
inline

set the x property

Parameters
x_

Definition at line 176 of file Point_test.hpp.

◆ sety()

template<typename T >
void Point_test< T >::sety ( y_)
inline

set the y property

Parameters
y_

Definition at line 183 of file Point_test.hpp.

◆ setz()

template<typename T >
void Point_test< T >::setz ( z_)
inline

set the z property

Parameters
z_

Definition at line 190 of file Point_test.hpp.

Field Documentation

◆ data

template<typename T >
type Point_test< T >::data

The object itself.

Definition at line 131 of file Point_test.hpp.

◆ max_prop

template<typename T >
const unsigned int Point_test< T >::max_prop = 6
static

number of properties in the boost::fusion::vector

Definition at line 162 of file Point_test.hpp.

◆ max_prop_real

template<typename T >
const unsigned int Point_test< T >::max_prop_real = 6
static

number of properties in the boost::fusion::vector

Definition at line 165 of file Point_test.hpp.

◆ s

template<typename T >
const unsigned int Point_test< T >::s = 3
static

s property is at position 3 in the boost::fusion::vector

Definition at line 143 of file Point_test.hpp.

◆ stag_mask

template<typename T >
constexpr bool Point_test< T >::stag_mask[] ={false,false,false,true,true,true}
staticconstexpr

in case usage with a staggered grid indicate which properties are staggered in the cell

Definition at line 128 of file Point_test.hpp.

◆ t

template<typename T >
const unsigned int Point_test< T >::t = 5
static

t property is at position 5 in the boost::fusion::vector

Definition at line 149 of file Point_test.hpp.

◆ v

template<typename T >
const unsigned int Point_test< T >::v = 4
static

v property is at position 4 in the boost::fusion::vector

Definition at line 146 of file Point_test.hpp.

◆ x

template<typename T >
const unsigned int Point_test< T >::x = 0
static

x property is at position 0 in the boost::fusion::vector

Definition at line 134 of file Point_test.hpp.

◆ y

template<typename T >
const unsigned int Point_test< T >::y = 1
static

y property is at position 1 in the boost::fusion::vector

Definition at line 137 of file Point_test.hpp.

◆ z

template<typename T >
const unsigned int Point_test< T >::z = 2
static

z property is at position 2 in the boost::fusion::vector

Definition at line 140 of file Point_test.hpp.


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