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.
moving_load_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: Aron Noordam
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
22 
23 namespace Kratos
24 {
25 
28 
32 
36 
40 
44 
55 template<std::size_t TDim, std::size_t TNumNodes>
56 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) MovingLoadCondition
57  : public BaseLoadCondition
58 {
59 public:
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 
83  ~MovingLoadCondition() override;
84 
88 
89 
93 
101  Condition::Pointer Create(
102  IndexType NewId,
103  NodesArrayType const& ThisNodes,
104  PropertiesType::Pointer pProperties
105  ) const override;
106 
114  Condition::Pointer Create(
115  IndexType NewId,
116  GeometryType::Pointer pGeom,
117  PropertiesType::Pointer pProperties
118  ) const override;
119 
126  Condition::Pointer Clone (
127  IndexType NewId,
128  NodesArrayType const& ThisNodes
129  ) const override;
130 
131 
136  bool HasRotDof() const override;
137 
138 
143  void InitializeSolutionStep(const ProcessInfo & rCurrentProcessInfo) override;
144 
149  void InitializeNonLinearIteration(const ProcessInfo & rCurrentProcessInfo) override;
150 
154 
155 
159 
160 
164 
166  std::string Info() const override
167  {
168  std::stringstream buffer;
169  buffer << "Point load Condition #" << Id();
170  return buffer.str();
171  }
172 
174 
175  void PrintInfo(std::ostream& rOStream) const override
176  {
177  rOStream << "Point load Condition #" << Id();
178  }
179 
181  void PrintData(std::ostream& rOStream) const override
182  {
183  pGetGeometry()->PrintData(rOStream);
184  }
185 
189 
190 
192 
193 protected:
196 
197 
201 
202 
206 
207 
211 
220  void CalculateAll(
221  MatrixType& rLeftHandSideMatrix,
222  VectorType& rRightHandSideVector,
223  const ProcessInfo& rCurrentProcessInfo,
224  const bool CalculateStiffnessMatrixFlag,
225  const bool CalculateResidualVectorFlag
226  ) override;
227 
233  void CalculateExactNormalShapeFunctions(VectorType& rShapeFunctionsVector, const double LocalXCoord) const;
234 
240  void CalculateExactShearShapeFunctions(VectorType& rShapeFunctionsVector, const double LocalXCoord) const;
241 
247  void CalculateExactRotationalShapeFunctions(VectorType& rShapeFunctionsVector, const double LocalXCoord) const;
248 
254  void CalculateExactShearShapeFunctionsDerivatives(VectorType& rShapeFunctionsVector, const double LocalXCoord) const;
255 
261  void CalculateExactRotationalShapeFunctionsDerivatives(VectorType& rShapeFunctionsVector, const double LocalXCoord) const;
262 
268  void CalculateRotationMatrix(BoundedMatrix<double, TDim, TDim>& rRotationMatrix, const GeometryType& rGeom);
269 
270 
277  Matrix CalculateGlobalMomentMatrix(const VectorType& rRotationalShapeFunctionVector, const array_1d<double, TDim>& rLocalMovingLoad) const;
278 
282 
283 
287 
288 
292 
293  // A protected default constructor necessary for serialization
295 
297 
298 private:
301 
302 
306  bool mIsMovingLoad = false;
307 
308 
312 
318  void GetRotationsVector(Vector& rRotationsVector, const int Step) const;
319 
323 
324 
328  Vector CalculateLoadPointDisplacementVector();
329 
333  Vector CalculateLoadPointRotationVector();
334 
338 
339 
343 
347 
348  friend class Serializer;
349 
350  void save( Serializer& rSerializer ) const override
351  {
353  rSerializer.save("mIsMovingLoad", mIsMovingLoad);
354  }
355 
356  void load( Serializer& rSerializer ) override
357  {
359  rSerializer.load("mIsMovingLoad", mIsMovingLoad);
360  }
361 
365 
367 
368 }; // Class MovingLoadCondition
369 
373 
374 
378 
379 
381 template<std::size_t TDim, std::size_t TNumNodes>
382 inline std::istream& operator >> (std::istream& rIStream,
384 
386 template<std::size_t TDim, std::size_t TNumNodes>
387 inline std::ostream& operator << (std::ostream& rOStream,
389 {
390  rThis.PrintInfo(rOStream);
391  rOStream << std::endl;
392  rThis.PrintData(rOStream);
393 
394  return rOStream;
395 }
396 
398 
399 } // namespace Kratos.
This is the base class of all the load conditions on StructuralMechanicsApplication.
Definition: base_load_condition.h:54
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class is the responsible to add the contributions of the RHS and LHS of the moving loads of the ...
Definition: moving_load_condition.h:58
std::string Info() const override
Turn back information as a string.
Definition: moving_load_condition.h:166
MovingLoadCondition()
Definition: moving_load_condition.h:294
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MovingLoadCondition)
Counted pointer of PointLoadCondition.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: moving_load_condition.h:175
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: moving_load_condition.h:181
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
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
void CalculateRotationMatrix(const double Theta, MatrixType &rMatrix, const DenseVector< double > &rAxisOfRotationVector, const DenseVector< double > &rCenterOfRotation)
Calculate the transformation matrix which rotates the given vector around mAxisOfRotationVector and m...
Definition: geometrical_transformation_utilities.cpp:41
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307