Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
bitpit::Octant Class Reference

Octant class definition. More...

#include <Octant.hpp>

Public Member Functions

 Octant ()
 
std::vector< OctantbuildChildren () const
 
void buildChildren (Octant *children) const
 
Octant buildFather () const
 
Octant buildLastDesc () const
 
u32array3 computeFatherCoordinates () const
 
uint64_t computeFatherMorton () const
 
u32array3 computeLastDescCoordinates () const
 
uint64_t computeLastDescMorton () const
 
uint64_t computeNodePersistentKey (const u32array3 &node) const
 
uint64_t computeNodePersistentKey (uint8_t inode) const
 
uint8_t countChildren () const
 
bool getBalance () const
 
bool getBound () const
 
bool getBound (uint8_t face) const
 
uint32_t getDim () const
 
bool getEdgeBound (uint8_t edge) const
 
int getGhostLayer () const
 
bool getIsGhost () const
 
bool getIsNewC () const
 
bool getIsNewR () const
 
uint8_t getLevel () const
 
uint64_t getLogicalArea () const
 
darray3 getLogicalCenter () const
 
u32array3 getLogicalCoordinates () const
 
uint32_t getLogicalCoordinates (int coord) const
 
darray3 getLogicalEdgeCenter (uint8_t iedge) const
 
darray3 getLogicalFaceCenter (uint8_t iface) const
 
void getLogicalNode (u32array3 &node, uint8_t inode) const
 
u32array3 getLogicalNode (uint8_t inode) const
 
u32arr3vector getLogicalNodes () const
 
void getLogicalNodes (u32arr3vector &nodes) const
 
uint32_t getLogicalSize () const
 
uint64_t getLogicalVolume () const
 
int8_t getMarker () const
 
uint64_t getMorton () const
 
bool getNodeBound (uint8_t node) const
 
void getNormal (uint8_t iface, i8array3 &normal, const int8_t(&normals)[6][3]) const
 
bool getPbound () const
 
bool getPbound (uint8_t face) const
 

Static Public Member Functions

static unsigned int getBinarySize ()
 

Protected Member Functions

uint8_t getFamilySplittingNode () const
 
void setBalance (bool balance)
 
void setBound (uint8_t face)
 
void setGhostLayer (int ghostLayer)
 
void setLevel (uint8_t level)
 
void setMarker (int8_t marker)
 
void setPbound (uint8_t face, bool flag)
 

Friends

class Global
 
class LocalTree
 
OBinaryStreamoperator<<) (OBinaryStream &buf, const Octant &octant)
 
IBinaryStreamoperator>>) (IBinaryStream &buf, Octant &octant)
 
class ParaTree
 

Detailed Description

Octant class definition.

Date
10/dec/2015
Authors
Edoardo Lombardi
Marco Cisternino

Octants are the grid elements of PABLO. In the logical domain octants are squares or cubes, depending on dimension, with size function of their level. Each octant has nodes and faces ordered with Z-order.

The main feature of each octant are:

Examples
PABLO_example_00001.cpp, and PABLO_example_00006.cpp.

Definition at line 89 of file Octant.hpp.

Constructor & Destructor Documentation

◆ Octant()

bitpit::Octant::Octant ( )

Create a dummy octant.

Definition at line 118 of file Octant.cpp.

Member Function Documentation

◆ buildChildren() [1/2]

vector< Octant > bitpit::Octant::buildChildren ( ) const

Builds children of octant.

Returns
The children of the octant ordered by Z-index (info update)

Definition at line 713 of file Octant.cpp.

◆ buildChildren() [2/2]

void bitpit::Octant::buildChildren ( Octant * children) const

Builds children of octant.

Parameters
[out]childrenOn output will containt the children of the octant ordered by Z-index, it's up to the caller allocate enough space for all the possible children.

Definition at line 729 of file Octant.cpp.

◆ buildFather()

Octant bitpit::Octant::buildFather ( ) const

Build the father octant of this octant.

Returns
Father octant.

Definition at line 689 of file Octant.cpp.

◆ buildLastDesc()

Octant bitpit::Octant::buildLastDesc ( ) const

Build the last descendant octant of this octant.

Returns
Last descendant octant.

Definition at line 678 of file Octant.cpp.

◆ computeFatherCoordinates()

u32array3 bitpit::Octant::computeFatherCoordinates ( ) const

Compute the coordinates (i.e. the coordinates of the node 0) of the father of this octant.

Returns
The coordinates (i.e. the coordinates of the node 0) of the father of this octant.

Definition at line 619 of file Octant.cpp.

◆ computeFatherMorton()

uint64_t bitpit::Octant::computeFatherMorton ( ) const

Compute the Morton index of the father of this octant.

Returns
Morton index of the father of this octant.

Definition at line 609 of file Octant.cpp.

◆ computeLastDescCoordinates()

u32array3 bitpit::Octant::computeLastDescCoordinates ( ) const

Compute the coordinates (i.e. the coordinates of the node 0) of the last descendant octant of this octant.

Returns
The coordinates (i.e. the coordinates of the node 0) of the last descendant octant of this octant.

Definition at line 597 of file Octant.cpp.

◆ computeLastDescMorton()

uint64_t bitpit::Octant::computeLastDescMorton ( ) const

Compute the Morton index of the last descendant octant of this octant.

Returns
Morton index of the last descendant octant.

Definition at line 587 of file Octant.cpp.

◆ computeNodePersistentKey() [1/2]

uint64_t bitpit::Octant::computeNodePersistentKey ( const u32array3 & node) const

Compute the persistent XYZ key of the given node (without level). The XYZ key combines the 32bit coordinates and generates a unique 64bit value (in two dimensions this is always possible, in three dimensions this is possible because with a 64bit wide Morton number not all 32 bits of the coordinates are used).

Parameters
[in]nodeLogical coordinates of the node
Returns
persistent XYZ key of the node.

Definition at line 650 of file Octant.cpp.

◆ computeNodePersistentKey() [2/2]

uint64_t bitpit::Octant::computeNodePersistentKey ( uint8_t inode) const

Compute the persistent XYZ key of the given node (without level). The XYZ key combines the 32bit coordinates and generates a unique 64bit value (in two dimensions this is always possible, in three dimensions this is possible because with a 64bit wide Morton number not all 32 bits of the coordinates are used).

Parameters
[in]inodeLocal index of the node
Returns
persistent XYZ key of the node.

Definition at line 635 of file Octant.cpp.

◆ countChildren()

uint8_t bitpit::Octant::countChildren ( ) const

Count children of octant.

Returns
The number of children of the octant.

Definition at line 700 of file Octant.cpp.

◆ getBalance()

bool bitpit::Octant::getBalance ( ) const

Get if the octant has to be balanced.

Returns
true if the octant has to be balanced.

Definition at line 379 of file Octant.cpp.

◆ getBinarySize()

unsigned int bitpit::Octant::getBinarySize ( )
static

Get the size of the buffer required to communicate the octant.

Returns
Returns the buffer size (in bytes).

Definition at line 658 of file Octant.cpp.

◆ getBound() [1/2]

bool bitpit::Octant::getBound ( ) const

Get the bound flag on an octant.

Returns
true if the octant is a boundary octant.

Definition at line 310 of file Octant.cpp.

◆ getBound() [2/2]

bool bitpit::Octant::getBound ( uint8_t face) const

Get the bound flag on an octant face.

Parameters
[in]facelocal index of the face.
Returns
true if the face is a boundary.

Definition at line 272 of file Octant.cpp.

◆ getDim()

uint32_t bitpit::Octant::getDim ( ) const

Get the dimension of an octant, 2 or 3 if 2D or 3D octant.

Returns
Dimension of octant.

Definition at line 237 of file Octant.cpp.

◆ getEdgeBound()

bool bitpit::Octant::getEdgeBound ( uint8_t edge) const

Get the bound flag on an octant edge.

Parameters
[in]edgelocal index of the edge.
Returns
true if the edge is on a boundary.

Definition at line 281 of file Octant.cpp.

◆ getFamilySplittingNode()

uint8_t bitpit::Octant::getFamilySplittingNode ( ) const
protected

Get the local index of the node corresponding to the splitting node of the octant family; i.e. the index of the local node coincident with the center point of the father.

Returns
Local index of octant node corresponding to the splitting family node.

