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.
damping_utilities.h
Go to the documentation of this file.
1 // ==============================================================================
2 // KratosShapeOptimizationApplication
3 //
4 // License: BSD License
5 // license: ShapeOptimizationApplication/license.txt
6 //
7 // Main authors: Baumgaertner Daniel, https://github.com/dbaumgaertner,
8 // Willer Matthias, https://github.com/matthiaswiller
9 //
10 // ==============================================================================
11 
12 #ifndef DAMPING_UTILITIES_H
13 #define DAMPING_UTILITIES_H
14 
15 // ------------------------------------------------------------------------------
16 // System includes
17 // ------------------------------------------------------------------------------
18 #include <iostream>
19 #include <string>
20 
21 // ------------------------------------------------------------------------------
22 // Project includes
23 // ------------------------------------------------------------------------------
24 #include "includes/model_part.h"
26 #include "custom_utilities/filter_function.h"
27 
28 // ==============================================================================
29 
30 namespace Kratos
31 {
32 
35 
39 
43 
47 
51 
53 
57 class KRATOS_API(SHAPE_OPTIMIZATION_APPLICATION) DampingUtilities
58 {
59 public:
62 
63  // Type definitions for better reading later
66  typedef ModelPart::NodeType::Pointer NodeTypePointer;
67  typedef std::vector<NodeTypePointer> NodeVector;
68  typedef std::vector<NodeTypePointer>::iterator NodeVectorIterator;
69  typedef std::vector<double> DoubleVector;
70  typedef std::vector<double>::iterator DoubleVectorIterator;
71 
72  // Type definitions for tree-search
75 
78 
82 
84  DampingUtilities( ModelPart& modelPartToDamp, Parameters DampingSettings );
85 
88  {
89  }
90 
91 
95 
96 
100 
101  // ==============================================================================
102  void CreateListOfNodesOfModelPart();
103 
104  // --------------------------------------------------------------------------
105  void CreateSearchTreeWithAllNodesOfModelPart();
106 
107  // --------------------------------------------------------------------------
108  void InitalizeDampingFactorsToHaveNoInfluence();
109 
110  // --------------------------------------------------------------------------
111  void SetDampingFactorsForAllDampingRegions();
112 
113  // --------------------------------------------------------------------------
114  FilterFunction::Pointer CreateDampingFunction( std::string damping_type ) const;
115 
116  // --------------------------------------------------------------------------
117  void ThrowWarningIfNodeNeighborsExceedLimit( const ModelPart::NodeType& given_node, const unsigned int number_of_neighbors ) const;
118 
119  // --------------------------------------------------------------------------
120  void DampNodalVariable( const Variable<array_3d> &rNodalVariable );
121 
122  // ==============================================================================
123 
127 
128 
132 
133 
137 
139  virtual std::string Info() const
140  {
141  return "DampingUtilities";
142  }
143 
145  virtual void PrintInfo(std::ostream& rOStream) const
146  {
147  rOStream << "DampingUtilities";
148  }
149 
151  virtual void PrintData(std::ostream& rOStream) const
152  {
153  }
154 
155 
159 
160 
162 
163 protected:
166 
167 
171 
172 
176 
177 
181 
182 
186 
187 
191 
192 
196 
197 
199 
200 private:
203 
204 
208 
209  // ==============================================================================
210  // Initialized by class constructor
211  // ==============================================================================
212  ModelPart& mrModelPartToDamp;
213  Parameters mDampingSettings;
214 
215  // ==============================================================================
216  // Variables for spatial search
217  // ==============================================================================
218  unsigned int mBucketSize = 100;
219  unsigned int mMaxNeighborNodes = 10000;
220  NodeVector mListOfNodesOfModelPart;
221  KDTree::Pointer mpSearchTree;
222 
226 
227 
231 
232 
236 
237 
241 
242 
246 
248 // DampingUtilities& operator=(DampingUtilities const& rOther);
249 
251 // DampingUtilities(DampingUtilities const& rOther);
252 
253 
255 
256 }; // Class DampingUtilities
257 
259 
262 
263 
267 
269 
270 
271 } // namespace Kratos.
272 
273 #endif // DAMPIG_UTILITIES_H
Short class definition.
Definition: bucket.h:57
Short class definition.
Definition: damping_utilities.h:58
std::vector< NodeTypePointer > NodeVector
Definition: damping_utilities.h:67
Bucket< 3, NodeType, NodeVector, NodeTypePointer, NodeVectorIterator, DoubleVectorIterator > BucketType
Definition: damping_utilities.h:73
ModelPart::NodeType::Pointer NodeTypePointer
Definition: damping_utilities.h:66
std::vector< double > DoubleVector
Definition: damping_utilities.h:69
virtual std::string Info() const
Turn back information as a string.
Definition: damping_utilities.h:139
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: damping_utilities.h:151
virtual ~DampingUtilities()
Destructor.
Definition: damping_utilities.h:87
ModelPart::NodeType NodeType
Definition: damping_utilities.h:65
Tree< KDTreePartition< BucketType > > KDTree
Definition: damping_utilities.h:74
array_1d< double, 3 > array_3d
Definition: damping_utilities.h:64
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: damping_utilities.h:145
KRATOS_CLASS_POINTER_DEFINITION(DampingUtilities)
Pointer definition of DampingUtilities.
std::vector< double >::iterator DoubleVectorIterator
Definition: damping_utilities.h:70
std::vector< NodeTypePointer >::iterator NodeVectorIterator
Definition: damping_utilities.h:68
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
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