PanPhaseField SDK
VectorMesh< T > Class Template Reference

A vector-like data structure template which handles mesh grid of phase-field model, such as composition mesh, order parameter mesh and chemical potential mesh. There is a rich variety of built-in operations for vectorizing loop-based source code. More...

#include <tensors.h>

Public Member Functions

 VectorMesh ()
 
 VectorMesh (const VectorMesh &obj)
 
 VectorMesh (type_int dimx, type_int dimy, type_int dimz, type_int dimc)
 
 VectorMesh (T *list, vector< type_int >dims)
 
 ~VectorMesh ()
 
bool empty ()
 
vector< type_intsize ()
 
VectorMesh sub_comp (unsigned int c)
 
T & operator() (unsigned int x, unsigned int y, unsigned int z, unsigned int c)
 
const VectorMesh operator* (const T s)
 
VectorMeshoperator*= (const T s)
 
VectorMeshoperator= (const T val)
 
VectorMeshoperator= (const VectorMesh &rhs)
 
const VectorMesh operator+ (const VectorMesh &rhs)
 
const VectorMesh operator- (const VectorMesh &rhs)
 
VectorMeshoperator+= (const VectorMesh &rhs)
 
VectorMeshoperator-= (const VectorMesh &rhs)
 
void reset ()
 
void clear ()
 
mean ()
 
maximum ()
 
vector< T > get_local_vector (int px, int py, int pz)
 Get the local vector of the spatial location (px,py,pz) More...
 
minimum ()
 
std ()
 

Detailed Description

template<typename T>
class VectorMesh< T >

A vector-like data structure template which handles mesh grid of phase-field model, such as composition mesh, order parameter mesh and chemical potential mesh. There is a rich variety of built-in operations for vectorizing loop-based source code.

Constructor & Destructor Documentation

◆ VectorMesh() [1/4]

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

Default constructor

◆ VectorMesh() [2/4]

template<typename T >
VectorMesh< T >::VectorMesh ( const VectorMesh< T > &  obj)
inline

Copy constructor

Parameters
[in]objthe object to be copied

◆ VectorMesh() [3/4]

template<typename T >
VectorMesh< T >::VectorMesh ( type_int  dimx,
type_int  dimy,
type_int  dimz,
type_int  dimc 
)
inline

A Constructor using dimensions of mesh

Parameters
[in]dimxthe dimension along x-axis
[in]dimythe dimension along y-axis
[in]dimzthe dimension along z-axis
[in]dimcthe dimension of vector at a mesh point

◆ VectorMesh() [4/4]

template<typename T >
VectorMesh< T >::VectorMesh ( T *  list,
vector< type_int dims 
)
inline

A copy constructor using an array of dimensions

Parameters
[in]listthe serialized list to be extracted and copied
[in]dimsthe dimension of the 3D mesh [x,y,z, and vector length]

◆ ~VectorMesh()

template<typename T >
VectorMesh< T >::~VectorMesh ( )
inline

Deconstructor

Member Function Documentation

◆ empty()

template<typename T >
bool VectorMesh< T >::empty ( )
inline

Is the mesh empty

Returns
True if the mesh is empty

◆ size()

template<typename T >
vector< type_int > VectorMesh< T >::size ( )
inline

Get the size of the mesh

Returns
the size of mesh

◆ sub_comp()

template<typename T >
VectorMesh VectorMesh< T >::sub_comp ( unsigned int  c)
inline

Get a mesh of scaler which is the c-th dimension of vector

Parameters
[in]ca dimension index of vector
Returns
a 3D mesh with only one dimension of vector

◆ operator()()

template<typename T >
T & VectorMesh< T >::operator() ( unsigned int  x,
unsigned int  y,
unsigned int  z,
unsigned int  c 
)
inline

Get value by index

Parameters
[in]xthe 1st index of 3D mesh
[in]ythe 2nd index of 3D mesh
[in]zthe 3rd index of 3D mesh
[in]cthe dimension index of vector
Returns
the value by index

◆ operator*()

template<typename T >
const VectorMesh VectorMesh< T >::operator* ( const T  s)
inline

Multiply operator. Scale values in mesh by a constant

◆ operator*=()

template<typename T >
VectorMesh & VectorMesh< T >::operator*= ( const T  s)
inline

Multiply AND assignment operator. Scale values in mesh by a constant

◆ operator=() [1/2]

template<typename T >
VectorMesh & VectorMesh< T >::operator= ( const T  val)
inline

Assignment operator. Assign values in mesh by a constant

◆ operator=() [2/2]

template<typename T >
VectorMesh & VectorMesh< T >::operator= ( const VectorMesh< T > &  rhs)
inline

Assignment operator by another mesh

◆ operator+()

template<typename T >
const VectorMesh VectorMesh< T >::operator+ ( const VectorMesh< T > &  rhs)
inline

Additive operator

◆ operator-()

template<typename T >
const VectorMesh VectorMesh< T >::operator- ( const VectorMesh< T > &  rhs)
inline

Substractive operator

◆ operator+=()

template<typename T >
VectorMesh & VectorMesh< T >::operator+= ( const VectorMesh< T > &  rhs)
inline

Additive AND assignment operator

◆ operator-=()

template<typename T >
VectorMesh & VectorMesh< T >::operator-= ( const VectorMesh< T > &  rhs)
inline

Substractive AND assignment operator

◆ reset()

template<typename T >
void VectorMesh< T >::reset ( )
inline

Reset mesh to zero

Returns
void

◆ clear()

template<typename T >
void VectorMesh< T >::clear ( )
inline

Release the memory of mesh

Returns
void

◆ mean()

template<typename T >
T VectorMesh< T >::mean ( )
inline

Get mean value of the mesh

Returns
mean value of mesh

◆ maximum()

template<typename T >
T VectorMesh< T >::maximum ( )
inline

Get max value of the mesh

Returns
max value of mesh

◆ get_local_vector()

template<typename T >
vector< T > VectorMesh< T >::get_local_vector ( int  px,
int  py,
int  pz 
)
inline

Get the local vector of the spatial location (px,py,pz)

Parameters
[in]px
[in]py
[in]pz
Returns
vector<T>

◆ minimum()

template<typename T >
T VectorMesh< T >::minimum ( )
inline

Get min value of the mesh

Returns
min value of mesh

◆ std()

template<typename T >
T VectorMesh< T >::std ( )
inline

Get std of the mesh

Returns
standard deviation of mesh

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