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.
displacement_control_condition.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Mahmoud Zidan
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/condition.h"
20 
21 namespace Kratos
22 {
23 
26 
30 
34 
38 
42 
50 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) DisplacementControlCondition
51  : public Condition
52 {
53 public:
54 
57 
65 
67  static constexpr double ZeroTolerance = std::numeric_limits<double>::epsilon();
68 
69  // Counted pointer of DisplacementControlCondition
71 
75 
76  // Constructor void
78 
79  // Constructor using an array of nodes
80  DisplacementControlCondition( IndexType NewId, const NodesArrayType& rThisNodes);
81  DisplacementControlCondition( IndexType NewId, GeometryType::Pointer pGeometry );
82 
83  // Constructor using an array of nodes with properties
84  DisplacementControlCondition( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties );
85 
88 
89  // Destructor
90  ~DisplacementControlCondition() override;
91 
95 
98 
102 
110  Condition::Pointer Create(
111  IndexType NewId,
112  NodesArrayType const& rThisNodes,
113  PropertiesType::Pointer pProperties
114  ) const override;
115 
123  Condition::Pointer Create(
124  IndexType NewId,
125  GeometryType::Pointer pGeom,
126  PropertiesType::Pointer pProperties
127  ) const override;
128 
135  Condition::Pointer Clone (
136  IndexType NewId,
137  NodesArrayType const& rThisNodes
138  ) const override;
139 
145  void EquationIdVector(
146  EquationIdVectorType& rResult,
147  const ProcessInfo& rCurrentProcessInfo
148  ) const override;
149 
155  void GetDofList(
156  DofsVectorType& rElementalDofList,
157  const ProcessInfo& rCurrentProcessInfo
158  ) const override;
159 
165  void GetValuesVector(
166  Vector& rValues,
167  int Step = 0
168  ) const override;
169 
178  void CalculateLocalSystem(
179  MatrixType& rLeftHandSideMatrix,
180  VectorType& rRightHandSideVector,
181  const ProcessInfo& rCurrentProcessInfo
182  ) override;
183 
189  void CalculateRightHandSide(
190  VectorType& rRightHandSideVector,
191  const ProcessInfo& rCurrentProcessInfo
192  ) override;
193 
199  void CalculateMassMatrix(
200  MatrixType& rMassMatrix,
201  const ProcessInfo& rCurrentProcessInfo
202  ) override;
203 
209  void CalculateDampingMatrix(
210  MatrixType& rDampingMatrix,
211  const ProcessInfo& rCurrentProcessInfo
212  ) override;
213 
219  int Check( const ProcessInfo& rCurrentProcessInfo ) const override;
220 
225  unsigned int GetBlockSize() const
226  {
227  return 2;
228  }
229 
233 
237 
241 
242  const Parameters GetSpecifications() const override;
243 
245  std::string Info() const override
246  {
247  std::stringstream buffer;
248  buffer << "Displacement Control Condition #" << Id();
249  return buffer.str();
250  }
251 
253 
254  void PrintInfo(std::ostream& rOStream) const override
255  {
256  rOStream << "Displacement Control Condition #" << Id();
257  }
258 
260  void PrintData(std::ostream& rOStream) const override
261  {
262  pGetGeometry()->PrintData(rOStream);
263  }
264 
268 
269 protected:
270 
273 
277 
281 
285 
294  virtual void CalculateAll(
295  MatrixType& rLeftHandSideMatrix,
296  VectorType& rRightHandSideVector,
297  const ProcessInfo& rCurrentProcessInfo,
298  const bool CalculateStiffnessMatrixFlag,
299  const bool CalculateResidualVectorFlag
300  );
301 
305 
309 
313 
314 private:
317 
321 
325 
329 
330  Variable<double>* GetDisplacementInDirection() const;
331  Variable<double>* GetPointLoadInDirection() const;
332 
336 
337 
341 
345 
346  friend class Serializer;
347  void save( Serializer& rSerializer ) const override;
348  void load( Serializer& rSerializer ) override;
349 
350 }; // class BaseLoadCondition.
351 
355 
356 
360 
361 } // namespace Kratos.
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
This class is to add contributions to LHS and RHS of the displacement control condition.
Definition: displacement_control_condition.h:52
BaseType::GeometryType GeometryType
Definition: displacement_control_condition.h:63
BaseType::SizeType SizeType
Definition: displacement_control_condition.h:60
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: displacement_control_condition.h:254
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(DisplacementControlCondition)
BaseType::IndexType IndexType
Definition: displacement_control_condition.h:59
std::string Info() const override
Turn back information as a string.
Definition: displacement_control_condition.h:245
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: displacement_control_condition.h:260
Condition BaseType
Definition: displacement_control_condition.h:58
BaseType::PropertiesType PropertiesType
Definition: displacement_control_condition.h:62
BaseType::NodesArrayType NodesArrayType
Definition: displacement_control_condition.h:64
BaseType::NodeType NodeType
Definition: displacement_control_condition.h:61
unsigned int GetBlockSize() const
This method computes the DoF block size.
Definition: displacement_control_condition.h:225
std::size_t IndexType
Definition: flags.h:74
std::size_t IndexType
Defines the index type.
Definition: geometrical_object.h:73
Geometry base class.
Definition: geometry.h:71
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
std::size_t SizeType
Definition: nurbs_utilities.h:41
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Properties PropertiesType
Definition: regenerate_pfem_pressure_conditions_process.h:26
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307