ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Tensor Class Reference

Class for a matrix 3x3 system object. More...

#include <Tensor.h>

Public Member Functions

 Tensor ()
 
 Tensor (const Tensor &tensor)
 
 Tensor (const double &xx, const double &xy, const double &xz, const double &yx, const double &yy, const double &yz, const double &zx, const double &zy, const double &zz)
 
 Tensor (const Coord &x, const Coord &y, const Coord &z)
 
 ~Tensor ()
 
const double & getElement (const int &element) const
 Return the value of the specific element of the Tensor object.
 
const double & getXX () const
 Return the value of the xx-element of the Tensor object.
 
const double & getXY () const
 Return the value of the xy-element of the Tensor object.
 
const double & getXZ () const
 Return the value of the xz-element of the Tensor object.
 
const double & getYX () const
 Return the value of the yx-element of the Tensor object.
 
const double & getYY () const
 Return the value of the yy-element of the Tensor object.
 
const double & getYZ () const
 Return the value of the yz-element of the Tensor object.
 
const double & getZX () const
 Return the value of the zx-element of the Tensor object.
 
const double & getZY () const
 Return the value of the zy-element of the Tensor object.
 
const double & getZZ () const
 Return the value of the zz-element of the Tensor object.
 
void setXX (const double &xx)
 Set the value in the xx-element of the Tensor object.
 
void setXY (const double &xy)
 Set the value in the xy-element of the Tensor object.
 
void setXZ (const double &xz)
 Set the value in the xz-element of the Tensor object.
 
void setYX (const double &xx)
 Set the value in the yx-element of the Tensor object.
 
void setYY (const double &xy)
 Set the value in the yy-element of the Tensor object.
 
void setYZ (const double &xz)
 Set the value in the yz-element of the Tensor object.
 
void setZX (const double &xx)
 Set the value in the zx-element of the Tensor object.
 
void setZY (const double &xy)
 Set the value in the zy-element of the Tensor object.
 
void setZZ (const double &xz)
 Set the value in the zz-element of the Tensor object.
 
void setTensor (const Tensor &tensor)
 Set the Tensor object.
 
void setTensor (const double &value)
 Set all the elements of the Tensor object to a scalar value.
 
void identity ()
 Set the Tensor object to identity.
 
void correctZeros ()
 Set to perfect zero each of the epsilon terms.
 
Coord scalar (const Coord &a) const
 Return the scalar product between the Tensor and the Coord.
 
void localProjection (const Coord &normal, const Coord &tangent, const Coord &binormal)
 Projection in the local coordinate system which is defined by the transmitted normal, tangent and binormal.
 
void reverseProjection (const Coord &normal, const Coord &tangent, const Coord &binormal)
 Reverse projection in the absolute Cartesian coordinate system.
 
void setTensorByLines (const Coord &x, const Coord &y, const Coord &z)
 
void setTensorByColumns (const Coord &x, const Coord &y, const Coord &z)
 
void tensorToCoords (Coord &x, Coord &y, Coord &z) const
 Transform the Tensor into Coords (vectors)
 
void tensorToArray (double *array) const
 Transform the Tensor into 1D array (pointer)
 
void arrayToTensor (const double *array)
 Transform the 1D array (pointer) into Tensor.
 
void transpose (Tensor &transposedTensor) const
 Compute the transpose of the tensor.
 
void matrixProduct (const Tensor &tensor2, Tensor &resultingTensor) const
 Compute the matrix product of the two tensors.
 
double trace () const
 Return the trace of the tensor.
 
double determinant () const
 Return the determinant of the tensor.
 
void inverse (Tensor &inverseTensor) const
 Compute the inverse of the tensor.
 
bool isIdentity () const
 Return true if equal to identity.
 
void eigen (Tensor &eigenvalues, Tensor &eigenvectors) const
 Compute the eigenvalues and eigenvectors of the tensor with Jacobi's algorithm.
 
Tensoroperator= (const double &scalar)
 
Tensoroperator= (const Tensor &a)
 
Tensoroperator*= (const double &scalar)
 
Tensoroperator/= (const double &scalar)
 
Tensor operator* (const double &scalar) const
 
Tensor operator/ (const double &scalar) const
 
Tensoroperator+= (const Tensor &a)
 
Tensoroperator-= (const Tensor &a)
 

Static Public Attributes

static const Tensor defaultTensor = Tensor()
 Default Tensor object (const version)
 
static Tensor defaultTensorNonConst = Tensor()
 Default Tensor object (non-const version)
 

Protected Attributes

std::array< double, 9 > m_array
 

Detailed Description

Class for a matrix 3x3 system object.

Constructor & Destructor Documentation

◆ Tensor() [1/4]

Tensor::Tensor ( )

◆ Tensor() [2/4]

Tensor::Tensor ( const Tensor tensor)

◆ Tensor() [3/4]

Tensor::Tensor ( const double &  xx,
const double &  xy,
const double &  xz,
const double &  yx,
const double &  yy,
const double &  yz,
const double &  zx,
const double &  zy,
const double &  zz 
)

◆ Tensor() [4/4]

Tensor::Tensor ( const Coord x,
const Coord y,
const Coord z 
)

◆ ~Tensor()

Tensor::~Tensor ( )

Member Function Documentation

◆ arrayToTensor()

void Tensor::arrayToTensor ( const double *  array)

Transform the 1D array (pointer) into Tensor.

Parameters
array1D array (pointer)

◆ correctZeros()

void Tensor::correctZeros ( )

Set to perfect zero each of the epsilon terms.

◆ determinant()

double Tensor::determinant ( ) const

Return the determinant of the tensor.

◆ eigen()

void Tensor::eigen ( Tensor eigenvalues,
Tensor eigenvectors 
) const

Compute the eigenvalues and eigenvectors of the tensor with Jacobi's algorithm.

Parameters
eigenvaluestensor whose diagonal elements are eigenvalues (Tensor)
eigenvectorstensor whose columns are eigenvectors (Tensor)

◆ getElement()

const double & Tensor::getElement ( const int &  element) const
inline

Return the value of the specific element of the Tensor object.

◆ getXX()

const double & Tensor::getXX ( ) const
inline

Return the value of the xx-element of the Tensor object.

◆ getXY()

const double & Tensor::getXY ( ) const
inline

Return the value of the xy-element of the Tensor object.

◆ getXZ()

const double & Tensor::getXZ ( ) const
inline

Return the value of the xz-element of the Tensor object.

◆ getYX()

const double & Tensor::getYX ( ) const
inline

Return the value of the yx-element of the Tensor object.

◆ getYY()

const double & Tensor::getYY ( ) const
inline

Return the value of the yy-element of the Tensor object.

◆ getYZ()

const double & Tensor::getYZ ( ) const
inline

Return the value of the yz-element of the Tensor object.

◆ getZX()

const double & Tensor::getZX ( ) const
inline

Return the value of the zx-element of the Tensor object.

◆ getZY()

const double & Tensor::getZY ( ) const
inline

Return the value of the zy-element of the Tensor object.

◆ getZZ()

const double & Tensor::getZZ ( ) const
inline

Return the value of the zz-element of the Tensor object.

◆ identity()

void Tensor::identity ( )

Set the Tensor object to identity.

◆ inverse()

void Tensor::inverse ( Tensor inverseTensor) const

Compute the inverse of the tensor.

Parameters
inverseTensorinverse tensor (Tensor)

◆ isIdentity()

bool Tensor::isIdentity ( ) const

Return true if equal to identity.

◆ localProjection()

void Tensor::localProjection ( const Coord normal,
const Coord tangent,
const Coord binormal 
)

Projection in the local coordinate system which is defined by the transmitted normal, tangent and binormal.

Parameters
normalnormal vector (Coord)
tangenttangent vector (Coord)
binormalbinormal vector (Coord)

◆ matrixProduct()

void Tensor::matrixProduct ( const Tensor tensor2,
Tensor resultingTensor 
) const

Compute the matrix product of the two tensors.

Parameters
tensor2second tensor (Tensor)
resultingTensorresulting tensor of the product (Tensor)

◆ operator*()

Tensor Tensor::operator* ( const double &  scalar) const

◆ operator*=()

Tensor & Tensor::operator*= ( const double &  scalar)

◆ operator+=()

