Chi-Tech
chi_mesh::TensorRank2Dim3 Struct Reference

#include <chi_meshtensor_rank2_dim3.h>

Public Member Functions

 TensorRank2Dim3 ()
 
 TensorRank2Dim3 (const double value)
 
 TensorRank2Dim3 (const TensorRank2Dim3 &that)
 
TensorRank2Dim3operator= (const TensorRank2Dim3 &that)
 
chi_mesh::Vector3operator[] (int index)
 
TensorRank2Dim3 operator+ (const TensorRank2Dim3 &that) const
 
TensorRank2Dim3operator+= (const TensorRank2Dim3 &that)
 
TensorRank2Dim3 operator- (const TensorRank2Dim3 &that) const
 
TensorRank2Dim3operator-= (const TensorRank2Dim3 &that)
 
TensorRank2Dim3 operator* (const double value) const
 
TensorRank2Dim3operator*= (const double value)
 
TensorRank2Dim3 operator/ (const double value) const
 
TensorRank2Dim3operator/= (const double value)
 
TensorRank2Dim3 Transpose ()
 
Vector3 Dot (const chi_mesh::Vector3 &v) const
 
chi_mesh::Vector3 Diag () const
 
double DiagSum () const
 
std::string PrintS ()
 

Data Fields

std::vector< chi_mesh::Vector3t
 Tensor entries. More...
 

Detailed Description

General rank 2 tensor to be used with Vector3

Definition at line 8 of file chi_meshtensor_rank2_dim3.h.

Constructor & Destructor Documentation

◆ TensorRank2Dim3() [1/3]

chi_mesh::TensorRank2Dim3::TensorRank2Dim3 ( )
inline

Default constructor.

Definition at line 13 of file chi_meshtensor_rank2_dim3.h.

◆ TensorRank2Dim3() [2/3]

chi_mesh::TensorRank2Dim3::TensorRank2Dim3 ( const double  value)
inlineexplicit

Constructor with specified value. $ T_{ii} = \alpha $

Definition at line 19 of file chi_meshtensor_rank2_dim3.h.

◆ TensorRank2Dim3() [3/3]

chi_mesh::TensorRank2Dim3::TensorRank2Dim3 ( const TensorRank2Dim3 that)
inline

Copy constructor.

Definition at line 25 of file chi_meshtensor_rank2_dim3.h.

Member Function Documentation

◆ Diag()

chi_mesh::Vector3 chi_mesh::TensorRank2Dim3::Diag ( ) const

Returns the diagonal of a rank-2 dim-3 tensor as a vector3. $ \vec{w} = \text{diag} \vec{\vec{T}} $

Definition at line 56 of file chi_mesh_utilities.cc.

◆ DiagSum()

double chi_mesh::TensorRank2Dim3::DiagSum ( ) const
inline

Returns the sum of the diagonal. Sometimes useful to get divergence of a vector given its gradient.

Definition at line 163 of file chi_meshtensor_rank2_dim3.h.

◆ Dot()

chi_mesh::Vector3 chi_mesh::TensorRank2Dim3::Dot ( const chi_mesh::Vector3 v) const

Dot product of rank-2 tensor with a vector. $ \vec{w} = \vec{\vec{T}} \bullet \vec{x} $

Definition at line 44 of file chi_mesh_utilities.cc.

◆ operator*()

TensorRank2Dim3 chi_mesh::TensorRank2Dim3::operator* ( const double  value) const
inline

Component-wise multiplication by scalar. $ \vec{\vec{W}} = \vec{\vec{X}}\alpha $

Definition at line 95 of file chi_meshtensor_rank2_dim3.h.

◆ operator*=()

TensorRank2Dim3 & chi_mesh::TensorRank2Dim3::operator*= ( const double  value)
inline

In-place component-wise multiplication by scalar. $ \vec{\vec{X}} = \vec{\vec{X}}\alpha $

Definition at line 107 of file chi_meshtensor_rank2_dim3.h.

◆ operator+()

TensorRank2Dim3 chi_mesh::TensorRank2Dim3::operator+ ( const TensorRank2Dim3 that) const
inline

Component-wise addition. $ \vec{\vec{W}} = \vec{\vec{X}} + \vec{\vec{Y}} $

Definition at line 47 of file chi_meshtensor_rank2_dim3.h.

◆ operator+=()

TensorRank2Dim3 & chi_mesh::TensorRank2Dim3::operator+= ( const TensorRank2Dim3 that)
inline

In-place component-wise addition. $ \vec{\vec{X}} = \vec{\vec{X}} + \vec{\vec{Y}} $

Definition at line 59 of file chi_meshtensor_rank2_dim3.h.

◆ operator-()

TensorRank2Dim3 chi_mesh::TensorRank2Dim3::operator- ( const TensorRank2Dim3 that) const
inline

Component-wise subtraction. $ \vec{\vec{W}} = \vec{\vec{X}} - \vec{\vec{Y}} $

Definition at line 71 of file chi_meshtensor_rank2_dim3.h.

◆ operator-=()

TensorRank2Dim3 & chi_mesh::TensorRank2Dim3::operator-= ( const TensorRank2Dim3 that)
inline

In-place component-wise subtraction. $ \vec{\vec{X}} = \vec{\vec{X}} - \vec{\vec{Y}} $

Definition at line 83 of file chi_meshtensor_rank2_dim3.h.

◆ operator/()

TensorRank2Dim3 chi_mesh::TensorRank2Dim3::operator/ ( const double  value) const
inline

Component-wise division by scalar. $ \vec{\vec{W}} = \vec{\vec{X}}\frac{1}{\alpha} $

Definition at line 119 of file chi_meshtensor_rank2_dim3.h.

◆ operator/=()

TensorRank2Dim3 & chi_mesh::TensorRank2Dim3::operator/= ( const double  value)
inline

In-place component-wise division by scalar. $ \vec{\vec{X}} = \vec{\vec{X}}\frac{1}{\alpha} $

Definition at line 131 of file chi_meshtensor_rank2_dim3.h.

◆ operator=()

TensorRank2Dim3 & chi_mesh::TensorRank2Dim3::operator= ( const TensorRank2Dim3 that)
inline

Component-wise copy

Definition at line 31 of file chi_meshtensor_rank2_dim3.h.

◆ operator[]()

chi_mesh::Vector3 & chi_mesh::TensorRank2Dim3::operator[] ( int  index)
inline

Element access.

Definition at line 39 of file chi_meshtensor_rank2_dim3.h.

◆ PrintS()

std::string chi_mesh::TensorRank2Dim3::PrintS ( )
inline

Prints the vector to a string and then returns the string.

Definition at line 174 of file chi_meshtensor_rank2_dim3.h.

◆ Transpose()

TensorRank2Dim3 chi_mesh::TensorRank2Dim3::Transpose ( )
inline

Classical transpose of the tensor. $ W_{ij} = T_{ji} $

Definition at line 143 of file chi_meshtensor_rank2_dim3.h.

Field Documentation

◆ t

std::vector<chi_mesh::Vector3> chi_mesh::TensorRank2Dim3::t

Tensor entries.

Definition at line 10 of file chi_meshtensor_rank2_dim3.h.


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