# PhasicFlow: triple< T > Struct Template Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

triple< T > Struct Template Reference

A set of 3 variables that can be used for vector variables. More...

Inheritance diagram for triple< T >:
[legend]

## Public Member Functions

| TripleTypeInfoNV (T)
| Type info for triple. More...
INLINE_FUNCTION_HD | triple ()=default
| Initilize to zero. More...
INLINE_FUNCTION_HD | ~triple ()=default
INLINE_FUNCTION_HD | triple (const T &x, const T &y, const T &z)
| Construct from x, y, z. More...
INLINE_FUNCTION_HD | triple (const T &v)
| Construct from v. More...
template<typename T2 >
INLINE_FUNCTION_HD triple< T > & | operator= (const triple< T2 > &rhs)
| Type conversion trough assignment. More...
template<typename T2 >
INLINE_FUNCTION_HD | triple (const triple< T2 > &src)
| Type casting through copy constructor. More...
INLINE_FUNCTION_HD | triple (const triple< T > &src)=default
| Copy construct. More...
INLINE_FUNCTION_HD | triple (triple< T > &&src)=default
| Move construct. More...
INLINE_FUNCTION_HD triple< T > & | operator= (const triple< T > &src)=default
| copy assignment More...
INLINE_FUNCTION_HD triple< T > & | operator= (triple< T > &&src)=default
| move assignment More...
INLINE_FUNCTION uniquePtr< triple< T > > | clone () const
| clone More...
INLINE_FUNCTION triple< T > * | clonePtr () const
INLINE_FUNCTION_HD T & | x ()
| access component More...
const INLINE_FUNCTION_HD T & | x () const
| access component More...
INLINE_FUNCTION_HD T & | y ()
| access component More...
const INLINE_FUNCTION_HD T & | y () const
| access component More...
INLINE_FUNCTION_HD T & | z ()
| access component More...
const INLINE_FUNCTION_HD T & | z () const
| access component More...
INLINE_FUNCTION_HD T & | comp1 ()
| access component More...
const INLINE_FUNCTION_HD T & | comp1 () const
| access component More...
INLINE_FUNCTION_HD T & | comp2 ()
| access component More...
const INLINE_FUNCTION_HD T & | comp2 () const
| access component More...
INLINE_FUNCTION_HD T & | comp3 ()
| access component More...
const INLINE_FUNCTION_HD T & | comp3 () const
| access component More...
INLINE_FUNCTION_HD T | length () const
| Length of the vector. More...
INLINE_FUNCTION_HD void | normalize ()
| Normalize the vector. More...
INLINE_FUNCTION_HD void | operator+= (const triple &oprnd2)
INLINE_FUNCTION_HD void | operator-= (const triple &oprnd2)
INLINE_FUNCTION_HD void | operator*= (const triple &oprnd2)
INLINE_FUNCTION_HD void | operator/= (const triple &oprnd2)
INLINE_FUNCTION_HD triple | operator- () const
| unary negate operator More...
INLINE_FUNCTION_HD triple | operator+ () const
| unary plus operator More...

## Public Attributes

T | x_
| data members More...
T | y_
T | z_

## Friends