Definition at line 863 of file Octant.cpp.

◆ getGhostLayer()

int bitpit::Octant::getGhostLayer ( ) const

Get the layer number of the ghost halo an octant belong to.

Returns
the layer in the ghost halo. 0 is for internal (non-ghost) octant.

Definition at line 373 of file Octant.cpp.

◆ getIsGhost()

bool bitpit::Octant::getIsGhost ( ) const

Get if the octant is a scary ghost octant.

Returns
true if the octant is a ghost octant.

Definition at line 367 of file Octant.cpp.

◆ getIsNewC()

bool bitpit::Octant::getIsNewC ( ) const

Get if the octant is new after a coarsening.

Returns
true if the the octant is new after a coarsening.

Definition at line 361 of file Octant.cpp.

◆ getIsNewR()

bool bitpit::Octant::getIsNewR ( ) const

Get if the octant is new after a refinement.

Returns
true if the the octant is new after a refinement.

Definition at line 355 of file Octant.cpp.

◆ getLevel()

uint8_t bitpit::Octant::getLevel ( ) const

Get the level of an octant.

Returns
Level of octant.

Definition at line 259 of file Octant.cpp.

◆ getLogicalArea()

uint64_t bitpit::Octant::getLogicalArea ( ) const

Get the area of an octant in logical domain .

Returns
Area of octant.

Definition at line 440 of file Octant.cpp.

◆ getLogicalCenter()

darray3 bitpit::Octant::getLogicalCenter ( ) const

Get the coordinates of the center of an octant in logical domain.

Returns
Array[3] with the coordinates of the center of octant.

Definition at line 458 of file Octant.cpp.

◆ getLogicalCoordinates() [1/2]

u32array3 bitpit::Octant::getLogicalCoordinates ( ) const

Get the coordinates of an octant, i.e. the coordinates of its node 0.

Returns
Coordinates of node 0.

Definition at line 243 of file Octant.cpp.

◆ getLogicalCoordinates() [2/2]

uint32_t bitpit::Octant::getLogicalCoordinates ( int coord) const

Get the coordinates of an octant, i.e. the coordinates of its node 0.

Returns
Coordinates of node 0.

Definition at line 251 of file Octant.cpp.

◆ getLogicalEdgeCenter()

darray3 bitpit::Octant::getLogicalEdgeCenter ( uint8_t iedge) const

Get the coordinates of the center of a edge of an octant in logical domain.

Parameters
[in]iedgeLocal index of the edge
Returns
Array[3] with the coordinates of the center of the octant edge.

Definition at line 493 of file Octant.cpp.

◆ getLogicalFaceCenter()

darray3 bitpit::Octant::getLogicalFaceCenter ( uint8_t iface) const

Get the coordinates of the center of a face of an octant in logical domain.

Parameters
[in]ifaceLocal index of the face
Returns
Array[3] with the coordinates of the center of the octant face.

Definition at line 474 of file Octant.cpp.

◆ getLogicalNode() [1/2]

void bitpit::Octant::getLogicalNode ( u32array3 & node,
uint8_t inode ) const

Get the coordinates of a nodes of an octant in logical domain.

Parameters
[in]inodeLocal index of the node
[out]nodeArray[3] with the logical coordinates of the node of the octant.

Definition at line 541 of file Octant.cpp.

◆ getLogicalNode() [2/2]

u32array3 bitpit::Octant::getLogicalNode ( uint8_t inode) const

Get the coordinates of a nodes of an octant in logical domain.

Parameters
[in]inodeLocal index of the node
Returns
Array[3] with the logical coordinates of the node of the octant.

Definition at line 558 of file Octant.cpp.

◆ getLogicalNodes() [1/2]

u32arr3vector bitpit::Octant::getLogicalNodes ( ) const

Get the coordinates of the nodes of an octant in logical domain.

Returns
Vector of arrays [nnodes][3] with the coordinates of the nodes of octant.

Definition at line 531 of file Octant.cpp.

◆ getLogicalNodes() [2/2]

void bitpit::Octant::getLogicalNodes ( u32arr3vector & nodes) const

Get the coordinates of the nodes of an octant in logical domain.

Parameters
[out]nodesVector of arrays [nnodes][3] with the coordinates of the nodes of octant.

