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

AMR grid stuff. More...

Classes

class  Block
 This class is a generic data block of a octree node in the block-based AMR mesh. More...
 
class  Field
 Template class for any scalar field variable in the domain. More...
 
class  Octree
 Class to store octree datastructure as nodes of the tree. More...
 
class  VecField
 Template class for any vector field variable in the domain. More...
 

Typedefs

typedef node_boundary_flags NodeBc
 
typedef field_boundary_flags FieldBc
 
typedef direction Dir
 
typedef position Pos
 

Enumerations

enum  node_boundary_flags { NONE, BOUNDARY, MPI_BOUNDARY }
 
enum  field_boundary_flags { none, dirichlet, neumann, mpi_boundary }
 
enum  direction { XDIR, YDIR, ZDIR }
 
enum  position { RIGHT, LEFT }
 

Functions

void refine_nodes ()
 
void coarsen_nodes ()
 
void reset_refine_flags ()
 
void reset_coarsen_flags ()
 
void set_refine_flag_based_on_gradient ()
 
void set_coarsen_flag_based_on_gradient ()
 
void recheck_siblings_coarsen_flags ()
 
void set_FieldBc_FieldBcVal (int number, std::string name, FieldBc **bc, double **bcval)
 
void set_VecFieldBc_VecFieldBcVal (int number, std::string name, FieldBc **xbc, FieldBc **ybc, FieldBc **zbc, double **xbcval, double **ybcval, double **zbcval)
 
void exchange_ghost_val (int level, std::string name)
 
void create_list_of_leaf_nodes ()
 
void create_list_of_root_nodes ()
 
void create_lists_of_level_nodes ()
 
void create_node (int blocknumber, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int level, NodeBc **bc)
 
void reassign_neighbours ()
 
void set_root_neighbours ()
 
void print_neighbour_information (std::list< Octree * > &nodes)
 
void exchange_ghost_values_of_level (int level)
 
void OctreeGrid ()
 
long int get_point (int i, int j, int k, int Npx, int Npy)
 
void write_vtk (std::list< Octree * > &nodes)
 

Variables

int max_level
 
int pad = 2
 
std::vector< std::string > scalar_fields
 
std::vector< std::string > vector_fields
 
int nx_block = 20
 
int ny_block = 20
 
int nz_block = 10
 
std::list< Octree * > nodes
 
std::list< Octree * > leaf_nodes
 
std::list< Octree * > root_nodes
 
std::list< Octree * > level_nodes [20]
 

Detailed Description

AMR grid stuff.

Namespace containing things related to grid

Typedef Documentation

Definition at line 13 of file direction.h.

Definition at line 25 of file boundary.h.

Definition at line 14 of file boundary.h.

Definition at line 21 of file direction.h.

Enumeration Type Documentation

Enumerator
XDIR 
YDIR 
ZDIR 

Definition at line 5 of file direction.h.

Enumerator
none 
dirichlet 
neumann 
mpi_boundary 

Definition at line 16 of file boundary.h.

Enumerator
NONE 
BOUNDARY 
MPI_BOUNDARY 

Definition at line 7 of file boundary.h.

Enumerator
RIGHT 
LEFT 

Definition at line 15 of file direction.h.

Function Documentation

void myOctree::coarsen_nodes ( )

Removes the leaf nodes based on the coarsen criteria and nesting condition.

Definition at line 85 of file adapt.cpp.

void myOctree::create_list_of_leaf_nodes ( )

Creates a list of leaf nodes. Clears the old list before creating the new one.

Definition at line 21 of file octreegrid.cpp.

void myOctree::create_list_of_root_nodes ( )

Creates a new list of root nodes. Clears the old list before creating the new one.

Definition at line 32 of file octreegrid.cpp.

void myOctree::create_lists_of_level_nodes ( )

Creates a vector of lists of nodes on each level. Clears the old lists before creating the new one.

Definition at line 43 of file octreegrid.cpp.

void myOctree::create_node ( int  blocknumber,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
int  level,
NodeBc **  bc 
)

Creates an octree node

Definition at line 60 of file octreegrid.cpp.

void myOctree::exchange_ghost_val ( int  level,
std::string  name 
)

Exchanges ghost values of the given field at the given level

Definition at line 10 of file ghost.cpp.

