AutoPas  3.0.0
Loading...
Searching...
No Matches
Namespaces | Typedefs | Enumerations | Functions
autopas::octree Namespace Reference

Namespace that contains code that is used by the octree internally. More...

Namespaces

namespace  anonymous_namespace{OctreeDirection.h}
 This namespace contains the tables that are anonymous within this file.
 
namespace  Tables
 This namespace contains all tables that can be used publicly.
 

Typedefs

using Any = int unsigned
 A datatype that is wide enough to hold faces, edges or vertices.
 
using Octant = Vertex
 A vertex is also capable of specifying an arbitrary octant in 3D.
 

Enumerations

enum  Face : Any {
  O = 0 , L = 1 , R = 2 , D = 3 ,
  U = 4 , B = 5 , F = 6
}
 This enum can be used to index the faces of a cube including an "invalid" face.
 
enum  Edge : Any {
  OO = 0 , LD = buildEdge<L, D>() , LU = buildEdge<L, U>() , LB = buildEdge<L, B>() ,
  LF = buildEdge<L, F>() , RD = buildEdge<R, D>() , RU = buildEdge<R, U>() , RB = buildEdge<R, B>() ,
  RF = buildEdge<R, F>() , DB = buildEdge<D, B>() , DF = buildEdge<D, F>() , UB = buildEdge<U, B>() ,
  UF = buildEdge<U, F>()
}
 This enum can be used to index all edges of a cube including an "invalid" edge.
 
enum  Vertex : Any {
  OOO = 0 , LDB = buildVertex<L, D, B>() , LDF = buildVertex<L, D, F>() , LUB = buildVertex<L, U, B>() ,
  LUF = buildVertex<L, U, F>() , RDB = buildVertex<R, D, B>() , RDF = buildVertex<R, D, F>() , RUB = buildVertex<R, U, B>() ,
  RUF = buildVertex<R, U, F>()
}
 This enum can be used to index all vertices of a cube including an "invalid" vertex.
 

Functions

template<Face f1, Face f2>
static constexpr Any buildEdge ()
 Create a bitfield for an edge given by the template parameters.
 
template<Face f1, Face f2, Face f3>
static constexpr Any buildVertex ()
 Create a bitfield for a vertex given by the template parameters.
 
int vertexToIndex (Vertex vertex)
 Map an arbitrary vertex to a flat index.
 
template<typename T >
bool isFace (T f)
 Check if f is a face.
 
template<typename T >
bool isEdge (T e)
 Check if e is an edge.
 
template<typename T >
bool isVertex (T v)
 Check if v is a vertex.
 
bool ADJ (Any direction, Vertex octant)
 This function implements a LUT obtained from the Samet paper: "ADJ(I,O) is true if and only if octant O is adjacent to the Ith face, edge, or vertex of O's containing block".
 
Octant REFLECT (Any direction, Octant octant)
 This function implements a LUT obtained from the Samet paper: "REFLECT(I,O) yields the SONTYPE value of the block of equal size (not necessarily a brother) that shares the Ith face, edge, or vertex of a block having SONTYPE value O".
 
Face COMMON_FACE (Any direction, Vertex octant)
 This function implements a LUT obtained from the Samet paper: "COMMON_FACE(I,O) yields the type on the face (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.
 
Edge COMMON_EDGE (Any direction, Vertex octant)
 This function implements a LUT obtained from the Samet paper: "COMMON_EDGE(I,O) yields the type of the edge (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.
 
Any getOppositeDirection (Any direction)
 Convert any direction to a direction that is directly opposing the given direction.
 
std::vector< OctantgetAllowedDirections (Any along)
 Get a list of octants that are along the given direction.
 

Detailed Description

Namespace that contains code that is used by the octree internally.

Function Documentation

◆ ADJ()

bool autopas::octree::ADJ ( Any  direction,
Vertex  octant 
)
inline

This function implements a LUT obtained from the Samet paper: "ADJ(I,O) is true if and only if octant O is adjacent to the Ith face, edge, or vertex of O's containing block".

Parameters
directionThe direction I to search the adjacent neighbor
octantThe octant O from the paper
Returns
true if the neighbor is adjacent, false otherwise

◆ buildEdge()

template<Face f1, Face f2>
static constexpr Any autopas::octree::buildEdge ( )
staticconstexpr

Create a bitfield for an edge given by the template parameters.

Template Parameters
f1
f2
Returns

◆ buildVertex()

template<Face f1, Face f2, Face f3>
static constexpr Any autopas::octree::buildVertex ( )
staticconstexpr

Create a bitfield for a vertex given by the template parameters.

Template Parameters
f1
f2
f3
Returns

◆ COMMON_EDGE()

Edge autopas::octree::COMMON_EDGE ( Any  direction,
Vertex  octant 
)
inline

This function implements a LUT obtained from the Samet paper: "COMMON_EDGE(I,O) yields the type of the edge (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.

"

Parameters
directionThe direction I
octantThe octant O
Returns
The edge that is shared between the neighbors

◆ COMMON_FACE()

Face autopas::octree::COMMON_FACE ( Any  direction,
Vertex  octant 
)
inline

This function implements a LUT obtained from the Samet paper: "COMMON_FACE(I,O) yields the type on the face (i.e., label), of O's containing block, that is common to octant O and its neighbor in the Ith direction.

"

Parameters
directionThe direction I
octantThe octant O
Returns
The face that is shared between the neighbors

◆ getAllowedDirections()

std::vector< Octant > autopas::octree::getAllowedDirections ( Any  along)
inline

Get a list of octants that are along the given direction.

Parameters
alongA direction the returned vertices should be admissible to
Returns
A list of octants that fits the given direction

◆ getOppositeDirection()

Any autopas::octree::getOppositeDirection ( Any  direction)
inline

Convert any direction to a direction that is directly opposing the given direction.

Parameters
directionAny direction (Face, Edge or Vertex)
Returns
A direction that is opposing the given direction

◆ isEdge()

template<typename T >
bool autopas::octree::isEdge ( e)
inline

Check if e is an edge.

Template Parameters
T
Parameters
eThe parameter to check
Returns
true iff e is in the list returned from getEdges()

◆ isFace()

template<typename T >
bool autopas::octree::isFace ( f)
inline

Check if f is a face.

Parameters
fThe parameter to check
Returns
true iff f is in the list returned from getFaces()

◆ isVertex()

template<typename T >
bool autopas::octree::isVertex ( v)
inline

Check if v is a vertex.

Template Parameters
T
Parameters
vThe parameter to check
Returns
true iff v is in the list returned from VERTICES()

◆ REFLECT()

Octant autopas::octree::REFLECT ( Any  direction,
Octant  octant 
)
inline

This function implements a LUT obtained from the Samet paper: "REFLECT(I,O) yields the SONTYPE value of the block of equal size (not necessarily a brother) that shares the Ith face, edge, or vertex of a block having SONTYPE value O".

Parameters
directionThe direction I to search the reflected neighbor
octantThe octant O
Returns
The octant resulting from the reflection

◆ vertexToIndex()

int autopas::octree::vertexToIndex ( Vertex  vertex)
inline

Map an arbitrary vertex to a flat index.

Parameters
vertexAn element from the Vertex enum
Returns
A flat index in the range of 0 to 7 for any valid vertex. For invalid input -1 is returned.