SU2
adt_structure.hpp
Go to the documentation of this file.
1 
36 #pragma once
37 
38 #include <string>
39 #include <fstream>
40 #include <sstream>
41 #include <cmath>
42 #include <vector>
43 #include <algorithm>
44 
45 #include "./mpi_structure.hpp"
46 #include "./option_structure.hpp"
47 
48 using namespace std;
49 
57 private:
58  const su2double *pointCoor;
59  const unsigned short splitDirection;
60  const unsigned short nDim;
62 public:
69  su2_adtComparePointClass(const su2double *coor,
70  const unsigned short splitDir,
71  const unsigned short nDimADT);
76 
82  bool operator()(const unsigned long p0,
83  const unsigned long p1) const;
84 private:
89 };
90 
98 public:
99  bool childrenAreTerminal[2];
100  unsigned long children[2];
103  unsigned long centralNodeID;
105  su2double *xMin;
107  su2double *xMax;
114 
118  ~su2_adtNodeClass();
119 
124  su2_adtNodeClass(const su2_adtNodeClass &other);
125 
130  su2_adtNodeClass& operator=(const su2_adtNodeClass &other);
131 
132 private:
133 
138  void Copy(const su2_adtNodeClass &other);
139 };
140 
148 protected:
149  unsigned long nLeaves;
150  unsigned short nDimADT;
151  bool isEmpty;
153  vector<su2_adtNodeClass> leaves;
155 private:
156  vector<su2double> coorMinLeaves;
158  vector<su2double> coorMaxLeaves;
160 protected:
165 
169  virtual ~su2_adtBaseClass();
170 
177  void BuildADT(unsigned short nDim,
178  unsigned long nPoints,
179  const su2double *coor);
180 public:
186  bool IsEmpty(void) const;
187 
188 private:
193 
197  su2_adtBaseClass& operator=(const su2_adtBaseClass &);
198 };
199 
207 private:
208  vector<unsigned long> frontLeaves;
209  vector<unsigned long> frontLeavesNew;
211  vector<su2double> coorPoints;
213  vector<unsigned long> localPointIDs;
215  vector<int> ranksOfPoints;
217 public:
225  su2_adtPointsOnlyClass(unsigned short nDim,
226  unsigned long nPoints,
227  const su2double *coor,
228  const unsigned long *pointID);
229 
234 
243  void DetermineNearestNode(const su2double *coor,
244  su2double &dist,
245  unsigned long &pointID,
246  int &rankID);
247 private:
252 
257 
262 };
263 
264 #include "adt_structure.inl"
bool isEmpty
Whether or not the ADT is empty.
Definition: adt_structure.hpp:151
unsigned long nLeaves
Number of leaves in the ADT.
Definition: adt_structure.hpp:149
vector< su2_adtNodeClass > leaves
Vector, which contains all the leaves of the ADT.
Definition: adt_structure.hpp:153
Defines classes for referencing options for easy input in CConfig.
In-Line subroutines of the adt_structure.hpp file.
Headers of the mpi interface for generalized datatypes. The subroutines and functions are in the mpi_...
Class for storing an ADT of only points in an arbitrary number of dimensions.
Definition: adt_structure.hpp:206
Functor, used for the sorting of the points when building an ADT.
Definition: adt_structure.hpp:56
unsigned long centralNodeID
ID of a node, which is near the center of the leaf.
Definition: adt_structure.hpp:103
unsigned short nDimADT
Number of dimensions of the ADT.
Definition: adt_structure.hpp:150
Base class for storing an ADT in an arbitrary number of dimensions.
Definition: adt_structure.hpp:147
su2double * xMin
The minimum coordinates of this leaf. It points to a position in the large vector, which contains the coordinates of all leaves.
Definition: adt_structure.hpp:105
Class for storing the information needed in a node of an ADT.
Definition: adt_structure.hpp:97
su2double * xMax
The maximum coordinates of this leaf. It points to a position in the large vector, which contains the coordinates of all leaves.
Definition: adt_structure.hpp:107