void myOctree::exchange_ghost_values_of_level ( int  level)

Exchanges ghost values of all the user defined Scalar and Vector fields at the given level

Definition at line 238 of file octreegrid.cpp.

long int myOctree::get_point ( int  i,
int  j,
int  k,
int  Npx,
int  Npy 
)

Returns the sequential number of the point within the block using the coordinate locations.

Definition at line 8 of file vtk.cpp.

void myOctree::OctreeGrid ( )

Sets up octree AMR grid

Definition at line 251 of file octreegrid.cpp.

void myOctree::print_neighbour_information ( std::list< Octree * > &  nodes)

Prints the centre coordinates of the neighbours of the given list of nodes.

This can be used to test correctness in the assignment of neighbours.

Definition at line 215 of file octreegrid.cpp.

void myOctree::reassign_neighbours ( )

Reassigns neighbours after coarsening or refining the grid and after creating lists of level_nodes.

Neighbours are assigned during refinement but since coarsening and refinement is a sequential process, neighbours might not have been created and a NULL would have been assigned.

So this function is to be called after all refinement or coarsening is complete in every time step to ensure correct assignment of neighbours.

Definition at line 90 of file octreegrid.cpp.

void myOctree::recheck_siblings_coarsen_flags ( )

Checks if all the siblings of a node are set to coarsening, else the flag is removed.

This ensures nesting.

Definition at line 253 of file adapt.cpp.

void myOctree::refine_nodes ( )

Refines the leaf nodes based on the refinement criteria and nesting condition.

Definition at line 39 of file adapt.cpp.

void myOctree::reset_coarsen_flags ( )

Resets all coarsen flags.

This is to be called after coarsening step is complete.

Definition at line 128 of file adapt.cpp.

void myOctree::reset_refine_flags ( )

Resets all refine flags.

This is to be called after refinement step is complete.

Definition at line 116 of file adapt.cpp.

void myOctree::set_coarsen_flag_based_on_gradient ( )

Calculates the field gradient and sets the coarsening flags accordingly.

Definition at line 193 of file adapt.cpp.

void myOctree::set_FieldBc_FieldBcVal ( int  number,
std::string  name,
FieldBc **  bc,
double **  bcval 
)

Sets boundary conditions to blocks and boundary condition values to ghost cells in the blocks of the given scalar field.

Definition at line 9 of file boundary.cpp.

void myOctree::set_refine_flag_based_on_gradient ( )

Calculates the field gradient and sets the refinement flags accordingly.

Definition at line 138 of file adapt.cpp.

void myOctree::set_root_neighbours ( )

Assigns neighours to root nodes

Definition at line 149 of file octreegrid.cpp.

void myOctree::set_VecFieldBc_VecFieldBcVal ( int  number,
std::string  name,
FieldBc **  xbc,
FieldBc **  ybc,
FieldBc **  zbc,
double **  xbcval,
double **  ybcval,
double **  zbcval 
)

Sets boundary conditions to blocks and boundary condition values to ghost cells in the blocks of the given vector field.

Definition at line 57 of file boundary.cpp.

void myOctree::write_vtk ( std::list< Octree * > &  nodes)

Writes vtk files for post-processing.

Definition at line 22 of file vtk.cpp.

Variable Documentation

std::list< Octree * > myOctree::leaf_nodes

Definition at line 15 of file octreegrid.cpp.

std::list< Octree * > myOctree::level_nodes

Definition at line 17 of file octreegrid.cpp.

int myOctree::max_level

Definition at line 8 of file adapt.cpp.

std::list< Octree * > myOctree::nodes

Definition at line 14 of file octreegrid.cpp.

int myOctree::nx_block = 20

Definition at line 10 of file block.cpp.

int myOctree::ny_block = 20

Definition at line 11 of file block.cpp.

int myOctree::nz_block = 10

Definition at line 12 of file block.cpp.

int myOctree::pad = 2

Definition at line 7 of file block.cpp.

std::list< Octree * > myOctree::root_nodes

Definition at line 16 of file octreegrid.cpp.

std::vector< std::string > myOctree::scalar_fields

Definition at line 8 of file block.cpp.

std::vector< std::string > myOctree::vector_fields

Definition at line 9 of file block.cpp.