KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::OctreeBinaryCell< TConfiguration > Class Template Reference

This class represents a cell in an octree to be used with Octree class. More...

#include <octree_binary_cell.h>

Collaboration diagram for Kratos::OctreeBinaryCell< TConfiguration >:

Public Member Functions

Life Cycle
 OctreeBinaryCell (char Level=ROOT_LEVEL)
 Default constructor. More...
 
virtual ~OctreeBinaryCell ()
 Destructor. More...
 
void DeleteChildren ()
 
void DeleteData ()
 
Operations
std::size_t GetChildIndex (key_type x_key, key_type y_key, key_type z_key) const
 
int SubdivideCell ()
 
void GetMinPointNormalized (double *min_point) const
 
void GetMaxPointNormalized (double *max_point) const
 
int GetLeftKey (key_type *keys) const
 
int GetRightKey (key_type *keys) const
 
int GetBackKey (key_type *keys) const
 
int GetFrontKey (key_type *keys) const
 
int GetBottomKey (key_type *keys) const
 
int GetTopKey (key_type *keys) const
 
int GetKey (std::size_t position, key_type *keys) const
 
int GetNeighbourKey (std::size_t direction, key_type *keys) const
 
int GetNeighbourKey (std::size_t position, std::size_t direction, key_type *keys) const
 
std::size_t GetLocalPosition (key_type *keys)
 
void Insert (pointer_type object)
 
void TransferObjectsToSonsNormalized ()
 
Access
unsigned char GetLevel () const
 
char SetLevel (char level)
 
void GetMinKey (key_type &min_key_x, key_type &min_key_y, key_type &min_key_z) const
 
void SetMinKey (key_type min_key_x, key_type min_key_y, key_type min_key_z)
 
OctreeBinaryCellrGetChild (std::size_t pos) const
 
OctreeBinaryCellpGetChild (std::size_t pos) const
 
OctreeBinaryCellpGetChild (key_type x_key, key_type y_key, key_type z_key) const
 
OctreeBinaryCellGetChildren ()
 
OctreeBinaryCell const * GetChildren () const
 
data_typepGetData () const
 
data_type ** pGetDataPointer ()
 
const std::vector< pointer_type > * pGetObjects () const
 
std::vector< pointer_type > * pGetObjects ()
 
void EmptyObjects ()
 
Inquiry
bool IsLeaf () const
 
bool HasChildren () const
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Type Definitions

enum  {
  LEFT = 0 , RIGHT = 1 , BACK = 2 , FRONT = 3 ,
  BOTTOM = 4 , TOP = 6
}
 
typedef TConfiguration::data_type data_type
 Pointer definition of OctreeBinaryCell. More...
 
typedef TConfiguration configuration_type
 
typedef TConfiguration::pointer_type pointer_type
 
typedef std::vector< pointer_typeobject_container_type
 
typedef std::size_t key_type
 
static constexpr std::size_t CHILDREN_NUMBER = 8
 
static constexpr std::size_t DIMENSION = TConfiguration::DIMENSION
 
static constexpr std::size_t MAX_LEVEL = TConfiguration::MAX_LEVEL
 
static constexpr std::size_t ROOT_LEVEL = MAX_LEVEL - 1
 
static constexpr std::size_t MIN_LEVEL = TConfiguration::MIN_LEVEL
 

Detailed Description

template<class TConfiguration>
class Kratos::OctreeBinaryCell< TConfiguration >

This class represents a cell in an octree to be used with Octree class.

This class represents a cell in an octree and holds its level, min_key ,the children of the cell and pointer to a data class defined by configuration class. The level_ start from ROOT_LEVEL and each children has 1 level less than its parents but more than MIN_LEVEL. The keys are the binary bisection pattern in each dimension for the min point of the cell. The children are stored in in an array of 8 in following order

              Top

        ________________
       /   6   /   7   /|
      /_______/_______/ |
     /   4   /   5   /| |
    /_______/_______/ | /  Front
    |       |       | |/
    |       |       | /
    |_______|_______|/
        ________________

