FEDEM Model Database  R8.0
Source code of the FEDEM model database
Public Member Functions | Private Attributes | Friends | List of all members
FFaTensor2 Class Reference

Class to represent a 2D symmetrical tensor. More...

#include <FFaTensor2.H>

Public Member Functions

 FFaTensor2 (double d=0.0)
 Default constructor initializing the tensor to 0 (or given value). More...
 
 FFaTensor2 (const float *t)
 Constructor creating a tensor from a float array. More...
 
 FFaTensor2 (const double *t)
 Constructor creating a tensor from a double array. More...
 
 FFaTensor2 (const FFaTensor1 &t)
 Copy constructor for casting from FFaTensor1. More...
 
 FFaTensor2 (const FFaTensor3 &t)
 Copy constructor for casting from FFaTensor3. More...
 
 FFaTensor2 (double t11, double t22, double t12=0.0)
 Constructor creating a tensor from 2 or 3 component values. More...
 
void fill (double d)
 Initializes all tensor components to the given value. More...
 
FFaTensor2 & operator= (const FFaTensor1 &t)
 Overloaded assignment operator. More...
 
FFaTensor2 & operator= (const FFaTensor3 &t)
 
FFaTensor2 & operator+= (const FFaTensor2 &t)
 Addition operator. More...
 
FFaTensor2 & operator-= (const FFaTensor2 &t)
 Subtraction operator. More...
 
FFaTensor2 & operator*= (double d)
 Scaling operator (multiplication by a scalar). More...
 
FFaTensor2 & 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...
 
FFaTensor2 & rotate (const double ex[2], const double ey[2])
 Rotates the tensor to the given coordinate system axes. 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 minPrinsipal () const
 Returns the min principal value of the tensor. More...
 
void prinsipalValues (double &max, 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, 3 > myT
 Tensor component values (11,22,12) More...
 

Friends

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

Detailed Description

Class to represent a 2D symmetrical tensor.

Tensor layout:

T = {t11, t22, t12}

Constructor & Destructor Documentation

◆ FFaTensor2() [1/6]

FFaTensor2::FFaTensor2 ( double  d = 0.0)
inline

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

◆ FFaTensor2() [2/6]

FFaTensor2::FFaTensor2 ( const float *  t)
inline

Constructor creating a tensor from a float array.

◆ FFaTensor2() [3/6]

FFaTensor2::FFaTensor2 ( const double *  t)
inline

Constructor creating a tensor from a double array.

◆ FFaTensor2() [4/6]

FFaTensor2::FFaTensor2 ( const FFaTensor1 &  t)

Copy constructor for casting from FFaTensor1.

◆ FFaTensor2() [5/6]

FFaTensor2::FFaTensor2 ( const FFaTensor3 &  t)

Copy constructor for casting from FFaTensor3.

◆ FFaTensor2() [6/6]

FFaTensor2::FFaTensor2 ( double  t11,
double  t22,
double  t12 = 0.0 
)
inline

Constructor creating a tensor from 2 or 3 component values.

Member Function Documentation

◆ fill()

void FFaTensor2::fill ( double  d)
inline

Initializes all tensor components to the given value.

◆ getPt() [1/2]

double* FFaTensor2::getPt ( )
inline

Accesses the internal array (for update).

◆ getPt() [2/2]

const double* FFaTensor2::getPt ( ) const
inline

Accesses the internal array (read only).

◆ maxPrinsipal()

double FFaTensor2::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 FFaTensor2::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 FFaTensor2::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.

◆ minPrinsipal()

double FFaTensor2::minPrinsipal ( ) const

Returns the min principal value of the tensor.

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

◆ operator*=()

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

Scaling operator (multiplication by a scalar).

◆ operator+=()

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

Addition operator.

◆ operator-=()

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

Subtraction operator.

◆ operator/=()

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

Scaling operator (division by a scalar).

◆ operator=() [1/2]

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

Overloaded assignment operator.

◆ operator=() [2/2]

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

◆ operator[]() [1/2]

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

Zero-based indexing operator (for update).

◆ operator[]() [2/2]

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

Zero-based indexing operator (read only).

◆ prinsipalValues() [1/2]

void FFaTensor2::prinsipalValues ( double &  max,
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 FFaTensor2::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()

FFaTensor2 & FFaTensor2::rotate ( const double  ex[2],
const double  ey[2] 
)

Rotates the tensor to the given coordinate system axes.

◆ vonMises()

double FFaTensor2::vonMises ( ) const

Returns the von Mises value of the tensor.

Friends And Related Function Documentation

◆ operator!=

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

Inequality operator,.

◆ operator* [1/6]

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

Multiplication of a rotation matrix and a tensor.

◆ operator* [2/6]

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

Multiplication of a position matrix and a tensor.

◆ operator* [3/6]

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

Multiplication of a tensor and a rotation matrix.

◆ operator* [4/6]

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

Multiplication of a tensor and a position matrix.

◆ operator* [5/6]

FFaTensor2 operator* ( const FFaTensor2 &  ,
double   
)
friend

Scaling operator, multiplication of a tensor and a scalar.

◆ operator* [6/6]

FFaTensor2 operator* ( double  ,
const FFaTensor2 &   
)
friend

Scaling operator, multiplication of a scalar and a tensor.

◆ operator+

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

Global addition operator.

◆ operator- [1/2]

FFaTensor2 operator- ( const FFaTensor2 &  )
friend

Unary negation operator.

◆ operator- [2/2]

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

Global subtraction operator.

◆ operator/

FFaTensor2 operator/ ( const FFaTensor2 &  ,
double   
)
friend

Scaling operator, division by a scalar.

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const FFaTensor2 &  b 
)
friend

Printing operator.

◆ operator==

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

Equality operator,.

◆ operator>>

std::istream& operator>> ( std::istream &  s,
FFaTensor2 &  b 
)
friend

Reading operator.

Member Data Documentation

◆ myT

std::array<double,3> FFaTensor2::myT
private

Tensor component values (11,22,12)


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