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.
shape_deviatoric_plane_mcc_utilities.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: LlMonforte $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_DEVIATORIC_SHAPE_UTILITIES)
11 #define KRATOS_DEVIATORIC_SHAPE_UTILITIES
12 
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/define.h"
20 #include "includes/variables.h"
21 
23 
24 namespace Kratos
25 {
26 
27 
29  {
30 
31  public:
32 
34 
36 
37  typedef unsigned int IndexType;
38 
39  typedef unsigned int SizeType;
40 
41  static inline double & EvaluateEffectDueToThirdInvariant( double & rEffect, const double & rLodeAngle, const double & rFriction)
42  {
44 
45  rEffect = 1.0;
46  if ( rFriction < 1e-6)
47  return rEffect;
48 
49  double Friction = rFriction * Globals::Pi / 180.0;
50  double LodeCut = GetSmoothingLodeAngle( );
51  if ( fabs( rLodeAngle) < LodeCut)
52  {
53  rEffect = std::cos( rLodeAngle) - 1.0/sqrt(3.0) * std::sin(Friction) * std::sin(rLodeAngle);
54  } else {
55  double A, B;
56  GetSmoothingConstants(A, B, rLodeAngle, Friction);
57  rEffect = A + B*std::sin(3.0*rLodeAngle);
58  }
59  rEffect /= ( sqrt(3)/6) * (3.0 - std::sin(Friction) );
60  return rEffect;
61 
62  KRATOS_CATCH("")
63 
64  }
65 
66  protected:
67 
68  static inline void GetSmoothingConstants(double& rA, double& rB, const double& rLodeAngle, const double & rFriction)
69  {
70 
71 
72  double SmoothingAngle = GetSmoothingLodeAngle();
73 
74  double Sign = 1.0;
75  if ( rLodeAngle < 0.0)
76  Sign = -1.0;
77 
78  rA = 3.0 + std::tan(SmoothingAngle) * std::tan(3.0*SmoothingAngle) + Sign * (std::tan( 3.0*SmoothingAngle) - 3.0*std::tan(SmoothingAngle)) * std::sin( rFriction) / sqrt(3.0);
79  rA *= (1.0/3.0) * std::cos( SmoothingAngle );
80 
81  rB = -1.0 * ( Sign* std::sin(SmoothingAngle) + std::sin(rFriction)*std::cos(SmoothingAngle) / sqrt(3.0) ) / ( 3.0*std::cos(3.0*SmoothingAngle) );
82 
83 
84 
85  }
86 
87  static inline double GetSmoothingLodeAngle()
88  {
89  return 27.0*Globals::Pi/180.0;
90  }
91 
92 
93 
94  }; // end Class ShapeAtDeviatoricPlaneMCCUtility
95 
96 } // end namespace Kratos
97 
98 #endif // KRATOS_DEVIATORIC_SHAPE_UTILITIES
Definition: amatrix_interface.h:41
Definition: shape_deviatoric_plane_mcc_utilities.hpp:29
BoundedMatrix< double, 3, 3 > MatrixType
Definition: shape_deviatoric_plane_mcc_utilities.hpp:33
unsigned int IndexType
Definition: shape_deviatoric_plane_mcc_utilities.hpp:37
unsigned int SizeType
Definition: shape_deviatoric_plane_mcc_utilities.hpp:39
static double & EvaluateEffectDueToThirdInvariant(double &rEffect, const double &rLodeAngle, const double &rFriction)
Definition: shape_deviatoric_plane_mcc_utilities.hpp:41
array_1d< double, 6 > VectorType
Definition: shape_deviatoric_plane_mcc_utilities.hpp:35
static void GetSmoothingConstants(double &rA, double &rB, const double &rLodeAngle, const double &rFriction)
Definition: shape_deviatoric_plane_mcc_utilities.hpp:68
static double GetSmoothingLodeAngle()
Definition: shape_deviatoric_plane_mcc_utilities.hpp:87
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
constexpr double Pi
Definition: global_variables.h:25
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
A
Definition: sensitivityMatrix.py:70
B
Definition: sensitivityMatrix.py:76
e
Definition: run_cpp_mpi_tests.py:31