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.
rigid_body_element.h
Go to the documentation of this file.
1 // Created by: Salva Latorre, latorre@cimne.upc.edu
2 
3 #if !defined KRATOS_RIGID_BODY_ELEMENT_H_INCLUDED
4 #define KRATOS_RIGID_BODY_ELEMENT_H_INCLUDED
5 
6 // System includes
7 #include <string>
8 #include <iostream>
9 #include <cmath>
10 
11 // Project includes
12 #include "includes/define.h"
13 #include "includes/node.h"
14 #include "includes/element.h"
15 #include "geometries/geometry.h"
16 #include "includes/properties.h"
17 #include "includes/process_info.h"
21 #include "includes/condition.h"
23 #include "utilities/quaternion.h"
27 
28 
29 namespace Kratos {
30 
31  class KRATOS_API(DEM_APPLICATION) RigidBodyElement3D : public Element {
32 
33  public:
36 
38  RigidBodyElement3D(IndexType NewId, GeometryType::Pointer pGeometry);
39  RigidBodyElement3D(IndexType NewId, NodesArrayType const& ThisNodes);
40  RigidBodyElement3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
41 
42  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
43 
45  virtual ~RigidBodyElement3D();
46 
47  using Element::Initialize;
48  void Initialize(const ProcessInfo& r_process_info) override;
49  virtual void SetIntegrationScheme(DEMIntegrationScheme::Pointer& translational_integration_scheme, DEMIntegrationScheme::Pointer& rotational_integration_scheme);
50  virtual void CustomInitialize(ModelPart& rigid_body_element_sub_model_part);
51  virtual void SetOrientation(const Quaternion<double> Orientation);
52  virtual void UpdateLinearDisplacementAndVelocityOfNodes();
53  virtual void UpdateAngularDisplacementAndVelocityOfNodes();
54  virtual void GetRigidBodyElementsForce(const array_1d<double,3>& gravity);
55  virtual void CollectForcesAndTorquesFromTheNodes();
56  virtual void ComputeExternalForces(const array_1d<double,3>& gravity);
57  virtual void SetInitialConditionsToNodes(const array_1d<double,3>& velocity);
58 
59  virtual void Move(const double delta_t, const bool rotation_option, const double force_reduction_factor, const int StepFlag);
60  virtual DEMIntegrationScheme& GetTranslationalIntegrationScheme() { return *mpTranslationalIntegrationScheme; }
61  virtual DEMIntegrationScheme& GetRotationalIntegrationScheme() { return *mpRotationalIntegrationScheme; }
62 
63  virtual double GetMass();
64 
66 
67  virtual std::string Info() const override
68  {
69  std::stringstream buffer;
70  buffer << "Discrete Element #" << Id();
71  return buffer.str();
72  }
73 
75  virtual void PrintInfo(std::ostream& rOStream) const override
76  {
77  rOStream << "Discrete Element #" << Id();
78  }
79 
81  virtual void PrintData(std::ostream& rOStream) const override
82  {
83  //mpGeometry->PrintData(rOStream);
84  }
85 
86  std::vector<array_1d<double, 3> > mListOfCoordinates;
87  std::vector<Node::Pointer > mListOfNodes;
90 
91  //protected:
92 
93  std::vector<RigidFace3D*> mListOfRigidFaces;
95 
96  private:
97 
98  friend class Serializer;
99 
100  virtual void save(Serializer& rSerializer) const override;
101 
102  virtual void load(Serializer& rSerializer) override;
103 
104  }; // Class RigidBodyElement3D
105 
107  inline std::istream& operator >> (std::istream& rIStream, RigidBodyElement3D& rThis);
108 
110  inline std::ostream& operator << (std::ostream& rOStream, const RigidBodyElement3D& rThis)
111  {
112  rThis.PrintInfo(rOStream);
113  rOStream << std::endl;
114  rThis.PrintData(rOStream);
115 
116  return rOStream;
117  }
118 
119 } // namespace Kratos
120 
121 #endif // KRATOS_RIGID_BODY_ELEMENT_H_INCLUDED defined
Definition: dem_integration_scheme.h:24
Base class for all Elements.
Definition: element.h:60
virtual void Initialize(const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:341
std::size_t IndexType
Definition: flags.h:74
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
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
Definition: rigid_body_element.h:31
virtual std::string Info() const override
Turn back information as a string.
Definition: rigid_body_element.h:67
DEMIntegrationScheme * mpTranslationalIntegrationScheme
Definition: rigid_body_element.h:88
virtual DEMIntegrationScheme & GetRotationalIntegrationScheme()
Definition: rigid_body_element.h:61
virtual DEMIntegrationScheme & GetTranslationalIntegrationScheme()
Definition: rigid_body_element.h:60
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: rigid_body_element.h:75
std::vector< array_1d< double, 3 > > mListOfCoordinates
Definition: rigid_body_element.h:86
std::vector< Node::Pointer > mListOfNodes
Definition: rigid_body_element.h:87
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(RigidBodyElement3D)
Pointer definition of RigidBodyElement3D.
std::vector< RigidFace3D * > mListOfRigidFaces
Definition: rigid_body_element.h:93
array_1d< double, 3 > mInertias
Definition: rigid_body_element.h:94
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: rigid_body_element.h:81
DEMIntegrationScheme * mpRotationalIntegrationScheme
Definition: rigid_body_element.h:89
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
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
float velocity
Definition: PecletTest.py:54
def load(f)
Definition: ode_solve.py:307
float delta_t
Definition: rotatingcone_PureConvectionBenchmarking.py:129