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.
set_moving_load_process.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Aron Noordam
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/define.h"
20 #include "processes/process.h"
21 #include "includes/model_part.h"
23 
26 namespace Kratos {
27 
30 
33 
34 
43 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) SetMovingLoadProcess : public Process
44 {
45 public:
49 
50 
55 
56  typedef std::size_t SizeType;
57 
61 
62  SetMovingLoadProcess(ModelPart& rModelPart,
64 
68 
73  void ExecuteInitialize() override;
74 
80  void ExecuteInitializeSolutionStep() override;
81 
86  void ExecuteFinalizeSolutionStep() override;
87 
88 
92 
94  virtual std::string Info() const override {
95  return "SetMovingLoadProcess";
96  }
97 
99  void PrintInfo(std::ostream& rOStream) const override {
100  rOStream << "SetMovingLoadProcess";
101  }
102 
104  void PrintData(std::ostream& rOStream) const override {
105  }
106 
108 
109 private:
112 
113  ModelPart& mrModelPart;
114  Parameters mParameters;
115 
116  // vector of sorted conditions
117  std::vector<Condition> mSortedConditions;
118 
119  // vector of booleans which indicate if the nodes in the condition are in reversed order with respect to the direction of the moving load
120  std::vector<bool> mIsCondReversedVector;
121 
122  // point of origin of the moving load
123  array_1d<double, 3> mOriginPoint;
124 
125  // array of directions, of the moving load. This array indicates if the load moves in positive or negative direction with respect to the global
126  // axis
127  array_1d<int,3> mDirection;
128 
129  // distance of the load, with respect to the first node of the first condition in the sorted conditions vector
130  double mCurrentDistance;
131 
132  // bool which indicates if a load function is used to determine the value of the load
133  bool mUseLoadFunction;
134 
135  // bool which indicates of velocity function is used to determine the value of the load velocity
136  bool mUseVelocityFunction;
137 
138  // vector of load functions
139  std::vector<BasicGenericFunctionUtility> mLoadFunctions;
140 
144 
150  static std::vector<IndexType> FindNonRepeatingIndices(const std::vector<IndexType> IndicesVector);
151 
157  std::vector<Condition> FindEndConditions();
158 
166  std::vector<Condition> SortConditions(ModelPart::ConditionsContainerType& rUnsortedConditions, Condition& rFirstCondition);
167 
175  static bool IsConditionReversed(const Condition& rCondition, const array_1d<int, 3> Direction);
176 
185  static Condition& GetFirstCondition(const Point FirstPoint, const Point SecondPoint, const array_1d<int, 3> Direction, std::vector<Condition>& rEndConditions);
186 
196  static Condition& GetFirstConditionFromCoord(const double FirstCoord, const double SecondCoord, const int Direction, std::vector<Condition>& EndConditions);
197 
205  static bool IsSwapPoints(const double FirstCoord, const double SecondCoord, const int Direction);
206 
211  void InitializeDistanceLoadInSortedVector();
212 
216 
217  friend class Serializer;
218 
219  void save(Serializer& rSerializer) const override;
220  void load(Serializer& rSerializer) override;
221 
223 
224 }; // Class SetMovingLoadProcess
225 
227 
228 } // namespace Kratos.
void ExecuteFinalizeSolutionStep() override
this function will be executed at every time step AFTER performing the solve phase
Definition: periodic_interface_process.hpp:55
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
Base class for all Conditions.
Definition: condition.h:59
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Point class.
Definition: point.h:59
The base class for all processes in Kratos.
Definition: process.h:49
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Process to set the moving load.
Definition: set_moving_load_process.h:44
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: set_moving_load_process.h:99
virtual std::string Info() const override
Turn back information as a string.
Definition: set_moving_load_process.h:94
KRATOS_CLASS_POINTER_DEFINITION(SetMovingLoadProcess)
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: set_moving_load_process.h:104
std::size_t SizeType
Definition: set_moving_load_process.h:56
std::vector< int > IndicesVector
Definition: rans_line_output_process.h:38
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307