AMR-Solver  1.0
Block-based Octree AMR grid flow solver
myOctree::Octree Class Reference

Class to store octree datastructure as nodes of the tree. More...

#include <octree.h>

Public Member Functions

 Octree ()
 
 Octree (double x1, double x2, double y1, double y2, double z1, double z2, int l)
 
 Octree (const Octree &obj)
 
 ~Octree ()
 
void refine ()
 
bool isLeafNode ()
 
bool isRootNode ()
 
bool contains (double x, double y, double z)
 
int get_level ()
 
Octreeget_child_at (int, int, int)
 
Octreeget_parent ()
 
void set_child_null_at (int, int, int)
 
Blockget_block_data ()
 
void set_to_refine_with_nesting ()
 
void set_to_coarsen_with_nesting ()
 

Public Attributes

bool setToRefine
 
bool setToCoarsen
 
Octreeneighbour [3][2]
 
NodeBc bc [3][2]
 
int number
 
Node's block dimensions
double x_centre
 
double y_centre
 
double z_centre
 
double x_min
 
double x_max
 
double y_min
 
double y_max
 
double z_min
 
double z_max
 

Private Attributes

Octreechildren [2][2][2]
 
Blockblock_data
 
Octreeparent
 
int level
 

Detailed Description

Class to store octree datastructure as nodes of the tree.

Objects of this class are nodes of the tree. When a new object is created, children are assigned, parent is assigned, data block is assigned and finally the pointer of the object is pushed into the "nodes" list.

Usage: Octree object_name(x min, x max, y min, y max, z min, z max, level); This creates a node of the tree at the specified level. This object can be further refined or coarsened using member functions of this class.

Definition at line 26 of file octree.h.

Constructor & Destructor Documentation

myOctree::Octree::Octree ( )

Default constructor

Definition at line 537 of file octree.cpp.

myOctree::Octree::Octree ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2,
int  l 
)

Parametrized constructor with initialization fields

Definition at line 480 of file octree.cpp.

myOctree::Octree::Octree ( const Octree obj)

Copy constructor

Definition at line 418 of file octree.cpp.

myOctree::Octree::~Octree ( )

Destructor

Definition at line 411 of file octree.cpp.

Member Function Documentation

bool myOctree::Octree::contains ( double  x,
double  y,
double  z 
)

/Function to test if the point lies inside the block

Definition at line 25 of file octree.cpp.

Block * myOctree::Octree::get_block_data ( )

Function to access block data

Definition at line 20 of file octree.cpp.

Octree * myOctree::Octree::get_child_at ( int  i,
int  j,
int  k 
)

Function that returns pointer to the child at indices (relative)

Definition at line 38 of file octree.cpp.

int myOctree::Octree::get_level ( )

Function that returns the level of the node

Definition at line 32 of file octree.cpp.

Octree * myOctree::Octree::get_parent ( )

Function that returns pointer to the parent

Definition at line 50 of file octree.cpp.

bool myOctree::Octree::isLeafNode ( )

/Function to test if leaf node

Definition at line 10 of file octree.cpp.

bool myOctree::Octree::isRootNode ( )

Function to test if root node

Definition at line 15 of file octree.cpp.

void myOctree::Octree::refine ( )

Function to add 8 children

  • Creates children nodes,
  • Sets neighbours to children nodes,
  • Sets boundaries to children nodes,
  • Sets boundary conditions to children fields

Definition at line 182 of file octree.cpp.

void myOctree::Octree::set_child_null_at ( int  i,
int  j,
int  k 
)

Function that sets child pointer at indices (relative) to NULL

Definition at line 44 of file octree.cpp.

void myOctree::Octree::set_to_coarsen_with_nesting ( )

Sets on coarsen flag with nesting

Definition at line 126 of file octree.cpp.

void myOctree::Octree::set_to_refine_with_nesting ( )

Sets on refine flag with nesting

Definition at line 56 of file octree.cpp.

Member Data Documentation

NodeBc myOctree::Octree::bc[3][2]

Node boundary conditions

Definition at line 84 of file octree.h.

Block* myOctree::Octree::block_data
private

Pointer to the block data

Definition at line 110 of file octree.h.

Octree* myOctree::Octree::children[2][2][2]
private

Each node has upto 8 children (2^3 for 3 dimensions)

Definition at line 108 of file octree.h.

int myOctree::Octree::level
private

Level in the tree

Definition at line 114 of file octree.h.

Octree* myOctree::Octree::neighbour[3][2]

Definition at line 73 of file octree.h.

int myOctree::Octree::number

Definition at line 104 of file octree.h.

Octree* myOctree::Octree::parent
private

Pointer to the parent

Definition at line 112 of file octree.h.

bool myOctree::Octree::setToCoarsen

Coarsen flag

Definition at line 62 of file octree.h.

bool myOctree::Octree::setToRefine

Refinement flag

Definition at line 60 of file octree.h.

double myOctree::Octree::x_centre

Definition at line 97 of file octree.h.

double myOctree::Octree::x_max

Definition at line 98 of file octree.h.

double myOctree::Octree::x_min

Definition at line 98 of file octree.h.

double myOctree::Octree::y_centre

Definition at line 97 of file octree.h.

double myOctree::Octree::y_max

Definition at line 99 of file octree.h.

double myOctree::Octree::y_min

Definition at line 99 of file octree.h.

double myOctree::Octree::z_centre

Definition at line 97 of file octree.h.

double myOctree::Octree::z_max

Definition at line 100 of file octree.h.

double myOctree::Octree::z_min

Definition at line 100 of file octree.h.


The documentation for this class was generated from the following files: