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.
search_based_functions.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 //
9 // ==============================================================================
10 
11 #ifndef SEARCH_BASED_FUNCTIONS
12 #define SEARCH_BASED_FUNCTIONS
13 
14 // ------------------------------------------------------------------------------
15 // System includes
16 // ------------------------------------------------------------------------------
17 #include <iostream>
18 #include <string>
19 
20 // ------------------------------------------------------------------------------
21 // Project includes
22 // ------------------------------------------------------------------------------
23 #include "includes/define.h"
24 #include "includes/model_part.h"
26 
27 // ==============================================================================
28 
29 namespace Kratos
30 {
31 
34 
38 
39 
43 
47 
51 
53 
57 class KRATOS_API(SHAPE_OPTIMIZATION_APPLICATION) SearchBasedFunctions
58 {
59 public:
62 
63  // For better reading
66 
67  // Type definitions for tree-search
69  typedef ModelPart::NodeType::Pointer NodeTypePointer;
70  typedef std::vector<NodeTypePointer> NodeVector;
71  typedef std::vector<NodeTypePointer>::iterator NodeVectorIterator;
72  typedef std::vector<double> DoubleVector;
73  typedef std::vector<double>::iterator DoubleVectorIterator;
76 
79 
83 
85  SearchBasedFunctions( ModelPart& modelPart );
86 
89  {
90  }
91 
92 
96 
97 
101 
102  // --------------------------------------------------------------------------
103  void FlagNodesInRadius( ModelPart::NodesContainerType& rNodeSet, const Kratos::Flags& rFlag, double filter_radius);
104 
105  // --------------------------------------------------------------------------
106 
110 
111 
115 
116 
120 
122  virtual std::string Info() const
123  {
124  return "SearchBasedFunctions";
125  }
126 
128  virtual void PrintInfo(std::ostream& rOStream) const
129  {
130  rOStream << "SearchBasedFunctions";
131  }
132 
134  virtual void PrintData(std::ostream& rOStream) const
135  {
136  }
137 
138 
142 
143 
145 
146 protected:
149 
150 
154 
155 
159 
160 
164 
165 
169 
170 
174 
175 
179 
180 
182 
183 private:
186 
187 
191 
192  ModelPart& mrModelPart;
193  const unsigned int mBucketSize = 0;
194  unsigned int mMaxNeighborNodes = 0;
195 
196  NodeVector mListOfNodesInModelPart;
197  KDTree::Pointer mpSearchTree;
198 
202 
203 
207 
211 
212 
216 
217 
221 
223 // SearchBasedFunctions& operator=(SearchBasedFunctions const& rOther);
224 
226 // SearchBasedFunctions(SearchBasedFunctions const& rOther);
227 
228 
230 
231 }; // Class SearchBasedFunctions
232 
234 
237 
238 
242 
244 
245 
246 } // namespace Kratos.
247 
248 #endif // SEARCH_BASED_FUNCTIONS
Short class definition.
Definition: bucket.h:57
Definition: flags.h:58
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
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
Short class definition.
Definition: search_based_functions.h:58
Bucket< 3, NodeType, NodeVector, NodeTypePointer, NodeVectorIterator, DoubleVectorIterator > BucketType
Definition: search_based_functions.h:74
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: search_based_functions.h:134
virtual std::string Info() const
Turn back information as a string.
Definition: search_based_functions.h:122
std::vector< double > DoubleVector
Definition: search_based_functions.h:72
std::vector< NodeTypePointer > NodeVector
Definition: search_based_functions.h:70
ModelPart::NodeType::Pointer NodeTypePointer
Definition: search_based_functions.h:69
std::vector< NodeTypePointer >::iterator NodeVectorIterator
Definition: search_based_functions.h:71
ModelPart::NodeType NodeType
Definition: search_based_functions.h:68
Tree< KDTreePartition< BucketType > > KDTree
Definition: search_based_functions.h:75
array_1d< double, 3 > array_3d
Definition: search_based_functions.h:64
KRATOS_CLASS_POINTER_DEFINITION(SearchBasedFunctions)
Pointer definition of SearchBasedFunctions.
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: search_based_functions.h:65
virtual ~SearchBasedFunctions()
Destructor.
Definition: search_based_functions.h:88
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: search_based_functions.h:128
std::vector< double >::iterator DoubleVectorIterator
Definition: search_based_functions.h:73
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21