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.
multiaxial_control_module_generalized_2d_utilities.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ignasi de Pouplana
11 // Guillermo Casas
12 //
13 
14 
15 #ifndef KRATOS_MULTIAXIAL_CONTROL_MODULE_GENERALIZED_2D_UTILITIES
16 #define KRATOS_MULTIAXIAL_CONTROL_MODULE_GENERALIZED_2D_UTILITIES
17 
18 // /* External includes */
19 
20 // System includes
21 
22 // Project includes
23 #include "includes/variables.h"
24 
25 /* System includes */
26 #include <limits>
27 #include <iostream>
28 #include <iomanip>
29 #include <map>
30 
31 /* External includes */
32 #ifdef _OPENMP
33 #include <omp.h>
34 #endif
35 
36 /* Project includes */
37 #include "geometries/geometry.h"
38 #include "includes/define.h"
39 #include "includes/model_part.h"
40 
41 #include "includes/table.h"
43 #include "utilities/math_utils.h"
44 
45 // Application includes
47 
49 
50 
51 namespace Kratos
52 {
53 class KRATOS_API(DEM_APPLICATION) MultiaxialControlModuleGeneralized2DUtilities
54 {
55 public:
56 
58 
60 typedef std::size_t IndexType;
61 
64 
66 
67 MultiaxialControlModuleGeneralized2DUtilities(ModelPart& rDemModelPart, ModelPart& rFemModelPart, Parameters& rParameters);
68 
70 
72 
73 //***************************************************************************************************************
74 //***************************************************************************************************************
75 
76 // Before DEM solution
77 virtual void ExecuteInitialize();
78 
79 // Before DEM solution
80 virtual void ExecuteInitializeSolutionStep();
81 
82 // After DEM solution
83 virtual void ExecuteFinalizeSolutionStep();
84 
85 //***************************************************************************************************************
86 //***************************************************************************************************************
87 
91 
92 
96 
98 
99 virtual std::string Info() const
100 {
101  return "";
102 }
103 
105 
106 virtual void PrintInfo(std::ostream& rOStream) const
107 {
108 }
109 
111 
112 virtual void PrintData(std::ostream& rOStream) const
113 {
114 }
115 
116 
120 
122 
123 protected:
126 
129  double mCMDeltaTime;
130  double mCMTime;
131  double mKDeltaTime;
132  double mKTime;
133  unsigned int mStep;
134  unsigned int mCMStep;
135  unsigned int mKStep;
136  unsigned int mActuatorCounter;
138  unsigned int mPerturbationPeriod;
144  std::vector<std::string> mVectorOfActuatorNames;
145  std::map<std::string, std::vector<ModelPart*>> mListsOfFEMSubModelPartsForEachActuator;
146  std::map<std::string, std::vector<ModelPart*>> mListsOfDEMSubModelPartsForEachActuator;
147  std::map<std::string, std::vector<array_1d<double,3>>> mFEMOuterNormals;
148  // std::map<std::string, std::vector<array_1d<double,3>>> mDEMOuterNormals; /// OuterNormal associated to each DEM boundary of every actuator. TODO: not used for now...
149  std::map<std::string, unsigned int> mTargetStressTableIds;
151  Vector mAcceleration; // TODO: possible CM enhancement
161  double mMaxNodalVelocityForMultiDofs = 0.0;
162  double mCompressionLengthForMultiDofs = 0.0;
163 
167 
168 
172 
173 
177 
178 virtual Vector MeasureReactionStress(const Variable<array_1d<double,3>>& rVariable);
179 Vector GetPerturbations(const Vector& rTargetStress, const double& rTime);
180 double GetConditionNumber(const Matrix& rInputMatrix, const Matrix& rInvertedMatrix);
181 void CalculateVelocity(const Vector& r_next_target_stress, const double& r_current_time);
182 void CalculateAcceleration(const Vector& r_next_target_stress, const double& r_current_time);
183 void CalculateStiffness();
184 void CalculateMaximumInputStressVariationRate();
185 void AddTableToSubModelPart(const unsigned int TableId, const Parameters TableParameters, ModelPart* pSubModelPart);
186 Parameters GetDefaultParametersForRadialActuator();
187 Parameters GetDefaultParametersForRadialMultiDofsActuator();
188 Parameters GetDefaultParametersForZActuator();
189 Parameters GetDefaultParametersForXOrYActuator();
190 void SetProvidedInitialVelocityToTheControlledBoundaries();
191 
195 
199 
200 
204 
205 
207 
208 private:
209 
212 
213 
220 
224 
228 
229 
233 
234 
238 
241 
242 
244 
245 }; // Class MultiaxialControlModuleGeneralized2DUtilities
246 
247 } // namespace Python.
248 
249 #endif // KRATOS_MULTIAXIAL_CONTROL_MODULE_GENERALIZED_2D_UTILITIES
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
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
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:54
double mMaxReactionCorrectionFraction
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:139
std::size_t IndexType
Definition of the index type.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:60
Vector mElasticReactionStress
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:156
ModelPart & mrDemModelPart
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:127
std::vector< std::string > mVectorOfActuatorNames
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:144
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:112
double mReactionAlpha
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:142
Vector mDisplacement
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:154
double mMaximumInputStressVariationRate
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:143
Vector mReactionStressOld
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:153
unsigned int mActuatorCounter
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:136
double mVelocityAlpha
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:141
Vector mDisplacementOld
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:155
double mKTime
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:132
Vector mVelocity
TargetStressTableIds associated to every actuator.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:150
std::map< std::string, std::vector< ModelPart * > > mListsOfDEMSubModelPartsForEachActuator
FEM SubModelParts associated to each boundary of every actuator.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:146
Table< double, double > TableType
Defining a table with double argument and result type as table type.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:63
double mStiffnessAlpha
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:140
ModelPart & mrFemModelPart
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:128
Matrix mDeltaDisplacement
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:158
KRATOS_CLASS_POINTER_DEFINITION(MultiaxialControlModuleGeneralized2DUtilities)
unsigned int mStep
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:133
double mNormOfInitiallyEstimatedStiffness
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:160
std::map< std::string, unsigned int > mTargetStressTableIds
OuterNormal associated to each FEM boundary of every actuator.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:149
double mCMTime
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:130
double mPerturbationTolerance
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:137
unsigned int mKStep
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:135
double mCMDeltaTime
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:129
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:99
unsigned int mCMStep
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:134
Matrix mStiffness
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:157
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:106
std::map< std::string, std::vector< array_1d< double, 3 > > > mFEMOuterNormals
DEM SubModelParts associated to each boundary of every actuator.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:147
Vector mAcceleration
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:151
Matrix mDeltaReactionStress
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:159
double mKDeltaTime
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:131
std::map< std::string, std::vector< ModelPart * > > mListsOfFEMSubModelPartsForEachActuator
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:145
Vector mReactionStress
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:152
unsigned int mPerturbationPeriod
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:138
virtual ~MultiaxialControlModuleGeneralized2DUtilities()
Destructor.
Definition: multiaxial_control_module_generalized_2d_utilities.hpp:71
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: table.h:435
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21