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.
quaternion_integration_scheme.h
Go to the documentation of this file.
1 //
2 // Author: Joaquin Irazabal, jirazabal@cimne.upc.edu
3 //
4 
5 #if !defined(KRATOS_QUATERNION_INTEGRATION_SCHEME_H_INCLUDED )
6 #define KRATOS_QUATERNION_INTEGRATION_SCHEME_H_INCLUDED
7 
8 // System includes
9 #include <string>
10 #include <iostream>
11 #include <cfloat>
12 
13 // Project includes
14 #include "dem_integration_scheme.h"
15 #include "includes/define.h"
16 #include "utilities/openmp_utils.h"
17 #include "includes/model_part.h"
19 #include "utilities/quaternion.h"
20 
21 namespace Kratos {
22 
23  class KRATOS_API(DEM_APPLICATION) QuaternionIntegrationScheme : public DEMIntegrationScheme {
24  public:
25 
27 
30 
33 
36 
37  DEMIntegrationScheme* CloneRaw() const override {
38  DEMIntegrationScheme* cloned_scheme(new QuaternionIntegrationScheme(*this));
39  return cloned_scheme;
40  }
41 
42  DEMIntegrationScheme::Pointer CloneShared() const override {
43  DEMIntegrationScheme::Pointer cloned_scheme(new QuaternionIntegrationScheme(*this));
44  return cloned_scheme;
45  }
46 
47  void SetTranslationalIntegrationSchemeInProperties(Properties::Pointer pProp, bool verbose = true) const override;
48  void SetRotationalIntegrationSchemeInProperties(Properties::Pointer pProp, bool verbose = true) const override;
49 
50  void UpdateTranslationalVariables(
51  int StepFlag,
52  Node& i,
54  array_1d<double, 3 >& displ,
55  array_1d<double, 3 >& delta_displ,
57  const array_1d<double, 3 >& initial_coor,
58  const array_1d<double, 3 >& force,
59  const double force_reduction_factor,
60  const double mass,
61  const double delta_t,
62  const bool Fix_vel[3]) override;
63 
64  void CalculateNewRotationalVariablesOfSpheres(
65  int StepFlag,
66  Node& i,
67  const double moment_of_inertia,
68  array_1d<double, 3 >& angular_velocity,
69  array_1d<double, 3 >& torque,
70  const double moment_reduction_factor,
71  array_1d<double, 3 >& rotated_angle,
72  array_1d<double, 3 >& delta_rotation,
73  const double delta_t,
74  const bool Fix_Ang_vel[3]) override;
75 
76  void CalculateNewRotationalVariablesOfRigidBodyElements(
77  int StepFlag,
78  Node& i,
79  const array_1d<double, 3 > moments_of_inertia,
80  array_1d<double, 3 >& angular_velocity,
81  array_1d<double, 3 >& torque,
82  const double moment_reduction_factor,
83  array_1d<double, 3 >& rotated_angle,
84  array_1d<double, 3 >& delta_rotation,
85  Quaternion<double >& Orientation,
86  const double delta_t,
87  const bool Fix_Ang_vel[3]) override;
88 
89  void UpdateRotatedAngle(
90  array_1d<double, 3 >& rotated_angle,
91  array_1d<double, 3 >& delta_rotation,
92  const array_1d<double, 3 >& angular_velocity,
93  const double delta_t) override;
94 
95  void CalculateLocalAngularAcceleration(
96  const double moment_of_inertia,
97  const array_1d<double, 3 >& torque,
98  const double moment_reduction_factor,
99  array_1d<double, 3 >& angular_acceleration) override;
100 
101  void CalculateLocalAngularAccelerationByEulerEquations(
102  const array_1d<double, 3 >& local_angular_velocity,
103  const array_1d<double, 3 >& moments_of_inertia,
104  const array_1d<double, 3 >& local_torque,
105  const double moment_reduction_factor,
106  array_1d<double, 3 >& local_angular_acceleration) override;
107 
109 
110  virtual std::string Info() const override{
111  std::stringstream buffer;
112  buffer << "QuaternionIntegrationScheme";
113  return buffer.str();
114  }
115 
117 
118  virtual void PrintInfo(std::ostream& rOStream) const override{
119  rOStream << "QuaternionIntegrationScheme";
120  }
121 
123 
124  virtual void PrintData(std::ostream& rOStream) const override{
125  }
126 
127 
128  protected:
129 
130 
131  private:
132 
134 
136  return *this;
137  }
138 
140 
141  QuaternionIntegrationScheme(QuaternionIntegrationScheme const& rOther) {
142  *this = rOther;
143  }
144 
145 
147 
148  }; // Class QuaternionIntegrationScheme
149 
150 
151  inline std::istream& operator>>(std::istream& rIStream,
153  return rIStream;
154  }
155 
156  inline std::ostream& operator<<(std::ostream& rOStream,
157  const QuaternionIntegrationScheme& rThis) {
158  rThis.PrintInfo(rOStream);
159  rOStream << std::endl;
160  rThis.PrintData(rOStream);
161 
162  return rOStream;
163  }
164 
165 } // namespace Kratos.
166 
167 #endif // KRATOS_QUATERNION_INTEGRATION_SCHEME_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: dem_integration_scheme.h:24
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class defines the node.
Definition: node.h:65
Definition: quaternion_integration_scheme.h:23
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: quaternion_integration_scheme.h:124
ModelPart::NodesContainerType NodesArrayType
Definition: quaternion_integration_scheme.h:26
virtual ~QuaternionIntegrationScheme()
Destructor.
Definition: quaternion_integration_scheme.h:35
QuaternionIntegrationScheme()
Default constructor.
Definition: quaternion_integration_scheme.h:32
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: quaternion_integration_scheme.h:118
virtual std::string Info() const override
Turn back information as a string.
Definition: quaternion_integration_scheme.h:110
KRATOS_CLASS_POINTER_DEFINITION(QuaternionIntegrationScheme)
Pointer definition of QuaternionIntegrationScheme.
DEMIntegrationScheme * CloneRaw() const override
Definition: quaternion_integration_scheme.h:37
DEMIntegrationScheme::Pointer CloneShared() const override
Definition: quaternion_integration_scheme.h:42
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
vel
Definition: pure_conduction.py:76
float delta_t
Definition: rotatingcone_PureConvectionBenchmarking.py:129
integer i
Definition: TensorModule.f:17