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.
particle_hardening_law.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Bodhinanda Chandra
11 //
12 // References: This class is adapted from applications/SolidMechanicsApplication/custom_constitutive/custom_hardening_laws/hardening_law.hpp
13 
14 
15 #if !defined(KRATOS_MPM_HARDENING_LAW_H_INCLUDED)
16 #define KRATOS_MPM_HARDENING_LAW_H_INCLUDED
17 
18 // System includes
19 #include <string>
20 #include <iostream>
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
26 #include "includes/properties.h"
27 #include "input_output/logger.h"
28 
29 
30 namespace Kratos
31 {
34 
37 
41 
45 
49 
53 
55 
57 class KRATOS_API(PARTICLE_MECHANICS_APPLICATION) ParticleHardeningLaw
58 {
59 public:
60 
61  struct Parameters
62  {
63  private:
64 
65  double mRateFactor;
66 
67  const double* mpDeltaTime;
68 
69  public:
70 
71  //Set Parameters
72  void SetRateFactor (double rRateFactor) { mRateFactor = rRateFactor; };
73  void SetDeltaTime (const double& rDeltaTime) { mpDeltaTime = &rDeltaTime; };
74 
75  //Get Parameters
76  const double& GetRateFactor () const { return mRateFactor; };
77  const double& GetDeltaTime () const { return *mpDeltaTime; };
78 
79  void print() const
80  {
81  KRATOS_INFO("ParticleHardeningLaw.Parameters") << " RateFactor " << mRateFactor << std::endl;
82  KRATOS_INFO("ParticleHardeningLaw.Parameters") << " DeltaTime " << *mpDeltaTime << std::endl;
83  }
84 
85  };
86 
89 
90  typedef const Properties* PropertiesPointer;
91 
92 
95 
99 
102 
105  {};
106 
109  {
110  return *this;
111  };
112 
114  virtual ~ParticleHardeningLaw() {};
115 
116 
120 
125  virtual ParticleHardeningLaw::Pointer Clone() const
126  {
127  return Kratos::make_shared<ParticleHardeningLaw>(*this);
128  }
129 
130 
131  /*
132  * @brief This function return the hardening constant at given hardening parameters
133  * @param[in/out] rHardening Hardening value
134  * @param[in] rValues Hardening parameters
135  * @param[in] rAlpha Hardening parameters
136  * @param[in] rBeta Hardening parameters
137  * @param[in] rThisVariable Identifier variables
138  * @return Value of Hardening
139  */
140  virtual double& CalculateHardening(double &rHardening, const Parameters& rValues, const Properties& rProperties){ return rHardening; };
141 
142  virtual double& CalculateHardening(double &rHardening, const double& rAlpha, const double& rBeta, const Properties& rProperties) {return rHardening; };
143 
144  virtual double& CalculateHardening(double &rHardening, const double& rAlpha, const Variable<double>& rThisVariable, const Properties& rProperties) {return rHardening;};
145 
149 
150 
154 
155 
159 
160 
164 
165 
167 
168 protected:
171 
172 
176 
178 
182 
186 
187 
191 
192 
196 
197 
201 
202 
204 
205 private:
208 
209 
213 
214 
218 
219 
223 
224 
228 
229 
233  friend class Serializer;
234 
235  // A private default constructor necessary for serialization
236 
237  virtual void save(Serializer& rSerializer) const
238  {
239  };
240 
241  virtual void load(Serializer& rSerializer)
242  {
243  };
244 
248 
249 
253 
255 
256 }; // Class ParticleHardeningLaw
257 
259 
262 
263 
267 
268 
269 // /// input stream function
270 // inline std::istream& operator >> (std::istream& rIStream,
271 // ParticleHardeningLaw& rThis);
272 
273 // /// output stream function
274 // inline std::ostream& operator << (std::ostream& rOStream,
275 // const ParticleHardeningLaw& rThis)
276 // {
277 // rThis.PrintInfo(rOStream);
278 // rOStream << std::endl;
279 // rThis.PrintData(rOStream);
280 
281 // return rOStream;
282 // }
284 
286 
287 } // namespace Kratos.
288 
289 #endif // KRATOS_MPM_HARDENING_LAW_H_INCLUDED defined
Short class definition.
Definition: particle_hardening_law.hpp:58
virtual double & CalculateHardening(double &rHardening, const double &rAlpha, const Variable< double > &rThisVariable, const Properties &rProperties)
Definition: particle_hardening_law.hpp:144
PropertiesPointer mpProperties
Definition: particle_hardening_law.hpp:177
ParticleHardeningLaw & operator=(ParticleHardeningLaw const &rOther)
Assignment operator.
Definition: particle_hardening_law.hpp:108
const Properties * PropertiesPointer
Definition: particle_hardening_law.hpp:90
KRATOS_CLASS_POINTER_DEFINITION(ParticleHardeningLaw)
Pointer definition of ParticleHardeningLaw.
ParticleHardeningLaw(ParticleHardeningLaw const &rOther)
Copy constructor.
Definition: particle_hardening_law.hpp:104
virtual ParticleHardeningLaw::Pointer Clone() const
Definition: particle_hardening_law.hpp:125
virtual double & CalculateHardening(double &rHardening, const double &rAlpha, const double &rBeta, const Properties &rProperties)
Definition: particle_hardening_law.hpp:142
virtual ~ParticleHardeningLaw()
Destructor.
Definition: particle_hardening_law.hpp:114
ParticleHardeningLaw()
Default constructor.
Definition: particle_hardening_law.hpp:101
virtual double & CalculateHardening(double &rHardening, const Parameters &rValues, const Properties &rProperties)
Definition: particle_hardening_law.hpp:140
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_INFO(label)
Definition: logger.h:250
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307
Definition: particle_hardening_law.hpp:62
void SetRateFactor(double rRateFactor)
Definition: particle_hardening_law.hpp:72
void SetDeltaTime(const double &rDeltaTime)
Definition: particle_hardening_law.hpp:73
const double & GetDeltaTime() const
Definition: particle_hardening_law.hpp:77
const double & GetRateFactor() const
Definition: particle_hardening_law.hpp:76
void print() const
Definition: particle_hardening_law.hpp:79