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.
forward_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_FORWARD_EULER_SCHEME_H_INCLUDED )
6 #define KRATOS_FORWARD_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) ForwardEulerScheme : public DEMIntegrationScheme {
24  public:
25 
27 
30 
33 
35  virtual ~ForwardEulerScheme() {}
36 
37  DEMIntegrationScheme* CloneRaw() const override {
38  DEMIntegrationScheme* cloned_scheme(new ForwardEulerScheme(*this));
39  return cloned_scheme;
40  }
41 
42  DEMIntegrationScheme::Pointer CloneShared() const override {
43  DEMIntegrationScheme::Pointer cloned_scheme(new ForwardEulerScheme(*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 << "ForwardEulerScheme";
117  return buffer.str();
118  }
119 
121 
122  virtual void PrintInfo(std::ostream& rOStream) const override{
123  rOStream << "ForwardEulerScheme";
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  ForwardEulerScheme(ForwardEulerScheme const& rOther) {
146  *this = rOther;
147  }
148 
149 
151 
152  }; // Class ForwardEulerScheme
153 
154 
155  inline std::istream& operator>>(std::istream& rIStream,
156  ForwardEulerScheme& rThis) {
157  return rIStream;
158  }
159 
160  inline std::ostream& operator<<(std::ostream& rOStream,
161  const ForwardEulerScheme& rThis) {
162  rThis.PrintInfo(rOStream);
163  rOStream << std::endl;
164  rThis.PrintData(rOStream);
165 
166  return rOStream;
167  }
168 
169 } // namespace Kratos.
170 
171 #endif // KRATOS_FORWARD_EULER_SCHEME_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: dem_integration_scheme.h:24
Definition: forward_euler_scheme.h:23
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: forward_euler_scheme.h:128
ModelPart::NodesContainerType NodesArrayType
Definition: forward_euler_scheme.h:26
ForwardEulerScheme()
Default constructor.
Definition: forward_euler_scheme.h:32
DEMIntegrationScheme * CloneRaw() const override
Definition: forward_euler_scheme.h:37
virtual std::string Info() const override
Turn back information as a string.
Definition: forward_euler_scheme.h:114
KRATOS_CLASS_POINTER_DEFINITION(ForwardEulerScheme)
Pointer definition of ForwardEulerScheme.
DEMIntegrationScheme::Pointer CloneShared() const override
Definition: forward_euler_scheme.h:42
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: forward_euler_scheme.h:122
virtual ~ForwardEulerScheme()
Destructor.
Definition: forward_euler_scheme.h:35
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
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