FEDEM Solver  R8.0
Source code of the dynamics solver
FFaTensorTransforms.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_TENSOR_TRANSFORMS_H
14 #define FFA_TENSOR_TRANSFORMS_H
15 
16 
18 {
20  double vonMises(int N, const double* S);
22  double vonMises(double s11, double s22, double s12);
24  double vonMises(double s11, double s22, double s33,
25  double s12, double s13, double s23);
26 
28  int principalDirs(int N, const double* S, double* pVals, double* pDirs);
30  int principalDirs(const double* S,
31  double* pVal, double* p1Dir, double* p2Dir);
33  int principalDirs(const double* S,
34  double* pVal, double* p1Dir, double* p2Dir, double* p3Dir);
35 
37  bool principalValues(int N, const double* S, double* P);
39  bool principalVals2D(double s11, double s22, double s12, double* pVal);
41  bool principalVals3D(double s11, double s22, double s33,
42  double s12, double s13, double s23, double* pVal);
43 
44  // For backward compatibility, purge these two later..
45  inline bool principalValues(double s11, double s22, double s12,
46  double& p1, double& p2)
47  {
48  double p[3] = { 0.0, 0.0, 0.0 };
49  bool ok = principalVals2D(s11,s22,s12,p);
50  p1 = p[0];
51  p2 = p[1];
52  return ok;
53  }
54  inline bool principalValues(double s11, double s22, double s33,
55  double s12, double s13, double s23,
56  double& p1, double& p2, double& p3)
57  {
58  double p[3] = { 0.0, 0.0, 0.0 };
59  bool ok = principalVals3D(s11,s22,s33,s12,s13,s23,p);
60  p1 = p[0];
61  p2 = p[1];
62  p3 = p[2];
63  return ok;
64  }
65 
67  double maxShearValue(double pMax, double pMin);
69  void maxShearDir (int N, const double* pMaxDir, const double* pMinDir,
70  double* maxShearDir);
71 
73  void rotate2D(const double* inTensor,
74  const double* rotMx,
75  double* outTensor);
77  void rotate (const double* inTensor,
78  const double* eX, const double* eY,
79  double* outTensor);
81  void rotate3D(const double* inTensor,
82  const double* rotMx,
83  double* outTensor);
85  void rotate (const double* inTensor,
86  const double* eX, const double* eY, const double* eZ,
87  double* outTensor);
88 
90  void from2Dto3D(const double* tensor2D, double* tensor3D);
92  void from3Dto2D(const double* tensor3D, double* tensor2D);
93 }
94 
95 #endif
Various tensor transformation utilities.
Definition: FFaTensorTransforms.H:18
bool principalVals3D(double s11, double s22, double s33, double s12, double s13, double s23, double *pVal)
Calculates the principal values of a 3D tensor.
Definition: FFaTensorTransforms.C:262
void from2Dto3D(const double *tensor2D, double *tensor3D)
Plain 2D-to-3D tensor conversion.
Definition: FFaTensorTransforms.C:412
int principalDirs(int N, const double *S, double *pVals, double *pDirs)
Calculates the principal directions and values of a tensor.
Definition: FFaTensorTransforms.C:88
double maxShearValue(double pMax, double pMin)
Returns the maximum shear value.
Definition: FFaTensorTransforms.C:295
bool principalValues(int N, const double *S, double *P)
Calculates the principal values of a tensor.
Definition: FFaTensorTransforms.C:225
void rotate3D(const double *inTensor, const double *rotMx, double *outTensor)
Coordinate transformation for a 3D tensor.
Definition: FFaTensorTransforms.C:369
void from3Dto2D(const double *tensor3D, double *tensor2D)
Plain 3D-to-2D tensor conversion.
Definition: FFaTensorTransforms.C:426
bool principalVals2D(double s11, double s22, double s12, double *pVal)
Calculates the principal values of a 2D tensor.
Definition: FFaTensorTransforms.C:242
double vonMises(int N, const double *S)
Returns the von Mises value of a symmetric stress/strain tensor.
Definition: FFaTensorTransforms.C:54
void maxShearDir(int N, const double *pMaxDir, const double *pMinDir, double *maxShearDir)
Returns the direction of maximum shear.
Definition: FFaTensorTransforms.C:309
void rotate2D(const double *inTensor, const double *rotMx, double *outTensor)
Coordinate transformation for a 2D tensor.
Definition: FFaTensorTransforms.C:335
void rotate(const double *inTensor, const double *eX, const double *eY, double *outTensor)
Coordinate transformation for a 2D tensor.
Definition: FFaTensorTransforms.C:348