Documentation 6b54b78464
Loading...
Searching...
No Matches
CADTBaseClass.hpp
Go to the documentation of this file.
1/*!
2 * \file CADTBaseClass.hpp
3 * \brief Base class for storing an ADT in an arbitrary number of dimensions.
4 * \author E. van der Weide
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include <vector>
31#include <array>
32
33#include "../basic_types/datatype_structure.hpp"
34#include "./CADTNodeClass.hpp"
35#include "../parallelization/omp_structure.hpp"
36
37using namespace std;
38
39/*!
40 * \class CADTBaseClass
41 * \ingroup ADT
42 * \brief Base class for storing an ADT in an arbitrary number of dimensions.
43 * \author E. van der Weide
44 */
46 protected:
47 unsigned long nLeaves; /*!< \brief Number of leaves in the ADT. */
48 unsigned short nDimADT; /*!< \brief Number of dimensions of the ADT. */
49 bool isEmpty; /*!< \brief Whether or not the ADT is empty. */
50
51 vector<CADTNodeClass> leaves; /*!< \brief Vector, which contains all the leaves of the ADT. */
52
53#ifdef HAVE_OMP
54 vector<vector<unsigned long> > FrontLeaves; /*!< \brief Vector used in the tree traversal. */
55 vector<vector<unsigned long> > FrontLeavesNew; /*!< \brief Vector used in the tree traversal. */
56#else
57 array<vector<unsigned long>, 1> FrontLeaves;
58 array<vector<unsigned long>, 1> FrontLeavesNew;
59#endif
60 private:
61 vector<su2double> coorMinLeaves; /*!< \brief Vector, which contains all the minimum coordinates
62 of the leaves. */
63 vector<su2double> coorMaxLeaves; /*!< \brief Vector, which contains all the maximum coordinates
64 of the leaves. */
65 protected:
66 /*!
67 * \brief Constructor of the class. Nothing to be done.
68 */
69 CADTBaseClass() = default;
70
71 /*--- Disable copy operations ---*/
72 CADTBaseClass(const CADTBaseClass&) = delete;
74
75 /*!
76 * \brief Function, which builds the ADT of the given coordinates.
77 * \param[in] nDim Number of dimensions of the ADT.
78 * \param[in] nPoints Number of points present in the ADT.
79 * \param[in] coor Coordinates of the points.
80 */
81 void BuildADT(unsigned short nDim, unsigned long nPoints, const su2double* coor);
82
83 public:
84 /*!
85 * \brief Function, which returns whether or not the ADT is empty.
86 * \return Whether or not the ADT is empty.
87 */
88 inline bool IsEmpty(void) const { return isEmpty; }
89};
Class for storing the information needed in a node of an ADT.
Base class for storing an ADT in an arbitrary number of dimensions.
Definition CADTBaseClass.hpp:45
array< vector< unsigned long >, 1 > FrontLeaves
Definition CADTBaseClass.hpp:57
array< vector< unsigned long >, 1 > FrontLeavesNew
Definition CADTBaseClass.hpp:58
unsigned long nLeaves
Number of leaves in the ADT.
Definition CADTBaseClass.hpp:47
CADTBaseClass & operator=(const CADTBaseClass &)=delete
CADTBaseClass(const CADTBaseClass &)=delete
void BuildADT(unsigned short nDim, unsigned long nPoints, const su2double *coor)
Function, which builds the ADT of the given coordinates.
Definition CADTBaseClass.cpp:34
CADTBaseClass()=default
Constructor of the class. Nothing to be done.
unsigned short nDimADT
Number of dimensions of the ADT.
Definition CADTBaseClass.hpp:48
bool isEmpty
Whether or not the ADT is empty.
Definition CADTBaseClass.hpp:49
vector< CADTNodeClass > leaves
Vector, which contains all the leaves of the ADT.
Definition CADTBaseClass.hpp:51
bool IsEmpty(void) const
Function, which returns whether or not the ADT is empty.
Definition CADTBaseClass.hpp:88
passivedouble su2double
Definition code_config.hpp:181