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.
nonlocal_cam_clay_model.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_NONLOCAL_CAM_CLAY_MODEL_H_INCLUDED )
11 #define KRATOS_NONLOCAL_CAM_CLAY_MODEL_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
22 
23 namespace Kratos
24 {
27 
30 
34 
38 
42 
46 
48 
50  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) NonlocalCamClayModel : public NonAssociativePlasticityModel<BorjaModel, ModifiedCamClayYieldSurface<CamClayHardeningRule> >
51  {
52  public:
53 
56 
57  //elasticity model
59  typedef ElasticityModelType::Pointer ElasticityModelPointer;
60 
61  //yield surface
64  typedef YieldSurfaceType::Pointer YieldSurfacePointer;
65 
66  //base type
68 
69  //common types
70  typedef BaseType::Pointer BaseTypePointer;
78 
79 
82 
86 
89 
92 
95  {
96  BaseType::operator=(rOther);
97  return *this;
98  }
99 
101  ConstitutiveModel::Pointer Clone() const override
102  {
103  return Kratos::make_shared<NonlocalCamClayModel>(*this);
104  }
105 
107  ~NonlocalCamClayModel() override {}
108 
109 
113 
114 
118  //*******************************************************************************
119  //*******************************************************************************
120  // Calculate Stress and constitutive tensor
121  void CalculateStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutiveMatrix) override
122  {
123  KRATOS_TRY
124 
125  double LocalPlasticStrain = mInternal.Variables[1];
126  double NonLocalPlasticStrain = mInternal.Variables[4];
127  mInternal.Variables[1] = mInternal.Variables[4];
128 
129  NonAssociativePlasticityModel::CalculateStressAndConstitutiveTensors( rValues, rStressMatrix, rConstitutiveMatrix);
130 
131  if ( rValues.State.Is(ConstitutiveModelData::UPDATE_INTERNAL_VARIABLES) ) {
132  mInternal.Variables[1] = LocalPlasticStrain + ( mInternal.Variables[1] - NonLocalPlasticStrain);
133  } else {
134  mInternal.Variables[1] = LocalPlasticStrain;
135  }
136 
137  KRATOS_CATCH("")
138  }
139 
143  int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo) override
144  {
145  KRATOS_TRY
146 
147  //LMV: to be implemented. but should not enter in the base one
148 
149  return 0;
150 
151  KRATOS_CATCH("")
152  }
153 
157 
161  bool Has(const Variable<double>& rThisVariable) override
162  {
163  if(rThisVariable == PLASTIC_STRAIN || rThisVariable == DELTA_PLASTIC_STRAIN )
164  return true;
165 
166  return false;
167  }
168 
169 
173  double& GetValue(const Variable<double>& rThisVariable, double& rValue) override
174  {
175 
176  rValue=0;
177 
178  if (rThisVariable==PLASTIC_STRAIN)
179  {
180  rValue = this->mInternal.Variables[0];
181  }
182 
183 
184  else if (rThisVariable==DELTA_PLASTIC_STRAIN)
185  {
186  rValue = this->mInternal.Variables[0]-mPreviousInternal.Variables[0];
187  }
188 
189  else if (rThisVariable==PRE_CONSOLIDATION_STRESS)
190  {
191  rValue = this->mInternal.Variables[3];
192  }
193 
194  else {
195  rValue = NonAssociativePlasticityModel::GetValue( rThisVariable, rValue);
196  }
197  return rValue;
198  }
199 
203  void SetValue(const Variable<double>& rVariable,
204  const double& rValue,
205  const ProcessInfo& rCurrentProcessInfo) override
206  {
207  KRATOS_TRY
208 
209  if ( rVariable == NONLOCAL_PLASTIC_VOL_DEF) {
210  mInternal.Variables[4] = rValue;
211  }
212 
213  KRATOS_CATCH("")
214  }
218 
219 
223 
225  std::string Info() const override
226  {
227  std::stringstream buffer;
228  buffer << "NonlocalCamClayModel" ;
229  return buffer.str();
230  }
231 
233  void PrintInfo(std::ostream& rOStream) const override
234  {
235  rOStream << "NonlocalCamClayModel";
236  }
237 
239  void PrintData(std::ostream& rOStream) const override
240  {
241  rOStream << "NonlocalCamClayModel Data";
242  }
243 
244 
248 
249 
251 
252  protected:
255 
256 
260 
264 
265 
269 
270 
274 
275 
279 
280 
284 
285 
287 
288  private:
291 
292 
296 
297 
301 
302 
306 
307 
311 
312 
316 
317 
321  friend class Serializer;
322 
323  void save(Serializer& rSerializer) const override
324  {
326  }
327 
328  void load(Serializer& rSerializer) override
329  {
330  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType )
331  }
332 
336 
337 
339 
340  }; // Class NonlocalCamClayModel
341 
343 
346 
347 
351 
352 
356 
357 
359 
361 
362 
363 } // namespace Kratos.
364 
365 #endif // KRATOS_CAM_CLAY_MODEL_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: borja_model.hpp:48
Short class definition.
Definition: cam_clay_hardening_rule.hpp:48
bool Is(Flags const &rOther) const
Definition: flags.h:274
Definition: amatrix_interface.h:41
Short class definition.
Definition: modified_cam_clay_yield_surface.hpp:51
Short class definition.
Definition: non_associative_plasticity_model.hpp:63
void CalculateStressAndConstitutiveTensors(ModelDataType &rValues, MatrixType &rStressMatrix, Matrix &rConstitutiveMatrix) override
Definition: non_associative_plasticity_model.hpp:222
BaseType::InternalVariablesType InternalVariablesType
Definition: non_associative_plasticity_model.hpp:87
BaseType::VoigtIndexType VoigtIndexType
Definition: non_associative_plasticity_model.hpp:81
virtual double & GetValue(const Variable< double > &rThisVariable, double &rValue) override
Definition: non_associative_plasticity_model.hpp:139
BaseType::SizeType SizeType
Definition: non_associative_plasticity_model.hpp:80
BaseType::PlasticDataType PlasticDataType
Definition: non_associative_plasticity_model.hpp:86
Short class definition.
Definition: nonlocal_cam_clay_model.hpp:51
double & GetValue(const Variable< double > &rThisVariable, double &rValue) override
Definition: nonlocal_cam_clay_model.hpp:173
BaseType::SizeType SizeType
Definition: nonlocal_cam_clay_model.hpp:71
BaseType::MaterialDataType MaterialDataType
Definition: nonlocal_cam_clay_model.hpp:75
BaseType::PlasticDataType PlasticDataType
Definition: nonlocal_cam_clay_model.hpp:76
void CalculateStressAndConstitutiveTensors(ModelDataType &rValues, MatrixType &rStressMatrix, Matrix &rConstitutiveMatrix) override
Definition: nonlocal_cam_clay_model.hpp:121
void SetValue(const Variable< double > &rVariable, const double &rValue, const ProcessInfo &rCurrentProcessInfo) override
Definition: nonlocal_cam_clay_model.hpp:203
BaseType::MatrixType MatrixType
Definition: nonlocal_cam_clay_model.hpp:73
BaseType::ModelDataType ModelDataType
Definition: nonlocal_cam_clay_model.hpp:74
KRATOS_CLASS_POINTER_DEFINITION(NonlocalCamClayModel)
Pointer definition of NonlocalCamClayModel.
ConstitutiveModel::Pointer Clone() const override
Clone.
Definition: nonlocal_cam_clay_model.hpp:101
NonlocalCamClayModel & operator=(NonlocalCamClayModel const &rOther)
Assignment operator.
Definition: nonlocal_cam_clay_model.hpp:94
NonlocalCamClayModel()
Default constructor.
Definition: nonlocal_cam_clay_model.hpp:88
BaseType::VoigtIndexType VoigtIndexType
Definition: nonlocal_cam_clay_model.hpp:72
ElasticityModelType::Pointer ElasticityModelPointer
Definition: nonlocal_cam_clay_model.hpp:59
int Check(const Properties &rProperties, const ProcessInfo &rCurrentProcessInfo) override
Definition: nonlocal_cam_clay_model.hpp:143
NonlocalCamClayModel(NonlocalCamClayModel const &rOther)
Copy constructor.
Definition: nonlocal_cam_clay_model.hpp:91
NonAssociativePlasticityModel< ElasticityModelType, YieldSurfaceType > BaseType
Definition: nonlocal_cam_clay_model.hpp:67
ModifiedCamClayYieldSurface< HardeningRuleType > YieldSurfaceType
Definition: nonlocal_cam_clay_model.hpp:63
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: nonlocal_cam_clay_model.hpp:233
BaseType::Pointer BaseTypePointer
Definition: nonlocal_cam_clay_model.hpp:70
CamClayHardeningRule HardeningRuleType
Definition: nonlocal_cam_clay_model.hpp:62
bool Has(const Variable< double > &rThisVariable) override
Definition: nonlocal_cam_clay_model.hpp:161
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: nonlocal_cam_clay_model.hpp:239
~NonlocalCamClayModel() override
Destructor.
Definition: nonlocal_cam_clay_model.hpp:107
std::string Info() const override
Turn back information as a string.
Definition: nonlocal_cam_clay_model.hpp:225
YieldSurfaceType::Pointer YieldSurfacePointer
Definition: nonlocal_cam_clay_model.hpp:64
BorjaModel ElasticityModelType
Definition: nonlocal_cam_clay_model.hpp:58
BaseType::InternalVariablesType InternalVariablesType
Definition: nonlocal_cam_clay_model.hpp:77
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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
#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
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_model_data.hpp:92
Definition: constitutive_model_data.hpp:383
Flags State
Definition: constitutive_model_data.hpp:399