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.
dem_integration_scheme.h
Go to the documentation of this file.
1 //
2 // Author: Miguel AngelCeligueta, maceli@cimne.upc.edu
3 //
4 
5 #if !defined KRATOS_DEM_INTEGRATION_SCHEME_H_INCLUDED
6 #define KRATOS_DEM_INTEGRATION_SCHEME_H_INCLUDED
7 
8 // Project includes
9 #include "includes/define.h"
10 #include "utilities/openmp_utils.h"
11 #include "includes/model_part.h"
12 #include "utilities/quaternion.h"
13 
14 // System includes
15 #include <float.h>
16 #include <string>
17 #include <iostream>
18 
19 namespace Kratos {
20 
21  class Cluster3D;
22  class RigidBodyElement3D;
23 
24  class KRATOS_API(DEM_APPLICATION) DEMIntegrationScheme {
25  public:
26 
29 
31 
32  virtual ~DEMIntegrationScheme();
33 
34  virtual DEMIntegrationScheme* CloneRaw() const {
35  DEMIntegrationScheme* cloned_scheme(new DEMIntegrationScheme(*this));
36  return cloned_scheme;
37  }
38 
39  virtual DEMIntegrationScheme::Pointer CloneShared() const {
40  DEMIntegrationScheme::Pointer cloned_scheme(new DEMIntegrationScheme(*this));
41  return cloned_scheme;
42  }
43 
44  virtual void SetTranslationalIntegrationSchemeInProperties(Properties::Pointer pProp, bool verbose = true) const;
45  virtual void SetRotationalIntegrationSchemeInProperties(Properties::Pointer pProp, bool verbose = true) const;
46 
47  virtual void Move(Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
48  virtual void Rotate(Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
49  virtual void MoveRigidBodyElement(RigidBodyElement3D* rigid_body_element, Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
50  virtual void RotateRigidBodyElement(RigidBodyElement3D* rigid_body_element, Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
51 
52  virtual void UpdateTranslationalVariables(
53  int StepFlag,
54  Node& i,
56  array_1d<double, 3 >& displ,
57  array_1d<double, 3 >& delta_displ,
59  const array_1d<double, 3 >& initial_coor,
60  const array_1d<double, 3 >& force,
61  const double force_reduction_factor,
62  const double mass,
63  const double delta_t,
64  const bool Fix_vel[3]);
65 
66  virtual void CalculateTranslationalMotionOfNode(Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
67  virtual void CalculateRotationalMotionOfSphereNode(Node & i, const double delta_t, const double force_reduction_factor, const int StepFlag);
68  virtual void CalculateRotationalMotionOfRigidBodyElementNode(Node & i, const double delta_t, const double moment_reduction_factor, const int StepFlag);
69 
70  virtual void CalculateNewRotationalVariablesOfSpheres(
71  int StepFlag,
72  Node& i,
73  const double moment_of_inertia,
74  array_1d<double, 3 >& angular_velocity,
75  array_1d<double, 3 >& torque,
76  const double moment_reduction_factor,
77  array_1d<double, 3 >& rotated_angle,
78  array_1d<double, 3 >& delta_rotation,
79  const double delta_t,
80  const bool Fix_Ang_vel[3]);
81 
82  virtual void CalculateNewRotationalVariablesOfRigidBodyElements(
83  int StepFlag,
84  Node& i,
85  const array_1d<double, 3 > moments_of_inertia,
86  array_1d<double, 3 >& angular_velocity,
87  array_1d<double, 3 >& torque,
88  const double moment_reduction_factor,
89  array_1d<double, 3 >& rotated_angle,
90  array_1d<double, 3 >& delta_rotation,
91  Quaternion<double >& Orientation,
92  const double delta_t,
93  const bool Fix_Ang_vel[3]);
94 
95  virtual void UpdateRotationalVariables(
96  int StepFlag,
97  Node& i,
98  array_1d<double, 3 >& rotated_angle,
99  array_1d<double, 3 >& delta_rotation,
100  array_1d<double, 3 >& angular_velocity,
101  array_1d<double, 3 >& angular_acceleration,
102  const double delta_t,
103  const bool Fix_Ang_vel[3]);
104 
105  virtual void UpdateRotationalVariables(
106  int StepFlag,
107  Node& i,
108  const double& moment_of_inertia,
109  array_1d<double, 3 >& rotated_angle,
110  array_1d<double, 3 >& delta_rotation,
111  Quaternion<double >& Orientation,
112  const array_1d<double, 3 >& angular_momentum,
113  array_1d<double, 3 >& angular_velocity,
114  const double delta_t,
115  const bool Fix_Ang_vel[3]);
116 
117  virtual void UpdateRotationalVariables(
118  int StepFlag,
119  Node& i,
120  const array_1d<double, 3 >& moments_of_inertia,
121  array_1d<double, 3 >& rotated_angle,
122  array_1d<double, 3 >& delta_rotation,
123  Quaternion<double >& Orientation,
124  const array_1d<double, 3 >& angular_momentum,
125  array_1d<double, 3 >& angular_velocity,
126  const double delta_t,
127  const bool Fix_Ang_vel[3]);
128 
129  virtual void UpdateRotatedAngle(
130  array_1d<double, 3 >& rotated_angle,
131  array_1d<double, 3 >& delta_rotation,
132  const array_1d<double, 3 >& angular_velocity,
133  const double delta_t);
134 
135  virtual void UpdateAngularVelocity(
136  const Quaternion<double>& Orientation,
137  const double LocalTensorInv[3][3],
138  const array_1d<double, 3>& angular_momentum,
139  array_1d<double, 3>& angular_velocity);
140 
141  virtual void CalculateLocalAngularAcceleration(
142  const double moment_of_inertia,
143  const array_1d<double, 3 >& torque,
144  const double moment_reduction_factor,
145  array_1d<double, 3 >& angular_acceleration);
146 
147  virtual void CalculateLocalAngularAccelerationByEulerEquations(
148  const array_1d<double, 3 >& local_angular_velocity,
149  const array_1d<double, 3 >& moments_of_inertia,
150  const array_1d<double, 3 >& local_torque,
151  const double moment_reduction_factor,
152  array_1d<double, 3 >& local_angular_acceleration);
153 
154  virtual void CalculateAngularVelocityRK(
155  const Quaternion<double >& Orientation,
156  const double& moment_of_inertia,
157  const array_1d<double, 3 >& angular_momentum,
158  array_1d<double, 3 >& angular_velocity,
159  const double delta_t,
160  const bool Fix_Ang_vel[3]);
161 
162  virtual void CalculateAngularVelocityRK(
163  const Quaternion<double >& Orientation,
164  const array_1d<double, 3 >& moments_of_inertia,
165  const array_1d<double, 3 >& angular_momentum,
166  array_1d<double, 3 > & angular_velocity,
167  const double delta_t,
168  const bool Fix_Ang_vel[3]);
169 
170  virtual void QuaternionCalculateMidAngularVelocities(
171  const Quaternion<double>& Orientation,
172  const double LocalTensorInv[3][3],
173  const array_1d<double, 3>& angular_momentum,
174  const double dt,
175  const array_1d<double, 3>& InitialAngularVel,
176  array_1d<double, 3>& FinalAngularVel);
177 
178  virtual std::string Info() const {
179  std::stringstream buffer;
180  buffer << "DEMIntegrationScheme";
181  return buffer.str();
182  }
183 
185 
186  virtual void PrintInfo(std::ostream & rOStream) const {
187  rOStream << "DEMIntegrationScheme";
188  }
189 
191 
192  virtual void PrintData(std::ostream & rOStream) const {
193  }
194 
195  protected:
196 
197  private:
198 
199  //bool mRotationOption;
200 
202  return *this;
203  }
204 
206 
207  DEMIntegrationScheme(DEMIntegrationScheme const& rOther) {
208  *this = rOther;
209  }
210 
211  friend class Serializer;
212 
213  virtual void save(Serializer& rSerializer) const {
214  //rSerializer.save("MyMemberName",myMember);
215  }
216 
217  virtual void load(Serializer& rSerializer) {
218  //rSerializer.load("MyMemberName",myMember);
219  }
220 
221  }; // Class DEMIntegrationScheme
222 
224 
225  inline std::istream& operator>>(std::istream& rIStream, DEMIntegrationScheme& rThis) {
226  return rIStream;
227  }
228 
230  inline std::ostream& operator<<(std::ostream& rOStream, const DEMIntegrationScheme& rThis) {
231  rThis.PrintInfo(rOStream);
232  rOStream << std::endl;
233  rThis.PrintData(rOStream);
234  return rOStream;
235  }
236 
237 } // namespace Kratos
238 
239 #endif // KRATOS_DEM_INTEGRATION_SCHEME_H_INCLUDED defined
240 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: dem_integration_scheme.h:24
KRATOS_CLASS_POINTER_DEFINITION(DEMIntegrationScheme)
virtual DEMIntegrationScheme * CloneRaw() const
Definition: dem_integration_scheme.h:34
virtual std::string Info() const
Definition: dem_integration_scheme.h:178
ModelPart::NodesContainerType NodesArrayType
Definition: dem_integration_scheme.h:27
virtual DEMIntegrationScheme::Pointer CloneShared() const
Definition: dem_integration_scheme.h:39
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: dem_integration_scheme.h:192
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: dem_integration_scheme.h:186
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: rigid_body_element.h:31
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
dt
Definition: DEM_benchmarks.py:173
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
vel
Definition: pure_conduction.py:76
float delta_t
Definition: rotatingcone_PureConvectionBenchmarking.py:129
integer i
Definition: TensorModule.f:17