FEDEM Solver  R8.0
Source code of the dynamics solver
Public Member Functions | Private Attributes | Friends | List of all members
FFaTensor3 Class Reference

Class to represent a 3D symmetric tensor. More...

#include <FFaTensor3.H>

Public Member Functions

 FFaTensor3 (double d=0.0)
 Default constructor initializing the tensor to 0 (or given value). More...
 
 FFaTensor3 (const float *t)
 Constructor creating a tensor from a float array. More...
 
 FFaTensor3 (const double *t)
 Constructor creating a tensor from a double array. More...
 
 FFaTensor3 (const FFaTensor2 &t)
 Copy constructor for casting from FFaTensor2. More...
 
 FFaTensor3 (const FFaTensor1 &t)
 Copy constructor for casting from FFaTensor1. More...
 
 FFaTensor3 (const FaVec3 &v)
 Constructor creating a diagonal tensor from a vector. More...
 
 FFaTensor3 (double t11, double t22, double t33, double t12=0.0, double t13=0.0, double t23=0.0)
 Constructor creating a tensor from 3 to 6 component values. More...
 
 FFaTensor3 (const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3)
 Constructor creating an intertia tensor of a tetrahedron. More...
 
void fill (double d)
 Initializes all tensor components to the given value. More...
 
FFaTensor3 & operator= (const FFaTensor1 &t)
 Overloaded assignment operator. More...
 
FFaTensor3 & operator= (const FFaTensor2 &t)
 Overloaded assignment operator. More...
 
FFaTensor3 & operator+= (const FFaTensor3 &t)
 Addition operator. More...
 
FFaTensor3 & operator-= (const FFaTensor3 &t)
 Subtraction operator. More...
 
FFaTensor3 & operator*= (double d)
 Scaling operator (multiplication by a scalar). More...
 
FFaTensor3 & operator/= (double d)
 Scaling operator (division by a scalar). More...
 
const double * getPt () const
 Accesses the internal array (read only). More...
 
double * getPt ()
 Accesses the internal array (for update). More...
 
const double & operator[] (int i) const
 Zero-based indexing operator (read only). More...
 
double & operator[] (int i)
 Zero-based indexing operator (for update). More...
 
FFaTensor3 & rotate (const FaMat33 &rotMx)
 Rotates the tensor to the given coordinate system. More...
 
FFaTensor3 & rotate (const FaMat34 &rotMx)
 Rotates the tensor to the given coordinate system. More...
 
FFaTensor3 & makeInertia (const FaVec3 &v1, const FaVec3 &v2, const FaVec3 &v3)
 Makes the inertia tensor of a tetrahedron defined by three points. More...
 
FFaTensor3 & translateInertia (const FaVec3 &x, double mass)
 Translates an inertia tensor using the parallel-axis theorem. More...
 
double vonMises () const
 Returns the von Mises value of the tensor. More...
 
double maxShear () const
 Returns the max shear value of the tensor. More...
 
void maxShear (FaVec3 &v) const
 Gets the max shear of the tensor as a directed vector. More...
 
double maxPrinsipal (bool absMax=false) const
 Returns the max or absolute max principal value of the tensor. More...
 
double middlePrinsipal () const
 Returns the middle principal value of the tensor. More...
 
double minPrinsipal () const
 Returns the min principal value of the tensor. More...
 
void prinsipalValues (double &max, double &middle, double &min) const
 Gets the principal values of the tensor. More...
 
void prinsipalValues (FaVec3 &values, FaMat33 &rotation) const
 Gets the principal directions and associated values of the tensor. More...
 

Private Attributes

std::array< double, 6 > myT
 Tensor component values (11,22,33,12,13,23) More...
 

Friends

FFaTensor3 operator- (const FFaTensor3 &)
 Unary negation operator. More...
 
FFaTensor3 operator+ (const FFaTensor3 &, const FFaTensor3 &)
 Global addition operator. More...
 
FFaTensor3 operator- (const FFaTensor3 &, const FFaTensor3 &)
 Global subtraction operator. More...
 
FFaTensor3 operator* (const FFaTensor3 &, double)
 Scaling operator, multiplication of a tensor and a scalar. More...
 
FFaTensor3 operator* (double, const FFaTensor3 &)
 Scaling operator, multiplication of a scalar and a tensor. More...
 
FFaTensor3 operator/ (const FFaTensor3 &, double)
 Scaling operator, division by a scalar. More...
 
bool operator== (const FFaTensor3 &, const FFaTensor3 &)
 Equality operator,. More...
 
