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.
gens_nova_yield_surface.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: LMonforte $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_GENS_NOVA_YIELD_SURFACE_H_INCLUDED )
11 #define KRATOS_GENS_NOVA_YIELD_SURFACE_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
19 #include "custom_utilities/stress_invariants_utilities.hpp"
21 
22 namespace Kratos
23 {
26 
29 
33 
37 
41 
45 
47 
49  template<class THardeningRule>
50  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) GensNovaYieldSurface : public YieldSurface<THardeningRule>
51  {
52  public:
53 
56 
61 
63  typedef typename BaseType::Pointer BaseTypePointer;
65 
68 
72 
75 
78 
79 
82  {
83  BaseType::operator=(rOther);
84  return *this;
85  }
86 
88  virtual BaseTypePointer Clone() const override
89  {
90  return BaseTypePointer(new GensNovaYieldSurface(*this));
91  }
92 
94  virtual ~GensNovaYieldSurface() {}
95 
96 
100 
101 
105 
110  virtual double& CalculateYieldCondition(const PlasticDataType& rVariables, double & rYieldCondition) override
111  {
112  KRATOS_TRY
113 
114  const ModelDataType & rModelData = rVariables.GetModelData();
115  const MatrixType & rStressMatrix = rModelData.GetStressMatrix();
116 
117  const double & rPT = rVariables.Internal.Variables[4];
118  const double & rPCstar = rVariables.Internal.Variables[5];
119 
120  // Perform the stress translation
121  MatrixType StressTranslated;
122  PerformStressTranslation( rStressMatrix, StressTranslated, rPT);
123 
124  // Material Parameters
125  const Properties& rMaterialProperties = rModelData.GetProperties();
126  const double& rShearM = rMaterialProperties[CRITICAL_STATE_LINE];
127  //const double & rFriction = rMaterialProperties[INTERNAL_FRICTION_ANGLE];
128 
129  double MeanStress, LodeAngle;
130  double DeviatoricQ; // == sqrt(3)*J2
131 
132  // more work is requiered
133  StressInvariantsUtilities::CalculateStressInvariants( StressTranslated, MeanStress, DeviatoricQ, LodeAngle);
134  DeviatoricQ *= sqrt(3.0);
135 
136  rYieldCondition = pow( DeviatoricQ/rShearM, 2);
137  rYieldCondition += (MeanStress * (MeanStress - rPCstar) );
138 
139 
140  //std::cout << " yield funciton: p " << MeanStress << " q: " << DeviatoricQ << " pcSTAR " << rPCstar << " yield value " << rYieldCondition << std::endl;
141  //std::cout << " stressMatrix " << rStressMatrix << " translated " << StressTranslated << " and " << rPT << std::endl;
142  return rYieldCondition;
143 
144  KRATOS_CATCH(" ")
145  }
146 
147  //*************************************************************************************
148  //*************************************************************************************
149  // evaluation of the derivative of the yield surface respect the stresses
150  virtual VectorType& CalculateDeltaStressYieldCondition(const PlasticDataType& rVariables, VectorType& rDeltaStressYieldCondition) override
151  {
152  KRATOS_TRY
153 
154  const ModelDataType & rModelData = rVariables.GetModelData();
155  const MatrixType & rStressMatrix = rModelData.GetStressMatrix();
156 
157  const double & rPT = rVariables.Internal.Variables[4];
158  const double & rPCstar = rVariables.Internal.Variables[5];
159 
160  // Perform the stress translation
161  MatrixType StressTranslated;
162  PerformStressTranslation( rStressMatrix, StressTranslated, rPT);
163 
164  // Material Parameters
165  const Properties& rMaterialProperties = rModelData.GetProperties();
166  const double& rShearM = rMaterialProperties[CRITICAL_STATE_LINE];
167 
168 
169 
170  double MeanStress, J2, LodeAngle;
171 
172  VectorType V1, V2;
173  // more work is requiered
174  StressInvariantsUtilities::CalculateStressInvariants( StressTranslated, MeanStress, J2, LodeAngle);
176 
177  rDeltaStressYieldCondition = ( 2.0*MeanStress - rPCstar) * V1 + 2.0 * 3.0 * pow( 1.0 / rShearM, 2) * J2 * V2;
178 
179  return rDeltaStressYieldCondition;
180 
181  KRATOS_CATCH(" ")
182  }
183 
184 
188 
189 
193 
194 
198 
199 
201  virtual std::string Info() const override
202  {
203  std::stringstream buffer;
204  buffer << "GensNovaYieldSurface" ;
205  return buffer.str();
206  }
207 
209  virtual void PrintInfo(std::ostream& rOStream) const override
210  {
211  rOStream << "GensNovaYieldSurface";
212  }
213 
215  virtual void PrintData(std::ostream& rOStream) const override
216  {
217  rOStream << "GensNovaYieldSurface Data";
218  }
219 
220 
224 
225 
227 
228  protected:
231 
232 
236 
237 
241 
242 
246 
247 
248  void PerformStressTranslation( const MatrixType & rStressMatrix, MatrixType & rStressTranslated, const double & rTranslation)
249  {
250  KRATOS_TRY
251 
252  rStressTranslated.clear();
253  rStressTranslated = rStressMatrix;
254  for (unsigned int i = 0; i < 3; i++)
255  rStressTranslated(i,i) += rTranslation;
256 
257  KRATOS_CATCH("")
258  }
259 
260 
264 
265 
269 
270 
274 
275 
277 
278  private:
281 
282 
286 
287 
291 
292 
296 
297 
301 
302 
306  friend class Serializer;
307 
308 
309  virtual void save(Serializer& rSerializer) const override
310  {
312  }
313 
314  virtual void load(Serializer& rSerializer) override
315  {
316  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType )
317  }
318 
322 
323 
327 
329 
330  }; // Class GensNovaYieldSurface
331 
333 
336 
337 
341 
342 
344 
346 
347 } // namespace Kratos.
348 
349 #endif // KRATOS_GENS_NOVA_YIELD_SURFACE_H_INCLUDED defined
350 
351 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: gens_nova_yield_surface.hpp:51
GensNovaYieldSurface & operator=(GensNovaYieldSurface const &rOther)
Assignment operator.
Definition: gens_nova_yield_surface.hpp:81
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: gens_nova_yield_surface.hpp:215
virtual std::string Info() const override
Turn back information as a string.
Definition: gens_nova_yield_surface.hpp:201
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: gens_nova_yield_surface.hpp:209
virtual VectorType & CalculateDeltaStressYieldCondition(const PlasticDataType &rVariables, VectorType &rDeltaStressYieldCondition) override
Definition: gens_nova_yield_surface.hpp:150
KRATOS_CLASS_POINTER_DEFINITION(GensNovaYieldSurface)
Pointer definition of GensNovaYieldSurface.
ConstitutiveModelData::VectorType VectorType
Definition: gens_nova_yield_surface.hpp:58
virtual BaseTypePointer Clone() const override
Clone.
Definition: gens_nova_yield_surface.hpp:88
GensNovaYieldSurface(GensNovaYieldSurface const &rOther)
Copy constructor.
Definition: gens_nova_yield_surface.hpp:77
virtual ~GensNovaYieldSurface()
Destructor.
Definition: gens_nova_yield_surface.hpp:94
ConstitutiveModelData::MaterialData MaterialDataType
Definition: gens_nova_yield_surface.hpp:60
BaseType::PlasticDataType PlasticDataType
Definition: gens_nova_yield_surface.hpp:64
ConstitutiveModelData::MatrixType MatrixType
Definition: gens_nova_yield_surface.hpp:57
virtual double & CalculateYieldCondition(const PlasticDataType &rVariables, double &rYieldCondition) override
Definition: gens_nova_yield_surface.hpp:110
ConstitutiveModelData::ModelData ModelDataType
Definition: gens_nova_yield_surface.hpp:59
BaseType::Pointer BaseTypePointer
Definition: gens_nova_yield_surface.hpp:63
YieldSurface< THardeningRule > BaseType
Definition: gens_nova_yield_surface.hpp:62
void PerformStressTranslation(const MatrixType &rStressMatrix, MatrixType &rStressTranslated, const double &rTranslation)
Definition: gens_nova_yield_surface.hpp:248
GensNovaYieldSurface()
Default constructor.
Definition: gens_nova_yield_surface.hpp:74
Definition: amatrix_interface.h:41
void clear()
Definition: amatrix_interface.h:284
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
static void CalculateStressInvariants(const MatrixType &rStressMatrix, double &rI1, double &rJ2)
Definition: stress_invariants_utilities.hpp:45
static void CalculateDerivativeVectors(const MatrixType &rStressMatrix, VectorType &C1, VectorType &C2)
Definition: stress_invariants_utilities.hpp:101
Short class definition.
Definition: yield_surface.hpp:50
THardeningRule::PlasticDataType PlasticDataType
Definition: yield_surface.hpp:62
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
float LodeAngle
Definition: isotropic_damage_automatic_differentiation.py:181
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17
Definition: constitutive_model_data.hpp:92
Definition: constitutive_model_data.hpp:383