Tensor & Tensor::operator+= ( const Tensor a)

◆ operator-=()

Tensor & Tensor::operator-= ( const Tensor a)

◆ operator/()

Tensor Tensor::operator/ ( const double &  scalar) const

◆ operator/=()

Tensor & Tensor::operator/= ( const double &  scalar)

◆ operator=() [1/2]

Tensor & Tensor::operator= ( const double &  scalar)

◆ operator=() [2/2]

Tensor & Tensor::operator= ( const Tensor a)

◆ reverseProjection()

void Tensor::reverseProjection ( const Coord normal,
const Coord tangent,
const Coord binormal 
)

Reverse projection in the absolute Cartesian coordinate system.

Parameters
normalnormal vector (Coord)
tangenttangent vector (Coord)
binormalbinormal vector (Coord)

◆ scalar()

Coord Tensor::scalar ( const Coord a) const

Return the scalar product between the Tensor and the Coord.

Parameters
avector (Coord)

◆ setTensor() [1/2]

void Tensor::setTensor ( const double &  value)

Set all the elements of the Tensor object to a scalar value.

Parameters
valuescalar value to set all elements

◆ setTensor() [2/2]

void Tensor::setTensor ( const Tensor tensor)

Set the Tensor object.

Parameters
tensortensor

◆ setTensorByColumns()

void Tensor::setTensorByColumns ( const Coord x,
const Coord y,
const Coord z 
)

◆ setTensorByLines()

void Tensor::setTensorByLines ( const Coord x,
const Coord y,
const Coord z 
)

◆ setXX()

void Tensor::setXX ( const double &  xx)

Set the value in the xx-element of the Tensor object.

Parameters
xxvalue of the xx-element coordinate

◆ setXY()

void Tensor::setXY ( const double &  xy)

Set the value in the xy-element of the Tensor object.

Parameters
xyvalue of the xy-element coordinate

◆ setXZ()

void Tensor::setXZ ( const double &  xz)

Set the value in the xz-element of the Tensor object.

Parameters
xzvalue of the xz-element coordinate

◆ setYX()

void Tensor::setYX ( const double &  xx)

Set the value in the yx-element of the Tensor object.

Parameters
xxvalue of the yx-element coordinate

◆ setYY()

void Tensor::setYY ( const double &  xy)

Set the value in the yy-element of the Tensor object.

Parameters
xyvalue of the yy-element coordinate

◆ setYZ()

void Tensor::setYZ ( const double &  xz)

Set the value in the yz-element of the Tensor object.

Parameters
xzvalue of the yz-element coordinate

◆ setZX()

void Tensor::setZX ( const double &  xx)

Set the value in the zx-element of the Tensor object.

Parameters
xxvalue of the zx-element coordinate

◆ setZY()

void Tensor::setZY ( const double &  xy)

Set the value in the zy-element of the Tensor object.

Parameters
xyvalue of the zy-element coordinate

◆ setZZ()

void Tensor::setZZ ( const double &  xz)

Set the value in the zz-element of the Tensor object.

Parameters
xzvalue of the zz-element coordinate

◆ tensorToArray()

void Tensor::tensorToArray ( double *  array) const

Transform the Tensor into 1D array (pointer)

Parameters
array1D array (pointer)

◆ tensorToCoords()

void Tensor::tensorToCoords ( Coord x,
Coord y,
Coord z 
) const

Transform the Tensor into Coords (vectors)

Parameters
xx vector (Coord)
yy vector (Coord)
zz vector (Coord)

◆ trace()

double Tensor::trace ( ) const

Return the trace of the tensor.

◆ transpose()

void Tensor::transpose ( Tensor transposedTensor) const

Compute the transpose of the tensor.

Parameters
transposedTensortransposed tensor (Tensor)

Member Data Documentation

◆ defaultTensor

const Tensor Tensor::defaultTensor = Tensor()
static

Default Tensor object (const version)

Used when returning a const Tensor&

◆ defaultTensorNonConst

Tensor Tensor::defaultTensorNonConst = Tensor()
static

Default Tensor object (non-const version)

Used when returning a const Tensor&

◆ m_array

std::array<double, 9> Tensor::m_array
protected

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