KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
deviatoric_plane_shape.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosSolidMechanicsApplication $
3 // Last modified by: $Author: LMonforte $
4 // Date: $Date: July 2015 $
5 // Revision: $Revision: 0.1 $
6 //
7 //
8 
9 #if !defined(KRATOS_DEVIATORIC_SHAPE_UTILITIES)
10 #define KRATOS_DEVIATORIC_SHAPE_UTILITIES
11 #define PI 3.1415926535898
12 
13 /*#ifdef FIND_MAX
14 #undef FIND_MAX
15 #endif
16 
17 #define FIND_MAX(a, b) ((a)>(b)?(a):(b))
18 */
19 
20 
21 // System includes
22 #include <cmath>
23 #include <set>
24 
25 
26 // External includes
27 #include "boost/smart_ptr.hpp"
28 
29 // Project includes
30 #include "includes/define.h"
31 #include "includes/variables.h"
32 #include "utilities/math_utils.h"
33 
34 namespace Kratos
35 {
36 
37 
38  class KRATOS_API(PFEM_SOLID_MECHANICS_APPLICATION) DeviatoricPlaneShapeUtilities
39  {
40 
41  public:
42 
43  typedef Matrix MatrixType;
44 
45  typedef Vector VectorType;
46 
47  typedef unsigned int IndexType;
48 
49  typedef unsigned int SizeType;
50 
51  void CalculateThirdInvariantShape( const double & rLodeAngle, const double& rFriction, const double& rSmoothingAngle, double & rEffect )
52  {
53 
54  if ( fabs( rLodeAngle) < rSmoothingAngle)
55  {
56  rEffect = std::cos ( rLodeAngle) - 1.0/sqrt(3.0) * std::sin( rLodeAngle) * std::sin( rFrictionAngle) ;
57  }
58  else
59  {
60  double A, B, C;
61  ComputeSmoothingConstants( rLodeAngle, rSmoothingAngle, rFrictionAngle, A, B, C);
62  double sin = std::sin( 3.0 * rLodeAngle);
63 
64  rEffect = A + B * sin + C * sin * sin;
65 
66  }
67 
68 
69  }
70  void CalculateThirdInvariantShapeAddim( const double & rLodeAngle, const double& rFriction, const double& rSmoothingAngle, double & rEffect )
71  {
72  CalculateThirdInvariantShapeAddim( rLodeAngle, rFriction, rSmoothingAngle, rEffect);
73  rEffect /= sqrt(3.0) /6.0 * (3.0 - std::sin( rFriction) );
74  }
75 
76  protected:
77 
78  ComputeSmoothingConstants( rLodeAngle, rSmoothingAngle, rFrictionAngle, A, B, C)
79  {
80  double sign = 1.0;
81  if ( rLodeAngle < 0)
82  sign = 1.0;
83 
84  double tan = std::tan(rSmoothingAngle);
85  double tan3 = std::tan(3.0rSmoothingAngle);
86  double sin = std::sin(rSmoothingAngle);
87  double sin6 = std::sin(6.0rSmoothingAngle);
88  double cos = std::cos(rSmoothingAngle);
89  double cos3 = std::cos(3.0*rSmoothingAngle);
90  double cos6 = std::cos(6.0*rSmoothingAngle);
91 
92  double denom = 18.0 * pow(cos3, 3.0);
93 
94  double B1, B2;
95 
96  B1 = cos * sin6 - 6.0 * cos6 * sin;
97  B2 = - ( sin * sin6 + 6 * cos6 * cos);
98 
99  B1 /= denom;
100  B2 /= denom * sqrt(3.0);
101 
102  B = B1 * sign + B2 * std::sin( rFrictionAngle);
103 
104  double C1 = - cos3*cos - 3.0*sin3 * sin;
105  double C2 = cos3 * sin - 3.0*sin3 * cos;
106 
107  C1 /= denom;
108  C2 /= denom * sqrt(3.0);
109  C = C1 + C2 * sign * std::sin(rFrictionAngle);
110 
111 
112  double A1, A2;
113  A1 = cos - B1*sin3 - C1 *sin3 * sin3;
114  A2 = -1.0/sqrt(3.0) * sin - B2 * sin3 + C2 * sin3 * sin3;
115 
116  A = A1 + A2 *sign * std::( rFrictionAngle);
117 
118  }
119 
120 
121 
122  }; // end Class DeviatoricPlaneShapeUtilities
123 
124 } // end ramespace Kratos
125 
126 #endif // KRATOS_DEVIATORIC_SHAPE
127 
Definition: deviatoric_plane_shape.hpp:39
Matrix MatrixType
Definition: deviatoric_plane_shape.hpp:43
void CalculateThirdInvariantShape(const double &rLodeAngle, const double &rFriction, const double &rSmoothingAngle, double &rEffect)
Definition: deviatoric_plane_shape.hpp:51
unsigned int IndexType
Definition: deviatoric_plane_shape.hpp:47
Vector VectorType
Definition: deviatoric_plane_shape.hpp:45
ComputeSmoothingConstants(rLodeAngle, rSmoothingAngle, rFrictionAngle, A, B, C)
Definition: deviatoric_plane_shape.hpp:78
unsigned int SizeType
Definition: deviatoric_plane_shape.hpp:49
void CalculateThirdInvariantShapeAddim(const double &rLodeAngle, const double &rFriction, const double &rSmoothingAngle, double &rEffect)
Definition: deviatoric_plane_shape.hpp:70
static int sign(const double a)
Definition: GeometryFunctions.h:61
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int C
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:27
A
Definition: sensitivityMatrix.py:70
B
Definition: sensitivityMatrix.py:76
namespace
Definition: array_1d.h:793