Definition at line 510 of file Octant.cpp.

◆ getLogicalSize()

uint32_t bitpit::Octant::getLogicalSize ( ) const

Get the size of an octant in logical domain, i.e. the side length.

Returns
Size of octant.

Definition at line 432 of file Octant.cpp.

◆ getLogicalVolume()

uint64_t bitpit::Octant::getLogicalVolume ( ) const

Get the volume of an octant in logical domain.

Returns
Volume of octant.

Definition at line 448 of file Octant.cpp.

◆ getMarker()

int8_t bitpit::Octant::getMarker ( ) const

Get the refinement marker of an octant.

Returns
Marker of octant.

Definition at line 265 of file Octant.cpp.

◆ getMorton()

uint64_t bitpit::Octant::getMorton ( ) const

Get the Morton index of the octant (without level).

Returns
morton Morton index of the octant.

Definition at line 580 of file Octant.cpp.

◆ getNodeBound()

bool bitpit::Octant::getNodeBound ( uint8_t node) const

Get the bound flag on an octant node.

Parameters
[in]nodelocal index of the node.
Returns
true if the node is on a boundary.

Definition at line 296 of file Octant.cpp.

◆ getNormal()

void bitpit::Octant::getNormal ( uint8_t iface,
i8array3 & normal,
const int8_t(&) normals[6][3] ) const

Get the normal of a face of an octant in logical domain.

Parameters
[in]ifaceIndex of the face for normal computing.
[out]normalArray[3] with components (with z=0) of the normal of face.
[in]normalsGlobal structure with components of face normals of a reference octant.

Definition at line 569 of file Octant.cpp.

◆ getPbound() [1/2]

bool bitpit::Octant::getPbound ( ) const

Get the pbound flag on an octant face.

Returns
true if the octant has at least one face that is a process boundary face.

Definition at line 341 of file Octant.cpp.

◆ getPbound() [2/2]

bool bitpit::Octant::getPbound ( uint8_t face) const

Get the pbound flag on an octant face.

Parameters
[in]facelocal index of the face.
Returns
true if the face-th face is a process boundary face.

Definition at line 333 of file Octant.cpp.

◆ setBalance()

void bitpit::Octant::setBalance ( bool balance)
protected

Set the balancing condition of an octant.

Parameters
[in]balanceHas octant to be 2:1 balanced in adapting procedure?

Definition at line 393 of file Octant.cpp.

◆ setBound()

void bitpit::Octant::setBound ( uint8_t face)
protected

Set the boundary flag to true on an octant face.

Parameters
[in]facelocal index of the boundary face.

Definition at line 324 of file Octant.cpp.

◆ setGhostLayer()

void bitpit::Octant::setGhostLayer ( int ghostLayer)
protected

Set the ghost specifier of an octant.

Parameters
[in]ghostLayerNumber defining the layer of the ghost halo. 0 is for internal octants, i.e. non-ghost. ghostLayer > 0 means that the octant is ghost in the ghostLayer layer of the ghost halo.

Definition at line 419 of file Octant.cpp.

◆ setLevel()

void bitpit::Octant::setLevel ( uint8_t level)
protected

Set the level of an octant.

Parameters
[in]levelNew level of the octant.

Definition at line 401 of file Octant.cpp.

◆ setMarker()

void bitpit::Octant::setMarker ( int8_t marker)
protected

Set the refinement marker of an octant.

Parameters
[in]markerRefinement marker of octant (n=n refinement in adapt, -n=n coarsening in adapt, default=0).

Definition at line 385 of file Octant.cpp.

◆ setPbound()

void bitpit::Octant::setPbound ( uint8_t face,
bool flag )
protected

Set the process boundary condition of an octant.

Parameters
[in]faceIndex of the target face to set.
[in]flagCondition true/false if the target face is /is not a process boundary face.

Definition at line 410 of file Octant.cpp.

Friends And Related Symbol Documentation

◆ Global

friend class Global
friend

Definition at line 97 of file Octant.hpp.

◆ LocalTree

friend class LocalTree
friend

Definition at line 95 of file Octant.hpp.

◆ ParaTree

friend class ParaTree
friend

Definition at line 96 of file Octant.hpp.


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