FUNCTION_HD T | dot (const triple< T > &oprnd1, const triple< T > &oprnd2)
| Dot product of two vectors. More...
FUNCTION_HD triple< T > | cross (const triple< T > &v1, const triple< T > &v2)
| Cross product of two vectors. More...
FUNCTION_HD triple< T > | operator+ (const triple< T > &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator+ (const triple< T > &oprnd1, const T &oprnd2)
FUNCTION_HD triple< T > | operator+ (const T &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator- (const triple< T > &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator- (const triple< T > &oprnd1, const T &oprnd2)
FUNCTION_HD triple< T > | operator- (const T &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator* (const triple< T > &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator* (const triple< T > &oprnd1, const T &oprnd2)
FUNCTION_HD triple< T > | operator* (const T &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD triple< T > | operator/ (const triple< T > &oprnd1, const triple< T > &oprnd2)
| / operators More...
FUNCTION_HD triple< T > | operator/ (const triple< T > &oprnd1, const T &oprnd2)
FUNCTION_HD triple< T > | operator/ (const T &oprnd1, const triple< T > &oprnd2)
FUNCTION_HD bool | operator== (const triple< T > &opr1, const triple< T > &opr2)
FUNCTION_HD bool | operator (const triple< T > &opr1, const triple< T > &opr2)
FUNCTION_HD bool | operator> (const triple< T > &opr1, const triple< T > &opr2)
FUNCTION_HD bool | operator>= (const triple< T > &opr1, const triple< T > &opr2)
FUNCTION_HD bool | operator (const triple< T > &opr1, const triple< T > &opr2)
iOstream & | operator (iOstream &str, const triple< T > &ov)
| << operator More...
iIstream & | operator>> (iIstream &str, triple< T > &iv)

> > operator

More...

void | readIstream (iIstream &str, triple< T > &iv)
| same as >> operator, but faster, good for mass read More...

## Detailed Description

### template<typename T>
struct pFlow::triple< T >

A set of 3 variables that can be used for vector variables.

- Forward

The template parameter should be numeric type only.

Definition at line 36 of file triple.hpp.

## Constructor & Destructor Documentation

## triple() [1/6]

INLINE_FUNCTION_HD triple | ( |  | ) |

default

Initilize to zero.

## ~triple()

INLINE_FUNCTION_HD ~triple | ( |  | ) |

default

## triple() [2/6]

INLINE_FUNCTION_HD triple | ( | const T & | x,
|  | const T & | y,
|  | const T & | z
| ) |  |

inline

Construct from x, y, z.

Definition at line 67 of file triple.hpp.

## triple() [3/6]

INLINE_FUNCTION_HD triple | ( | const T & | v | ) |

inline

Construct from v.

Definition at line 76 of file triple.hpp.

## triple() [4/6]

INLINE_FUNCTION_HD triple | ( | const triple< T2 > & | src | ) |

inline

Type casting through copy constructor.

Definition at line 93 of file triple.hpp.

## triple() [5/6]

INLINE_FUNCTION_HD triple | ( | const triple< T > & | src | ) |

default

Copy construct.

## triple() [6/6]

INLINE_FUNCTION_HD triple | ( | triple< T > && | src | ) |

default

Move construct.

## Member Function Documentation

## TripleTypeInfoNV()

TripleTypeInfoNV | ( | T |  | ) |

Type info for triple.

## operator=() [1/3]

INLINE_FUNCTION_HD triple<T>& operator= | ( | const triple< T2 > & | rhs | ) |

inline

Type conversion trough assignment.

Definition at line 83 of file triple.hpp.

## operator=() [2/3]

INLINE_FUNCTION_HD triple<T>& operator= | ( | const triple< T > & | src | ) |

default

copy assignment

## operator=() [3/3]

INLINE_FUNCTION_HD triple<T>& operator= | ( | triple< T > && | src | ) |

default

move assignment

## clone()

INLINE_FUNCTION uniquePtr<triple<T> > clone | ( |  | ) | const

inline

clone

Definition at line 118 of file triple.hpp.

## clonePtr()

INLINE_FUNCTION triple<T>* clonePtr | ( |  | ) | const

inline

Definition at line 124 of file triple.hpp.

## x() [1/2]

INLINE_FUNCTION_HD T& x | ( |  | ) |

inline

access component

Definition at line 132 of file triple.hpp.

Referenced by pFlow::PFtoVTK::addRealx3PointField(), pFlow::PFtoVTK::addUndstrcuturedGridField(), cells::bound(), pFlow::boxExtent(), cellMapper::build(), pFlow::equal(), cellsWallLevel0::findPairsElementRangeCount(), cells::inCellRange(), pFlow::indexToCell(), rectangleMesh::nx(), cells::nx(), cuboidWall::readcuboidWall(), stlFile::readFacet(), pFlow::rotate(), cells::totalCells(), zAxis::transferBackZ(), pFlow::TSFtoVTK::triSurfaceToVTK(), and stlFile::writeFacet().

Here is the caller graph for this function:

## x() [2/2]

const INLINE_FUNCTION_HD T& x | ( |  | ) | const

inline

access component

Definition at line 138 of file triple.hpp.

## y() [1/2]

INLINE_FUNCTION_HD T& y | ( |  | ) |

inline

access component

Definition at line 144 of file triple.hpp.

Referenced by pFlow::PFtoVTK::addRealx3PointField(), pFlow::PFtoVTK::addUndstrcuturedGridField(), cells::bound(), pFlow::boxExtent(), cellMapper::build(), pFlow::equal(), cellsWallLevel0::findPairsElementRangeCount(), cells::inCellRange(), pFlow::indexToCell(), rectangleMesh::ny(), cells::ny(), cuboidWall::readcuboidWall(), stlFile::readFacet(), pFlow::rotate(), cells::totalCells(), zAxis::transferBackZ(), pFlow::TSFtoVTK::triSurfaceToVTK(), and stlFile::writeFacet().

Here is the caller graph for this function:

## y() [2/2]

const INLINE_FUNCTION_HD T& y | ( |  | ) | const

inline

access component

Definition at line 150 of file triple.hpp.

## z() [1/2]

INLINE_FUNCTION_HD T& z | ( |  | ) |

inline

access component

Definition at line 156 of file triple.hpp.

Referenced by pFlow::PFtoVTK::addRealx3PointField(), pFlow::PFtoVTK::addUndstrcuturedGridField(), cells::bound(), pFlow::boxExtent(), cellMapper::build(), pFlow::equal(), cellsWallLevel0::findPairsElementRangeCount(), cells::inCellRange(), pFlow::indexToCell(), rectangleMesh::nz(), cells::nz(), cuboidWall::readcuboidWall(), stlFile::readFacet(), pFlow::rotate(), cells::totalCells(), zAxis::transferBackZ(), pFlow::TSFtoVTK::triSurfaceToVTK(), and stlFile::writeFacet().

Here is the caller graph for this function:

## z() [2/2]

const INLINE_FUNCTION_HD T& z | ( |  | ) | const

inline

access component

Definition at line 162 of file triple.hpp.

## comp1() [1/2]

INLINE_FUNCTION_HD T& comp1 | ( |  | ) |

inline

access component

Definition at line 168 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

Here is the caller graph for this function:

## comp1() [2/2]

const INLINE_FUNCTION_HD T& comp1 | ( |  | ) | const

inline

access component

Definition at line 174 of file triple.hpp.

## comp2() [1/2]

INLINE_FUNCTION_HD T& comp2 | ( |  | ) |

inline

access component

Definition at line 180 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

Here is the caller graph for this function:

## comp2() [2/2]

const INLINE_FUNCTION_HD T& comp2 | ( |  | ) | const

inline

access component

Definition at line 186 of file triple.hpp.

## comp3() [1/2]

INLINE_FUNCTION_HD T& comp3 | ( |  | ) |

inline

access component

Definition at line 192 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

Here is the caller graph for this function:

## comp3() [2/2]

const INLINE_FUNCTION_HD T& comp3 | ( |  | ) | const

inline

access component

Definition at line 198 of file triple.hpp.

## length()

INLINE_FUNCTION_HD T length

Length of the vector.

Definition at line 56 of file tripleI.hpp.

Referenced by Wall::checkTrianlge().

Here is the caller graph for this function:

## normalize()

INLINE_FUNCTION_HD void normalize

Normalize the vector.

Definition at line 63 of file tripleI.hpp.

## operator+=()

INLINE_FUNCTION_HD void operator+= | ( | const triple< T > & | oprnd2 | ) |

Definition at line 178 of file tripleI.hpp.

## operator-=()

INLINE_FUNCTION_HD void operator-= | ( | const triple< T > & | oprnd2 | ) |

Definition at line 187 of file tripleI.hpp.

## operator*=()

INLINE_FUNCTION_HD void operator*= | ( | const triple< T > & | oprnd2 | ) |

Definition at line 196 of file tripleI.hpp.

## operator/=()

INLINE_FUNCTION_HD void operator/= | ( | const triple< T > & | oprnd2 | ) |

Definition at line 205 of file tripleI.hpp.

## operator-()

INLINE_FUNCTION_HD pFlow::triple< T > operator-

unary negate operator

Definition at line 214 of file tripleI.hpp.

## operator+()

INLINE_FUNCTION_HD pFlow::triple< T > operator+

unary plus operator

Definition at line 221 of file tripleI.hpp.

## Friends And Related Function Documentation

## dot

FUNCTION_HD T dot | ( | const triple< T > & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

Dot product of two vectors.

## cross

FUNCTION_HD triple<T> cross | ( | const triple< T > & | v1,
|  | const triple< T > & | v2
| ) |  |

friend

Cross product of two vectors.

## operator+ [1/3]

FUNCTION_HD triple<T> operator+ | ( | const triple< T > & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

- operator

## operator+ [2/3]

FUNCTION_HD triple<T> operator+ | ( | const triple< T > & | oprnd1,
|  | const T & | oprnd2
| ) |  |

friend

## operator+ [3/3]

FUNCTION_HD triple<T> operator+ | ( | const T & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

## operator- [1/3]

FUNCTION_HD triple<T> operator- | ( | const triple< T > & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

- operator

## operator- [2/3]

FUNCTION_HD triple<T> operator- | ( | const triple< T > & | oprnd1,
|  | const T & | oprnd2
| ) |  |

friend

## operator- [3/3]

FUNCTION_HD triple<T> operator- | ( | const T & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

## operator* [1/3]

FUNCTION_HD triple<T> operator* | ( | const triple< T > & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

- operators

## operator* [2/3]

FUNCTION_HD triple<T> operator* | ( | const triple< T > & | oprnd1,
|  | const T & | oprnd2
| ) |  |

friend

## operator* [3/3]

FUNCTION_HD triple<T> operator* | ( | const T & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

## operator/ [1/3]

FUNCTION_HD triple<T> operator/ | ( | const triple< T > & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

/ operators

## operator/ [2/3]

FUNCTION_HD triple<T> operator/ | ( | const triple< T > & | oprnd1,
|  | const T & | oprnd2
| ) |  |

friend

## operator/ [3/3]

FUNCTION_HD triple<T> operator/ | ( | const T & | oprnd1,
|  | const triple< T > & | oprnd2
| ) |  |

friend

## operator==

FUNCTION_HD bool operator== | ( | const triple< T > & | opr1,
|  | const triple< T > & | opr2
| ) |  |

friend

## operator [1/3]

FUNCTION_HD bool operator | ( | const triple< T > & | opr1,
|  | const triple< T > & | opr2
| ) |  |

friend

## operator>

FUNCTION_HD bool operator> | ( | const triple< T > & | opr1,
|  | const triple< T > & | opr2
| ) |  |

friend

## operator>=

FUNCTION_HD bool operator>= | ( | const triple< T > & | opr1,
|  | const triple< T > & | opr2
| ) |  |

friend

## operator [2/3]

FUNCTION_HD bool operator | ( | const triple< T > & | opr1,
|  | const triple< T > & | opr2
| ) |  |

friend

## operator [3/3]

iOstream& operator | ( | iOstream & | str,
|  | const triple< T > & | ov
| ) |  |

friend

<< operator

## operator>>

iIstream& operator>> | ( | iIstream & | str,
|  | triple< T > & | iv
| ) |  |

friend

> > operator

## readIstream

void readIstream | ( | iIstream & | str,
|  | triple< T > & | iv
| ) |  |

friend

same as >> operator, but faster, good for mass read

## Member Data Documentation

## x_

T x_

data members

Definition at line 49 of file triple.hpp.

Referenced by rectangleMesh::cellVol(), triple< intType >::comp1(), pFlow::periodicBoundarySIKernels::grainGrainInteraction(), pFlow::grnTriInteraction::isGrainInContactBothSides(), pFlow::sphTriInteraction::isSphereInContactBothSides(), pFlow::max(), pFlow::min(), triWall::nearestPointOnWall(), ppInteractionFunctor< ContactForceModel, ContactListType >::operator()(), pwInteractionFunctor< ContactForceModel, ContactListType, TraingleAccessor, MotionModel >::operator()(), triple< intType >::operator*=(), triple< intType >::operator+=(), triple< intType >::operator-=(), triple< intType >::operator/=(), triple< intType >::operator=(), pFlow::pow(), pFlow::rotate(), rectangleMesh::size(), pFlow::periodicBoundarySIKernels::sphereSphereInteraction(), triWall::triWall(), and triple< intType >::x().

## y_

T y_

Definition at line 50 of file triple.hpp.

Referenced by rectangleMesh::cellVol(), triple< intType >::comp2(), pFlow::periodicBoundarySIKernels::grainGrainInteraction(), pFlow::grnTriInteraction::isGrainInContactBothSides(), pFlow::sphTriInteraction::isSphereInContactBothSides(), pFlow::max(), pFlow::min(), triWall::nearestPointOnWall(), ppInteractionFunctor< ContactForceModel, ContactListType >::operator()(), pwInteractionFunctor< ContactForceModel, ContactListType, TraingleAccessor, MotionModel >::operator()(), triple< intType >::operator*=(), triple< intType >::operator+=(), triple< intType >::operator-=(), triple< intType >::operator/=(), triple< intType >::operator=(), pFlow::pow(), pFlow::rotate(), rectangleMesh::size(), pFlow::periodicBoundarySIKernels::sphereSphereInteraction(), triWall::triWall(), and triple< intType >::y().

## z_

T z_

Definition at line 51 of file triple.hpp.

Referenced by rectangleMesh::cellVol(), triple< intType >::comp3(), pFlow::periodicBoundarySIKernels::grainGrainInteraction(), pFlow::grnTriInteraction::isGrainInContactBothSides(), pFlow::sphTriInteraction::isSphereInContactBothSides(), pFlow::max(), pFlow::min(), triWall::nearestPointOnWall(), ppInteractionFunctor< ContactForceModel, ContactListType >::operator()(), pwInteractionFunctor< ContactForceModel, ContactListType, TraingleAccessor, MotionModel >::operator()(), triple< intType >::operator*=(), triple< intType >::operator+=(), triple< intType >::operator-=(), triple< intType >::operator/=(), triple< intType >::operator=(), pFlow::pow(), pFlow::rotate(), rectangleMesh::size(), pFlow::periodicBoundarySIKernels::sphereSphereInteraction(), triWall::triWall(), and triple< intType >::z().

The documentation for this struct was generated from the following files:

- src/phasicFlow/types/triple/triple.hpp
- src/phasicFlow/types/triple/tripleI.hpp