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