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.
constitutive_model.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosConstitutiveModelsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2017 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_CONSTITUTIVE_MODEL_H_INCLUDED )
11 #define KRATOS_CONSTITUTIVE_MODEL_H_INCLUDED
12 
13 // System includes
14 #include <string>
15 #include <iostream>
16 
17 // External includes
18 
19 // Project includes
21 
23 
24 namespace Kratos
25 {
28 
31 
35 
39 
43 
47 
49 
51  class KRATOS_API(CONSTITUTIVE_MODELS_APPLICATION) ConstitutiveModel
52  {
53  protected:
54 
55  using VoigtIndexType = const unsigned int(*)[2];
56 
57  public:
58 
59  //state flags
60  KRATOS_DEFINE_LOCAL_FLAG( ADD_HISTORY_VECTOR );
61  KRATOS_DEFINE_LOCAL_FLAG( HISTORY_STRAIN_MEASURE );
62  KRATOS_DEFINE_LOCAL_FLAG( HISTORY_STRESS_MEASURE );
63 
71 
74 
77 
81 
84 
86  ConstitutiveModel(ConstitutiveModel const& rOther);
87 
89  virtual ConstitutiveModel::Pointer Clone() const;
90 
93 
95  virtual ~ConstitutiveModel();
96 
97 
101 
102 
106 
110  virtual void InitializeMaterial(const Properties& rProperties);
111 
112 
116  virtual void InitializeModel(ModelDataType& rValues);
117 
121  virtual void FinalizeModel(ModelDataType& rValues);
122 
123 
127  virtual void CalculateStrainEnergy(ModelDataType& rValues, double& rDensityFunction);
128 
129 
133  virtual void CalculateStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix);
134 
135  virtual void CalculateIsochoricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix);
136 
137  virtual void CalculateVolumetricStressTensor(ModelDataType& rValues, MatrixType& rStressMatrix);
138 
139 
143  virtual void CalculateConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutive);
144 
145  virtual void CalculateIsochoricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutive);
146 
147  virtual void CalculateVolumetricConstitutiveTensor(ModelDataType& rValues, Matrix& rConstitutive);
148 
149 
153  virtual void CalculateStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutive);
154 
155  virtual void CalculateIsochoricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutive);
156 
157  virtual void CalculateVolumetricStressAndConstitutiveTensors(ModelDataType& rValues, MatrixType& rStressMatrix, Matrix& rConstitutive);
158 
159 
163  virtual int Check(const Properties& rProperties, const ProcessInfo& rCurrentProcessInfo);
164 
168 
172  virtual bool Has(const Variable<double>& rThisVariable);
173 
177  virtual void SetValue(const Variable<double>& rVariable, const double& rValue,
178  const ProcessInfo& rCurrentProcessInfo);
179 
180  virtual void SetValue(const Variable<Vector>& rThisVariable, const Vector& rValue,
181  const ProcessInfo& rCurrentProcessInfo);
182 
183  virtual void SetValue(const Variable<Matrix>& rThisVariable, const Matrix& rValue,
184  const ProcessInfo& rCurrentProcessInfo);
185 
189  virtual double& GetValue(const Variable<double>& rThisVariable, double& rValue);
190 
196  virtual void GetDomainVariablesList(std::vector<Variable<double> >& rScalarVariables,
197  std::vector<Variable<array_1d<double,3> > >& rComponentVariables);
198 
202 
203 
207 
209  virtual std::string Info() const
210  {
211  std::stringstream buffer;
212  buffer << "ConstitutiveModel";
213  return buffer.str();
214  }
215 
217  virtual void PrintInfo(std::ostream& rOStream) const
218  {
219  rOStream << "ConstitutiveModel";
220  }
221 
223  virtual void PrintData(std::ostream& rOStream) const
224  {
225  rOStream << "ConstitutiveModel Data";
226  }
227 
228 
232 
233 
235 
236  protected:
239 
240 
244 
246 
247  //initial or historical strains/stresses
249 
253 
254 
258 
259 
263 
264 
268 
269 
273 
274 
276 
277  private:
278 
281 
282 
286 
287 
291 
292 
296 
297 
301 
302 
306  friend class Serializer;
307 
308 
309  virtual void save(Serializer& rSerializer) const
310  {
311  rSerializer.save("mOptions",mOptions);
312  rSerializer.save("mHistoryVector",mHistoryVector);
313  }
314 
315  virtual void load(Serializer& rSerializer)
316  {
317  rSerializer.load("mOptions",mOptions);
318  rSerializer.load("mHistoryVector",mHistoryVector);
319  }
320 
324 
325 
329 
331 
332  }; // Class ConstitutiveModel
333 
335 
338 
339 
343 
345 
347 
348 } // namespace Kratos.
349 
350 #endif // KRATOS_CONSTITUTIVE_MODEL_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
StressMeasureType
Definition: constitutive_model_data.hpp:83
std::size_t SizeType
Definition: constitutive_model_data.hpp:60
StrainMeasureType
Definition: constitutive_model_data.hpp:75
Short class definition.
Definition: constitutive_model.hpp:52
virtual std::string Info() const
Turn back information as a string.
Definition: constitutive_model.hpp:209
ConstitutiveModelData::StressMeasureType StressMeasureType
Definition: constitutive_model.hpp:73
ConstitutiveModelData::StrainMeasureType StrainMeasureType
Definition: constitutive_model.hpp:72
const unsigned int(*)[2] VoigtIndexType
Definition: constitutive_model.hpp:55
ConstitutiveModelData::MatrixType MatrixType
Definition: constitutive_model.hpp:68
KRATOS_DEFINE_LOCAL_FLAG(HISTORY_STRESS_MEASURE)
Flags mOptions
Definition: constitutive_model.hpp:245
KRATOS_CLASS_POINTER_DEFINITION(ConstitutiveModel)
Pointer definition of ConstitutiveModel.
KRATOS_DEFINE_LOCAL_FLAG(ADD_HISTORY_VECTOR)
ConstitutiveModelData::VectorType VectorType
Definition: constitutive_model.hpp:67
KRATOS_DEFINE_LOCAL_FLAG(HISTORY_STRAIN_MEASURE)
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: constitutive_model.hpp:217
ConstitutiveModelData::ModelData ModelDataType
Definition: constitutive_model.hpp:69
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: constitutive_model.hpp:223
ConstitutiveModelData::SizeType SizeType
Definition: constitutive_model.hpp:66
VectorType mHistoryVector
Definition: constitutive_model.hpp:248
ConstitutiveModelData::MaterialData MaterialDataType
Definition: constitutive_model.hpp:70
Definition: flags.h:58
Definition: amatrix_interface.h:41
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
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
double CalculateStrainEnergy(Element &rElement)
Definition: mpm_energy_calculation_utility.cpp:89
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_model_data.hpp:92
Definition: constitutive_model_data.hpp:383