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.
mpm_particle_penalty_dirichlet_condition.h
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 
13 
14 // System includes
15 #if !defined(KRATOS_MPM_PARTICLE_PENALTY_DIRICHLET_CONDITION_H_INCLUDED )
16 #define KRATOS_MPM_PARTICLE_PENALTY_DIRICHLET_CONDITION_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
26 
27 namespace Kratos
28 {
29 
32 
36 
40 
44 
48 
50 
55 {
56 public:
59 
62 
65 
69 
72  IndexType NewId,
73  GeometryType::Pointer pGeometry
74  );
75 
77  IndexType NewId,
78  GeometryType::Pointer pGeometry,
79  PropertiesType::Pointer pProperties
80  );
81 
84 
88 
93  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
94 
99  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
100 
104  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
105 
106 
111  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
112 
116 
117  Condition::Pointer Create(
118  IndexType NewId,
119  GeometryType::Pointer pGeometry,
120  PropertiesType::Pointer pProperties
121  ) const override;
122 
123  Condition::Pointer Create(
124  IndexType NewId,
125  NodesArrayType const& ThisNodes,
126  PropertiesType::Pointer pProperties
127  ) const override;
128 
129 
133 
134  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
135  std::vector<double>& rValues,
136  const ProcessInfo& rCurrentProcessInfo) override;
137 
141 
142  void SetValuesOnIntegrationPoints(const Variable<double>& rVariable,
143  const std::vector<double>& rValues,
144  const ProcessInfo& rCurrentProcessInfo) override;
145 
147 
148 protected:
151 
152  double m_penalty = 0.0;
153 
157 
158 
162 
171  void CalculateAll(
172  MatrixType& rLeftHandSideMatrix,
173  VectorType& rRightHandSideVector,
174  const ProcessInfo& rCurrentProcessInfo,
175  bool CalculateStiffnessMatrixFlag,
176  bool CalculateResidualVectorFlag
177  ) override;
178 
182 
186  virtual void CalculateInterfaceContactForce(const ProcessInfo& rCurrentProcessInfo );
187 
188 
192 
193  // A protected default constructor necessary for serialization
195 
197 
198 private:
201 
205 
209 
213 
214 
218 
219 
223 
227 
228  friend class Serializer;
229 
230  void save( Serializer& rSerializer ) const override
231  {
233  rSerializer.save("penalty", m_penalty);
234  }
235 
236  void load( Serializer& rSerializer ) override
237  {
239  rSerializer.load("penalty", m_penalty);
240  }
241 
242 
243 }; // Class MPMParticlePenaltyDirichletCondition
244 
248 
249 
253 
254 } // namespace Kratos.
255 
256 #endif // KRATOS_MPM_PARTICLE_PENALTY_DIRICHLET_CONDITION_H_INCLUDED defined
257 
258 
std::size_t IndexType
Definition: flags.h:74
Definition: mpm_particle_base_dirichlet_condition.h:50
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_base_condition.cpp:303
void SetValuesOnIntegrationPoints(const Variable< double > &rVariable, const std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_base_condition.cpp:346
Short class definition.
Definition: mpm_particle_penalty_dirichlet_condition.h:55
MPMParticlePenaltyDirichletCondition()
Definition: mpm_particle_penalty_dirichlet_condition.h:194
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) const override
It creates a new condition pointer.
Definition: mpm_particle_penalty_dirichlet_condition.cpp:47
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, std::vector< array_1d< double, 3 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_base_dirichlet_condition.cpp:69
double m_penalty
Definition: mpm_particle_penalty_dirichlet_condition.h:152
virtual void CalculateInterfaceContactForce(const ProcessInfo &rCurrentProcessInfo)
Definition: mpm_particle_penalty_dirichlet_condition.cpp:284
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo, bool CalculateStiffnessMatrixFlag, bool CalculateResidualVectorFlag) override
Definition: mpm_particle_penalty_dirichlet_condition.cpp:113
void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, const std::vector< array_1d< double, 3 > > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_base_dirichlet_condition.cpp:95
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MPMParticlePenaltyDirichletCondition)
Counted pointer of MPMParticlePenaltyDirichletCondition.
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_penalty_dirichlet_condition.cpp:96
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_penalty_dirichlet_condition.cpp:70
void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_penalty_dirichlet_condition.cpp:221
~MPMParticlePenaltyDirichletCondition() override
Destructor.
Definition: mpm_particle_penalty_dirichlet_condition.cpp:63
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: mpm_particle_penalty_dirichlet_condition.cpp:257
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#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