Left / 2 / 3 /| Right /_______/_______/ | / 0 / 1 /| | /_______/_______/ | / | | | |/ | | | / |_______|_______|/ z Back | y Bottom |/__x

Member Typedef Documentation

◆ configuration_type

template<class TConfiguration >
typedef TConfiguration Kratos::OctreeBinaryCell< TConfiguration >::configuration_type

◆ data_type

template<class TConfiguration >
typedef TConfiguration::data_type Kratos::OctreeBinaryCell< TConfiguration >::data_type

Pointer definition of OctreeBinaryCell.

◆ key_type

template<class TConfiguration >
typedef std::size_t Kratos::OctreeBinaryCell< TConfiguration >::key_type

◆ object_container_type

template<class TConfiguration >
typedef std::vector<pointer_type> Kratos::OctreeBinaryCell< TConfiguration >::object_container_type

◆ pointer_type

template<class TConfiguration >
typedef TConfiguration::pointer_type Kratos::OctreeBinaryCell< TConfiguration >::pointer_type

Member Enumeration Documentation

◆ anonymous enum

template<class TConfiguration >
anonymous enum
Enumerator
LEFT 
RIGHT 
BACK 
FRONT 
BOTTOM 
TOP 

Constructor & Destructor Documentation

◆ OctreeBinaryCell()

template<class TConfiguration >
Kratos::OctreeBinaryCell< TConfiguration >::OctreeBinaryCell ( char  Level = ROOT_LEVEL)
inlineexplicit

Default constructor.

◆ ~OctreeBinaryCell()

template<class TConfiguration >
virtual Kratos::OctreeBinaryCell< TConfiguration >::~OctreeBinaryCell ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ DeleteChildren()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::DeleteChildren ( )
inline

◆ DeleteData()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::DeleteData ( )
inline

◆ EmptyObjects()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::EmptyObjects ( )
inline

◆ GetBackKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetBackKey ( key_type keys) const
inline

◆ GetBottomKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetBottomKey ( key_type keys) const
inline

◆ GetChildIndex()

template<class TConfiguration >
std::size_t Kratos::OctreeBinaryCell< TConfiguration >::GetChildIndex ( key_type  x_key,
key_type  y_key,
key_type  z_key 
) const
inline

◆ GetChildren() [1/2]

template<class TConfiguration >
OctreeBinaryCell* Kratos::OctreeBinaryCell< TConfiguration >::GetChildren ( )
inline

◆ GetChildren() [2/2]

template<class TConfiguration >
OctreeBinaryCell const* Kratos::OctreeBinaryCell< TConfiguration >::GetChildren ( ) const
inline

◆ GetFrontKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetFrontKey ( key_type keys) const
inline

◆ GetKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetKey ( std::size_t  position,
key_type keys 
) const
inline

◆ GetLeftKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetLeftKey ( key_type keys) const
inline

◆ GetLevel()

template<class TConfiguration >
unsigned char Kratos::OctreeBinaryCell< TConfiguration >::GetLevel ( ) const
inline

◆ GetLocalPosition()

template<class TConfiguration >
std::size_t Kratos::OctreeBinaryCell< TConfiguration >::GetLocalPosition ( key_type keys)
inline

◆ GetMaxPointNormalized()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::GetMaxPointNormalized ( double max_point) const
inline

◆ GetMinKey()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::GetMinKey ( key_type min_key_x,
key_type min_key_y,
key_type min_key_z 
) const
inline

◆ GetMinPointNormalized()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::GetMinPointNormalized ( double min_point) const
inline

◆ GetNeighbourKey() [1/2]

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetNeighbourKey ( std::size_t  direction,
key_type keys 
) const
inline

◆ GetNeighbourKey() [2/2]

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetNeighbourKey ( std::size_t  position,
std::size_t  direction,
key_type keys 
) const
inline

◆ GetRightKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetRightKey ( key_type keys) const
inline

◆ GetTopKey()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::GetTopKey ( key_type keys) const
inline

