Finite Element Domain Decomposition Library
FEDDLib
Toggle main menu visibility
Loading...
Searching...
No Matches
AABBTree_decl.hpp
1
#ifndef AABBTree_decl_hpp
2
#define AABBTree_decl_hpp
3
4
#include <list>
5
#include <map>
6
#include <tuple>
7
8
#include "feddlib/core/FEDDCore.hpp"
9
#include "feddlib/core/General/DefaultTypeDefs.hpp"
10
#include "feddlib/core/LinearAlgebra/MultiVector.hpp"
11
#include "feddlib/core/FE/Elements.hpp"
12
13
22
23
namespace
FEDD
{
24
template
<
class
SC = default_sc,
class
LO = default_lo,
class
GO = default_go,
class
NO = default_no>
25
class
AABBTree {
26
private
:
27
// Private Variables
28
29
// Whether the AABBTree is empty
30
bool
empty_;
31
32
// Dimension of the rectangles. 2 and above are acceptable values
33
int
dim_;
34
35
// Number of rectangles (i.e. nodes) stored in the tree
36
int
numNodes_;
37
38
// double-Vector with two columns and numNodes rows
39
// containing min_x and min_y for each rectangle
40
vec2D_dbl_ptr_Type minXY_;
41
42
// double-Vector with two columns and numNodes rows
43
// containing max_x and max_y for each rectangle
44
vec2D_dbl_ptr_Type maxXY_;
45
46
// List-Vector with numNodes rows and one column,
47
// containing the Elements stored in each node.
48
std::vector<std::list<int> > containedElements_;
49
50
// int-Vector with numNodes rows and two columns
51
// containing parent/child pointers associated with each node
52
vec2D_int_ptr_Type parentChild_;
53
54
// Private Methods
55
56
public
:
57
typedef
Elements
Elements_Type;
58
typedef
Teuchos::RCP<Elements_Type> ElementsPtr_Type;
59
// Public Variables
60
// Public Methods
61
// Default Constructor
62
AABBTree();
63
64
void
createTreeFromElements(
65
ElementsPtr_Type elems,
66
vec2D_dbl_ptr_Type nodes,
67
int
numberObjects = 32,
68
double
longTol = 0.75,
69
double
volumeTol = 0.55,
70
bool
verbose =
false
71
);
72
73
void
createTreeFromRectangles(
74
vec2D_dbl_ptr_Type init_min_maxXY,
75
int
numberObjects = 32,
76
double
longTol = 0.75,
77
double
volumeTol = 0.55,
78
bool
verbose =
false
79
);
80
81
std::tuple<std::map<int, std::list<int>>, std::map<int, std::list<int> > > scanTree(
82
vec2D_dbl_ptr_Type query_points,
83
bool
verbose
84
);
85
86
87
bool
isInRectangle(
88
int
number_rectangle,
89
vec_dbl_Type query_point,
90
bool
verbose
91
);
92
93
bool
isEmpty();
94
95
int
getDim();
96
97
int
getNumNodes();
98
99
// Returns the elements contained in node
100
std::list<int> getElements(
int
node);
101
102
};
103
}
104
105
#endif
FEDD::Elements
Definition
Elements.hpp:23
FEDD
Adaptive Mesh Refinement.
Definition
AdaptiveMeshRefinement_decl.hpp:36
feddlib
core
Mesh
AABBTree_decl.hpp
Generated by
1.17.0