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.
symplectic_euler_scheme.h
Go to the documentation of this file.
1 //
2 // Author: Miquel Santasusana msantasusana@cimne.upc.edu
3 //
4 
5 #if !defined(KRATOS_SYMPLECTIC_EULER_SCHEME_H_INCLUDED )
6 #define KRATOS_SYMPLECTIC_EULER_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) SymplecticEulerScheme : public DEMIntegrationScheme {
24  public:
25 
27 
30 
33 
36 
37  DEMIntegrationScheme* CloneRaw() const override {
38  DEMIntegrationScheme* cloned_scheme(new SymplecticEulerScheme(*this));
39  return cloned_scheme;
40  }
41 
42  DEMIntegrationScheme::Pointer CloneShared() const override {
43  DEMIntegrationScheme::Pointer cloned_scheme(new SymplecticEulerScheme(*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 UpdateRotationalVariables(
90  int StepFlag,
91  Node& i,
92  array_1d<double, 3 >& rotated_angle,
93  array_1d<double, 3 >& delta_rotation,
94  array_1d<double, 3 >& angular_velocity,
95  array_1d<double, 3 >& angular_acceleration,
96  const double delta_t,
97  const bool Fix_Ang_vel[3]) override;
98 
99  void CalculateLocalAngularAcceleration(
100  const double moment_of_inertia,
101  const array_1d<double, 3 >& torque,
102  const double moment_reduction_factor,
103  array_1d<double, 3 >& angular_acceleration) override;
104 
105  void CalculateLocalAngularAccelerationByEulerEquations(
106  const array_1d<double, 3 >& local_angular_velocity,
107  const array_1d<double, 3 >& moments_of_inertia,
108  const array_1d<double, 3 >& local_torque,
109  const double moment_reduction_factor,
110  array_1d<double, 3 >& local_angular_acceleration) override;
111 
113 
114  virtual std::string Info() const override {
115  std::stringstream buffer;
116  buffer << "SymplecticEulerScheme";
117  return buffer.str();
118  }
119 
121 
122  virtual void PrintInfo(std::ostream& rOStream) const override {
123  rOStream << "SymplecticEulerScheme";
124  }
125 
127 
128  virtual void PrintData(std::ostream& rOStream) const override {
129  }
130 
131 
132  protected:
133 
134 
135  private:
136 
138 
140  return *this;
141  }
142 
144 
145  SymplecticEulerScheme(SymplecticEulerScheme const& rOther) {
146  *this = rOther;
147  }
148 
150 
151  }; // Class SymplecticEulerScheme
152 
153  inline std::istream& operator>>(std::istream& rIStream,
154  SymplecticEulerScheme& rThis) {
155  return rIStream;
156  }
157 
158  inline std::ostream& operator<<(std::ostream& rOStream,
159  const SymplecticEulerScheme& rThis) {
160  rThis.PrintInfo(rOStream);
161  rOStream << std::endl;
162  rThis.PrintData(rOStream);
163 
164  return rOStream;
165  }
166 
167 } // namespace Kratos.
168 
169 #endif // KRATOS_SYMPLECTIC_EULER_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: symplectic_euler_scheme.h:23
DEMIntegrationScheme * CloneRaw() const override
Definition: symplectic_euler_scheme.h:37
KRATOS_CLASS_POINTER_DEFINITION(SymplecticEulerScheme)
Pointer definition of SymplecticEulerScheme.
ModelPart::NodesContainerType NodesArrayType
Definition: symplectic_euler_scheme.h:26
virtual std::string Info() const override
Turn back information as a string.
Definition: symplectic_euler_scheme.h:114
SymplecticEulerScheme()
Default constructor.
Definition: symplectic_euler_scheme.h:32
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: symplectic_euler_scheme.h:128
virtual ~SymplecticEulerScheme()
Destructor.
Definition: symplectic_euler_scheme.h:35
DEMIntegrationScheme::Pointer CloneShared() const override
Definition: symplectic_euler_scheme.h:42
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: symplectic_euler_scheme.h:122
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