FEDEM Solver  R8.0
Source code of the dynamics solver
Functions
FFaTensorTransforms Namespace Reference

Various tensor transformation utilities. More...

Functions

double vonMises (int N, const double *S)
 Returns the von Mises value of a symmetric stress/strain tensor. More...
 
double vonMises (double s11, double s22, double s12)
 Returns the von Mises value of a 2D stress/strain tensor. More...
 
double vonMises (double s11, double s22, double s33, double s12, double s13, double s23)
 Returns the von Mises value of a 3D stress/strain tensor. More...
 
int principalDirs (int N, const double *S, double *pVals, double *pDirs)
 Calculates the principal directions and values of a tensor. More...
 
int principalDirs (const double *S, double *pVal, double *p1Dir, double *p2Dir)
 Calculates the principal directions and values of a 2D tensor. More...
 
int principalDirs (const double *S, double *pVal, double *p1Dir, double *p2Dir, double *p3Dir)
 Calculates the principal directions and values of a 3D tensor. More...
 
bool principalValues (int N, const double *S, double *P)
 Calculates the principal values of a tensor. More...
 
bool principalVals2D (double s11, double s22, double s12, double *pVal)
 Calculates the principal values of a 2D tensor. More...
 
bool principalVals3D (double s11, double s22, double s33, double s12, double s13, double s23, double *pVal)
 Calculates the principal values of a 3D tensor. More...
 
bool principalValues (double s11, double s22, double s12, double &p1, double &p2)
 
bool principalValues (double s11, double s22, double s33, double s12, double s13, double s23, double &p1, double &p2, double &p3)
 
double maxShearValue (double pMax, double pMin)
 Returns the maximum shear value. More...
 
void maxShearDir (int N, const double *pMaxDir, const double *pMinDir, double *maxShearDir)
 Returns the direction of maximum shear. More...
 
void rotate2D (const double *inTensor, const double *rotMx, double *outTensor)
 Coordinate transformation for a 2D tensor. More...
 
void rotate (const double *inTensor, const double *eX, const double *eY, double *outTensor)
 Coordinate transformation for a 2D tensor. More...
 
void rotate3D (const double *inTensor, const double *rotMx, double *outTensor)
 Coordinate transformation for a 3D tensor. More...
 
void rotate (const double *inTensor, const double *eX, const double *eY, const double *eZ, double *outTensor)
 Coordinate transformation for a 3D tensor. More...
 
void from2Dto3D (const double *tensor2D, double *tensor3D)
 Plain 2D-to-3D tensor conversion. More...
 
void from3Dto2D (const double *tensor3D, double *tensor2D)
 Plain 3D-to-2D tensor conversion. More...
 

Detailed Description

Various tensor transformation utilities.

Function Documentation

◆ from2Dto3D()

void FFaTensorTransforms::from2Dto3D ( const double *  S2D,
double *  S3D 
)

Plain 2D-to-3D tensor conversion.

Padding with zeros to fit the 3D tensor.

◆ from3Dto2D()

void FFaTensorTransforms::from3Dto2D ( const double *  S3D,
double *  S2D 
)

Plain 3D-to-2D tensor conversion.

Just cutting off whats needed to fit the 2D tensor.

◆ maxShearDir()

void FFaTensorTransforms::maxShearDir ( int  N,
const double *  pMaxDir,
const double *  pMinDir,
double *  maxShearDir 
)

Returns the direction of maximum shear.

Parameters
[in]NVector dimension (1, 2 or 3)
[in]pMaxDirDirection of the max principal value
[in]pMinDirDirection of the min principal value
[out]maxShearDirDirection of the max shear value, this is 45 degrees on the max and min directions pointing from min to max

◆ maxShearValue()

double FFaTensorTransforms::maxShearValue ( double  pMax,
double  pMin 
)

Returns the maximum shear value.

Parameters
[in]pMaxMax principal value
[in]pMinMin principal value
Returns
Max shear value

◆ principalDirs() [1/3]

int FFaTensorTransforms::principalDirs ( const double *  S,
double *  pVal,
double *  p1Dir,
double *  p2Dir 
)

Calculates the principal directions and values of a 2D tensor.

Parameters
[in]STensor values, {s11, s22, s12}
[out]pValPrincipal values, {pMax,pMin}
[out]p1DirDirection vector for the first principal value
[out]p2DirDirection vector for the second principal value
Returns
Negative value on error, otherwise zero

◆ principalDirs() [2/3]

int FFaTensorTransforms::principalDirs ( const double *  S,
double *  pVal,
double *  p1Dir,
double *  p2Dir,
double *  p3Dir 
)

Calculates the principal directions and values of a 3D tensor.

Parameters
[in]STensor values, {s11, s22, s33, s12, s13, s23}
[out]pValPrincipal values, {pMax,pMid,pMin}
[out]p1DirDirection vector for the first principal value
[out]p2DirDirection vector for the second principal value
[out]p3DirDirection vector for the third principal value
Returns
Negative value on error, otherwise zero