bool operator!= (const FFaTensor3 &, const FFaTensor3 &)
 Inequality operator,. More...
 
FFaTensor3 operator* (const FFaTensor3 &, const FaMat33 &)
 Multiplication of a tensor and a rotation matrix. More...
 
FFaTensor3 operator* (const FFaTensor3 &, const FaMat34 &)
 Multiplication of a tensor and a position matrix. More...
 
FFaTensor3 operator* (const FaMat33 &, const FFaTensor3 &)
 Multiplication of a rotation matrix and a tensor. More...
 
FFaTensor3 operator* (const FaMat34 &, const FFaTensor3 &)
 Multiplication of a position matrix and a tensor. More...
 
std::ostream & operator<< (std::ostream &, const FFaTensor3 &)
 Printing operator. More...
 
std::istream & operator>> (std::istream &, FFaTensor3 &)
 Reading operator. More...
 

Detailed Description

Class to represent a 3D symmetric tensor.

Tensor layout:

T = {t11, t22, t33, t12, t13, t23}

Constructor & Destructor Documentation

◆ FFaTensor3() [1/8]

FFaTensor3::FFaTensor3 ( double  d = 0.0)
inline

Default constructor initializing the tensor to 0 (or given value).

◆ FFaTensor3() [2/8]

FFaTensor3::FFaTensor3 ( const float *  t)
inline

Constructor creating a tensor from a float array.

◆ FFaTensor3() [3/8]

FFaTensor3::FFaTensor3 ( const double *  t)
inline

Constructor creating a tensor from a double array.

◆ FFaTensor3() [4/8]

FFaTensor3::FFaTensor3 ( const FFaTensor2 &  t)

Copy constructor for casting from FFaTensor2.

◆ FFaTensor3() [5/8]

FFaTensor3::FFaTensor3 ( const FFaTensor1 &  t)

Copy constructor for casting from FFaTensor1.

◆ FFaTensor3() [6/8]

FFaTensor3::FFaTensor3 ( const FaVec3 &  v)

Constructor creating a diagonal tensor from a vector.

◆ FFaTensor3() [7/8]

FFaTensor3::FFaTensor3 ( double  t11,
double  t22,
double  t33,
double  t12 = 0.0,
double  t13 = 0.0,
double  t23 = 0.0 
)
inline

Constructor creating a tensor from 3 to 6 component values.

◆ FFaTensor3() [8/8]

FFaTensor3::FFaTensor3 ( const FaVec3 &  v1,
const FaVec3 &  v2,
const FaVec3 &  v3 
)
inline

Constructor creating an intertia tensor of a tetrahedron.

Member Function Documentation

◆ fill()

void FFaTensor3::fill ( double  d)
inline

Initializes all tensor components to the given value.

◆ getPt() [1/2]

double* FFaTensor3::getPt ( )
inline

Accesses the internal array (for update).

◆ getPt() [2/2]

const double* FFaTensor3::getPt ( ) const
inline

Accesses the internal array (read only).

◆ makeInertia()

FFaTensor3 & FFaTensor3::makeInertia ( const FaVec3 &  v1,
const FaVec3 &  v2,
const FaVec3 &  v3 
)

Makes the inertia tensor of a tetrahedron defined by three points.

This method create the inertia tensor of the tetrahedron spanned by the origin (0,0,0) and the given three points v1, v2 and v3.

◆ maxPrinsipal()

double FFaTensor3::maxPrinsipal ( bool  absMax = false) const

Returns the max or absolute max principal value of the tensor.

HUGE_VAL will be returned if the principal value can not be found.

◆ maxShear() [1/2]

double FFaTensor3::maxShear ( ) const

Returns the max shear value of the tensor.

HUGE_VAL will be returned if the max shear value can not be found.

◆ maxShear() [2/2]

void FFaTensor3::maxShear ( FaVec3 &  v) const

Gets the max shear of the tensor as a directed vector.

The vector is set to zero if the max shear directions can not be found.

◆ middlePrinsipal()

double FFaTensor3::middlePrinsipal ( ) const

Returns the middle principal value of the tensor.

HUGE_VAL will be returned if the principal value can not be found.

◆ minPrinsipal()

double FFaTensor3::minPrinsipal ( ) const

Returns the min principal value of the tensor.

HUGE_VAL will be returned if the principal value can not be found.

◆ operator*=()

FFaTensor3& FFaTensor3::operator*= ( double  d)
inline

Scaling operator (multiplication by a scalar).

◆ operator+=()