◆ HasChildren()

template<class TConfiguration >
bool Kratos::OctreeBinaryCell< TConfiguration >::HasChildren ( ) const
inline

◆ Info()

template<class TConfiguration >
virtual std::string Kratos::OctreeBinaryCell< TConfiguration >::Info ( ) const
inlinevirtual

Turn back information as a string.

◆ Insert()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::Insert ( pointer_type  object)
inline

◆ IsLeaf()

template<class TConfiguration >
bool Kratos::OctreeBinaryCell< TConfiguration >::IsLeaf ( ) const
inline

◆ pGetChild() [1/2]

template<class TConfiguration >
OctreeBinaryCell* Kratos::OctreeBinaryCell< TConfiguration >::pGetChild ( key_type  x_key,
key_type  y_key,
key_type  z_key 
) const
inline

◆ pGetChild() [2/2]

template<class TConfiguration >
OctreeBinaryCell* Kratos::OctreeBinaryCell< TConfiguration >::pGetChild ( std::size_t  pos) const
inline

◆ pGetData()

template<class TConfiguration >
data_type* Kratos::OctreeBinaryCell< TConfiguration >::pGetData ( ) const
inline

◆ pGetDataPointer()

template<class TConfiguration >
data_type** Kratos::OctreeBinaryCell< TConfiguration >::pGetDataPointer ( )
inline

◆ pGetObjects() [1/2]

template<class TConfiguration >
std::vector<pointer_type>* Kratos::OctreeBinaryCell< TConfiguration >::pGetObjects ( )
inline

◆ pGetObjects() [2/2]

template<class TConfiguration >
const std::vector<pointer_type>* Kratos::OctreeBinaryCell< TConfiguration >::pGetObjects ( ) const
inline

◆ PrintData()

template<class TConfiguration >
virtual void Kratos::OctreeBinaryCell< TConfiguration >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

Print object's data.

◆ PrintInfo()

template<class TConfiguration >
virtual void Kratos::OctreeBinaryCell< TConfiguration >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

Print information about this object.

◆ rGetChild()

template<class TConfiguration >
OctreeBinaryCell& Kratos::OctreeBinaryCell< TConfiguration >::rGetChild ( std::size_t  pos) const
inline

◆ SetLevel()

template<class TConfiguration >
char Kratos::OctreeBinaryCell< TConfiguration >::SetLevel ( char  level)
inline

◆ SetMinKey()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::SetMinKey ( key_type  min_key_x,
key_type  min_key_y,
key_type  min_key_z 
)
inline

◆ SubdivideCell()

template<class TConfiguration >
int Kratos::OctreeBinaryCell< TConfiguration >::SubdivideCell ( )
inline

◆ TransferObjectsToSonsNormalized()

template<class TConfiguration >
void Kratos::OctreeBinaryCell< TConfiguration >::TransferObjectsToSonsNormalized ( )
inline

Member Data Documentation

◆ CHILDREN_NUMBER

template<class TConfiguration >
constexpr std::size_t Kratos::OctreeBinaryCell< TConfiguration >::CHILDREN_NUMBER = 8
staticconstexpr

◆ DIMENSION

template<class TConfiguration >
constexpr std::size_t Kratos::OctreeBinaryCell< TConfiguration >::DIMENSION = TConfiguration::DIMENSION
staticconstexpr

◆ MAX_LEVEL

template<class TConfiguration >
constexpr std::size_t Kratos::OctreeBinaryCell< TConfiguration >::MAX_LEVEL = TConfiguration::MAX_LEVEL
staticconstexpr

◆ MIN_LEVEL

template<class TConfiguration >
constexpr std::size_t Kratos::OctreeBinaryCell< TConfiguration >::MIN_LEVEL = TConfiguration::MIN_LEVEL
staticconstexpr

◆ ROOT_LEVEL

template<class TConfiguration >
constexpr std::size_t Kratos::OctreeBinaryCell< TConfiguration >::ROOT_LEVEL = MAX_LEVEL - 1
staticconstexpr

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