◆ principalDirs() [3/3]

int FFaTensorTransforms::principalDirs ( int  N,
const double *  S,
double *  pVal,
double *  pDir 
)

Calculates the principal directions and values of a tensor.

Parameters
[in]NTensor dimension (1, 2 or 3)
[in]STensor values, upper triangle of the symmetric tensor
[out]pValPrincipal values in descending order, i.e., {P1,P2,P3}
[out]pDirAssociated principal direction vectors, e.g., in 3D:
  • dir1 = pDir[0:2]
  • dir2 = pDir[3:5]
  • dir3 = pDir[6:8]
Returns
Negative value on error, otherwise zero

The tensor values are assumed laid out as follows

  • N = 1: S = {s11}
  • N = 2: S = {s11, s22, s12}
  • N = 3: S = {s11, s22, s33, s12, s13, s23}

This function uses the LAPACK eigenvalue solver DSYEV.

◆ principalVals2D()

bool FFaTensorTransforms::principalVals2D ( double  s11,
double  s22,
double  s12,
double *  pVal 
)

Calculates the principal values of a 2D tensor.

◆ principalVals3D()

bool FFaTensorTransforms::principalVals3D ( double  s11,
double  s22,
double  s33,
double  s12,
double  s13,
double  s23,
double *  pVal 
)

Calculates the principal values of a 3D tensor.

◆ principalValues() [1/3]

bool FFaTensorTransforms::principalValues ( double  s11,
double  s22,
double  s12,
double &  p1,
double &  p2 
)
inline

◆ principalValues() [2/3]

bool FFaTensorTransforms::principalValues ( double  s11,
double  s22,
double  s33,
double  s12,
double  s13,
double  s23,
double &  p1,
double &  p2,
double &  p3 
)
inline

◆ principalValues() [3/3]

bool FFaTensorTransforms::principalValues ( int  N,
const double *  S,
double *  P 
)

Calculates the principal values of a tensor.

Parameters
[in]NTensor dimension (1, 2 or 3)
[in]STensor values, upper triangle of the symmetric tensor
[out]PPrincipal values in descending order, i.e., {P1,P2,P3}

The tensor values are assumed laid out as follows

  • N = 1: S = {s11}
  • N = 2: S = {s11, s22, s12}
  • N = 3: S = {s11, s22, s33, s12, s13, s23}

◆ rotate() [1/2]

void FFaTensorTransforms::rotate ( const double *  S,
const double *  eX,
const double *  eY,
const double *  eZ,
double *  S_transformed 
)

Coordinate transformation for a 3D tensor.

Parameters
[in]SSymmetric input tensor, S = {s11, s22, s33, s12, s13, s23}
[in]eXUnit X-direction vector
[in]eYUnit Y-direction vector
[in]eZUnit Z-direction vector
[out]S_transformedThe transformed tensor

◆ rotate() [2/2]

void FFaTensorTransforms::rotate ( const double *  S,
const double *  eX,
const double *  eY,
double *  S_transformed 
)

Coordinate transformation for a 2D tensor.

Parameters
[in]SSymmetric input tensor, S = {s11, s22, s12}
[in]eXUnit X-direction vector
[in]eYUnit Y-direction vector
[out]S_transformedThe transformed tensor

◆ rotate2D()

void FFaTensorTransforms::rotate2D ( const double *  inTensor,
const double *  rotMx,
double *  outTensor 
)

Coordinate transformation for a 2D tensor.

Parameters
[in]inTensorSymmetric input tensor, {s11, s22, s12}
[in]rotMxTransformation matrix, [eX, eY]
[out]outTensorThe transformed tensor

◆ rotate3D()

void FFaTensorTransforms::rotate3D ( const double *  inTensor,
const double *  rotMx,
double *  outTensor 
)

Coordinate transformation for a 3D tensor.

Parameters
[in]inTensorSymmetric input tensor, {s11, s22, s33, s12, s13, s23}
[in]rotMxTransformation matrix, [eX, eY, eZ]
[out]outTensorThe transformed tensor

◆ vonMises() [1/3]

double FFaTensorTransforms::vonMises ( double  s11,
double  s22,
double  s12 
)

Returns the von Mises value of a 2D stress/strain tensor.

◆ vonMises() [2/3]

double FFaTensorTransforms::vonMises ( double  s11,
double  s22,
double  s33,
double  s12,
double  s13,
double  s23 
)

Returns the von Mises value of a 3D stress/strain tensor.

◆ vonMises() [3/3]

double FFaTensorTransforms::vonMises ( int  N,
const double *  S 
)

Returns the von Mises value of a symmetric stress/strain tensor.

Parameters
[in]NTensor dimension (1, 2 or 3)
[in]STensor values, upper triangle of the symmetric tensor

The tensor values are assumed laid out as follows

  • N = 1: S = {s11}
  • N = 2: S = {s11, s22, s12}
  • N = 3: S = {s11, s22, s33, s12, s13, s23}