FFaTensor3& FFaTensor3::operator+= ( const FFaTensor3 &  t)
inline

Addition operator.

◆ operator-=()

FFaTensor3& FFaTensor3::operator-= ( const FFaTensor3 &  t)
inline

Subtraction operator.

◆ operator/=()

FFaTensor3& FFaTensor3::operator/= ( double  d)
inline

Scaling operator (division by a scalar).

◆ operator=() [1/2]

FFaTensor3 & FFaTensor3::operator= ( const FFaTensor1 &  t)

Overloaded assignment operator.

◆ operator=() [2/2]

FFaTensor3 & FFaTensor3::operator= ( const FFaTensor2 &  t)

Overloaded assignment operator.

◆ operator[]() [1/2]

double & FFaTensor3::operator[] ( int  i)
inline

Zero-based indexing operator (for update).

◆ operator[]() [2/2]

const double & FFaTensor3::operator[] ( int  i) const
inline

Zero-based indexing operator (read only).

◆ prinsipalValues() [1/2]

void FFaTensor3::prinsipalValues ( double &  max,
double &  middle,
double &  min 
) const

Gets the principal values of the tensor.

HUGE_VAL will be returned if the principal values can not be found.

◆ prinsipalValues() [2/2]

void FFaTensor3::prinsipalValues ( FaVec3 &  values,
FaMat33 &  rotation 
) const

Gets the principal directions and associated values of the tensor.

A valid rotation matrix corresponding to the principal axes of the tensor is calculated. The associated principal values are also found in the corresponding order. If the rotation matrix can't be found, the identity will be returned, along with a vector of HUGE_VAL.

◆ rotate() [1/2]

FFaTensor3 & FFaTensor3::rotate ( const FaMat33 &  rotMx)

Rotates the tensor to the given coordinate system.

◆ rotate() [2/2]

FFaTensor3 & FFaTensor3::rotate ( const FaMat34 &  rotMx)

Rotates the tensor to the given coordinate system.

◆ translateInertia()

FFaTensor3 & FFaTensor3::translateInertia ( const FaVec3 &  x,
double  mass 
)

Translates an inertia tensor using the parallel-axis theorem.

◆ vonMises()

double FFaTensor3::vonMises ( ) const

Returns the von Mises value of the tensor.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const FFaTensor3 &  ,
const FFaTensor3 &   
)
friend

Inequality operator,.

◆ operator* [1/6]

FFaTensor3 operator* ( const FaMat33 &  ,
const FFaTensor3 &   
)
friend

Multiplication of a rotation matrix and a tensor.

◆ operator* [2/6]

FFaTensor3 operator* ( const FaMat34 &  ,
const FFaTensor3 &   
)
friend

Multiplication of a position matrix and a tensor.

◆ operator* [3/6]

FFaTensor3 operator* ( const FFaTensor3 &  ,
const FaMat33 &   
)
friend

Multiplication of a tensor and a rotation matrix.

◆ operator* [4/6]

FFaTensor3 operator* ( const FFaTensor3 &  ,
const FaMat34 &   
)
friend

Multiplication of a tensor and a position matrix.

◆ operator* [5/6]

FFaTensor3 operator* ( const FFaTensor3 &  ,
double   
)
friend

Scaling operator, multiplication of a tensor and a scalar.

◆ operator* [6/6]

FFaTensor3 operator* ( double  ,
const FFaTensor3 &   
)
friend

Scaling operator, multiplication of a scalar and a tensor.

◆ operator+

FFaTensor3 operator+ ( const FFaTensor3 &  ,
const FFaTensor3 &   
)
friend

Global addition operator.

◆ operator- [1/2]

FFaTensor3 operator- ( const FFaTensor3 &  )
friend

Unary negation operator.

◆ operator- [2/2]

FFaTensor3 operator- ( const FFaTensor3 &  ,
const FFaTensor3 &   
)
friend

Global subtraction operator.

◆ operator/

FFaTensor3 operator/ ( const FFaTensor3 &  ,
double   
)
friend

Scaling operator, division by a scalar.

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const FFaTensor3 &   
)
friend

Printing operator.

◆ operator==

bool operator== ( const FFaTensor3 &  ,
const FFaTensor3 &   
)
friend

Equality operator,.

◆ operator>>

std::istream& operator>> ( std::istream &  ,
FFaTensor3 &   
)
friend

Reading operator.

Member Data Documentation

◆ myT

std::array<double,6> FFaTensor3::myT
private

Tensor component values (11,22,33,12,13,23)


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