AMR-Solver  1.0
Block-based Octree AMR grid flow solver
octree.h
Go to the documentation of this file.
1 #ifndef MYOCTREE_OCTREE_H_
2 #define MYOCTREE_OCTREE_H_
3 #include <stdio.h>
4 #include <list>
5 #include <vector>
6 #include "block.h"
7 #include "boundary.h"
8 
9 namespace myOctree {
10 
11 
12 //class forward declaration
13 class Octree;
14 extern std::list<Octree*> nodes;
15 
17 
26 class Octree {
27 
28  public:
29  Octree();
31  Octree( double x1, double x2, double y1, double y2, double z1, double z2, int l );
33  Octree(const Octree &obj);
35  ~Octree();
37  void refine();
39  bool isLeafNode();
41  bool isRootNode();
43  /*change it to containsPoint*/
44  bool contains(double x, double y, double z);
46  int get_level();
48  Octree* get_child_at(int, int, int);
50  Octree* get_parent();
52  void set_child_null_at(int, int, int);
60  bool setToRefine;
62  bool setToCoarsen;
64  //neighbors
65  /*change this to neighbour[direction][position]*/
66 // Octree *east;
67 // Octree *west;
68 // Octree *north;
69 // Octree *south;
70 // Octree *top;
71 // Octree *bottom;
72 
73  Octree *neighbour[3][2];
74 
75  //boundary conditions
76  /*same as above */
77 // NodeBc east_bc;
78 // NodeBc west_bc;
79 // NodeBc north_bc;
80 // NodeBc south_bc;
81 // NodeBc top_bc;
82 // NodeBc bottom_bc;
83 
84  NodeBc bc[3][2];
86  //boundary values
87  /*same as above */
88 // double east_bc_val;
89 // double west_bc_val;
90 // double north_bc_val;
91 // double south_bc_val;
92 // double top_bc_val;
93 // double bottom_bc_val;
94 
98  double x_min, x_max;
99  double y_min, y_max;
100  double z_min, z_max;
102 
103 
104  int number;
105 
106 
107  private:
108  Octree *children[2][2][2];
114  int level;
117  protected:
118 
119 };
120 
121 
122 }
123 #endif
bool isRootNode()
Definition: octree.cpp:15
This class is a generic data block of a octree node in the block-based AMR mesh.
Definition: block.h:26
void set_child_null_at(int, int, int)
Definition: octree.cpp:44
int get_level()
Definition: octree.cpp:32
Octree * children[2][2][2]
Definition: octree.h:108
Octree * neighbour[3][2]
Definition: octree.h:73
bool contains(double x, double y, double z)
Definition: octree.cpp:25
NodeBc bc[3][2]
Definition: octree.h:84
Block * block_data
Definition: octree.h:110
double z_min
Definition: octree.h:100
Octree * get_child_at(int, int, int)
Definition: octree.cpp:38
double y_centre
Definition: octree.h:97
bool isLeafNode()
Definition: octree.cpp:10
double z_max
Definition: octree.h:100
bool setToCoarsen
Definition: octree.h:62
bool setToRefine
Definition: octree.h:60
double x_max
Definition: octree.h:98
void set_to_coarsen_with_nesting()
Definition: octree.cpp:126
void set_to_refine_with_nesting()
Definition: octree.cpp:56
double x_centre
Definition: octree.h:97
double z_centre
Definition: octree.h:97
Class to store octree datastructure as nodes of the tree.
Definition: octree.h:26
double y_max
Definition: octree.h:99
AMR grid stuff.
Definition: adapt.cpp:6
std::list< Octree * > nodes
Definition: octreegrid.cpp:14
Octree * get_parent()
Definition: octree.cpp:50
node_boundary_flags
Definition: boundary.h:7
Block * get_block_data()
Definition: octree.cpp:20
double y_min
Definition: octree.h:99
double x_min
Definition: octree.h:98
Octree * parent
Definition: octree.h:112