bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::geom::Element< dim > Class Template Referenceabstract

Wraps the notion of an element. More...

#include <element.h>

Inheritance diagram for bitrl::utils::geom::Element< dim >:
Collaboration diagram for bitrl::utils::geom::Element< dim >:

Public Types

typedef Element< dim > * neighbor_ptr_t
 
typedef Element< dim > & neighbor_ref_t
 
typedef const Element< dim > & cneighbor_ref_t
 
typedef Node< dim > * node_ptr_t
 
typedef element_traits< Element< dim > >::edge_ptr_t edge_ptr_t
 
typedef element_traits< Element< dim > >::cedge_ptr_t cedge_ptr_t
 
typedef element_traits< Element< dim > >::edge_ref_t edge_ref_t
 
typedef element_traits< Element< dim > >::cedge_ref_t cedge_ref_t
 
typedef element_traits< Element< dim > >::face_ptr_t face_ptr_t
 
typedef element_traits< Element< dim > >::cface_ptr_t cface_ptr_t
 
typedef element_traits< Element< dim > >::face_ref_t face_ref_t
 
typedef element_traits< Element< dim > >::cface_ref_t cface_ref_t
 

Public Member Functions

virtual ~Element ()
 Destructor.
 
virtual uint_t n_vertices () const =0
 How many vertices the element has.
 
virtual uint_t n_nodes () const =0
 How many nodes the element has.
 
virtual void set_node (uint_t i, node_ptr_t node)
 Set the i-th node.
 
virtual void append_node (node_ptr_t node)
 Append a node to the nodes list.
 
virtual void resize_nodes ()
 Reserve space for nodes.
 
virtual node_ptr_t get_node (uint_t n)
 Returns the i-th node.
 
virtual uint_t n_edges () const =0
 How many edges the element has.
 
virtual uint_t n_faces () const =0
 How many faces the element has.
 
virtual void resize_faces ()=0
 Resize the space for the faces.
 
virtual cface_ref_t get_face (uint_t f) const =0
 Returns the f-face.
 
virtual face_ref_t get_face (uint_t f)=0
 Returns the f-face.
 
virtual void set_face (uint_t f, face_ptr_t face)=0
 Set the f-th face of the element.
 
virtual void set_neighbor (uint_t n, neighbor_ptr_t neigh)
 Set the i-th neighbor.
 
virtual uint_t n_neighbors () const =0
 Returns the number of neighbors.
 
virtual void resize_neighbors ()
 Reserve space for neighbors.
 
virtual cneighbor_ref_t get_neighbor (uint_t n) const
 Access the n-th neighbor.
 
virtual neighbor_ptr_t neighbor_ptr (uint_t n)
 Access the n-th neighbor pointer.
 
virtual const neighbor_ptr_t neighbor_ptr (uint_t n) const
 Access the n-th neighbor pointer.
 
virtual void face_vertices (uint_t f, std::vector< uint_t > &ids) const =0
 Returns the node ids of the vertices of the given face.
 
virtual real_t volume () const =0
 Returns the volume of the element.
 
virtual GeomPoint< dimcentroid () const
 Returns the average location of the vertices of the element.
 
virtual uint_t which_face_am_i (cface_ref_t face) const =0
 Returns the local id relevant to the calling object of the passed object.
 
virtual const DynVec< real_tface_normal_vector (uint_t f) const =0
 Returns the face normal vector.
 
uint_t which_neighbor_am_i (const Element< dim > &element) const
 Returns the local id relevant to the calling object of the passed object.
 
std::vector< node_ptr_tget_vertices () const
 Return the vertices of the element.
 
- Public Member Functions inherited from bitrl::utils::geom::MeshEntity
 MeshEntity ()
 Constructor.
 
 MeshEntity (uint_t id, uint_t pid, const std::any &data)
 Constructor.
 
uint_t get_id () const
 Returns the id of the element.
 
void set_id (uint_t id)
 Set the id of the element.
 
uint_t get_pid () const
 Returns the id of the element.
 
void set_pid (uint_t id)
 Set the id of the element.
 
bool has_valid_id () const
 
bool is_active () const
 
void set_active_flag (bool f)
 

Protected Member Functions

 Element ()
 Constructor.
 
 Element (uint_t id, uint_t pid)
 Constructor.
 
 Element (uint_t id, uint_t pid, const std::any &data)
 Constructor.
 

Protected Attributes

std::vector< neighbor_ptr_tneginbors_
 The neighbors of the element.
 
std::vector< node_ptr_tnodes_
 The nodes of the element.
 

Detailed Description

template<int dim>
class bitrl::utils::geom::Element< dim >

Wraps the notion of an element.

forward declarations

Member Typedef Documentation

◆ cedge_ptr_t

template<int dim>
typedef element_traits<Element<dim>>::cedge_ptr_t bitrl::utils::geom::Element< dim >::cedge_ptr_t

◆ cedge_ref_t

template<int dim>
typedef element_traits<Element<dim>>::cedge_ref_t bitrl::utils::geom::Element< dim >::cedge_ref_t

◆ cface_ptr_t

template<int dim>
typedef element_traits<Element<dim>>::cface_ptr_t bitrl::utils::geom::Element< dim >::cface_ptr_t

◆ cface_ref_t

template<int dim>
typedef element_traits<Element<dim>>::cface_ref_t bitrl::utils::geom::Element< dim >::cface_ref_t

◆ cneighbor_ref_t

template<int dim>
typedef const Element<dim>& bitrl::utils::geom::Element< dim >::cneighbor_ref_t

◆ edge_ptr_t

template<int dim>
typedef element_traits<Element<dim>>::edge_ptr_t bitrl::utils::geom::Element< dim >::edge_ptr_t

◆ edge_ref_t

template<int dim>
typedef element_traits<Element<dim>>::edge_ref_t bitrl::utils::geom::Element< dim >::edge_ref_t

◆ face_ptr_t

template<int dim>
typedef element_traits<Element<dim>>::face_ptr_t bitrl::utils::geom::Element< dim >::face_ptr_t

◆ face_ref_t

template<int dim>
typedef element_traits<Element<dim>>::face_ref_t bitrl::utils::geom::Element< dim >::face_ref_t

◆ neighbor_ptr_t

template<int dim>
typedef Element<dim>* bitrl::utils::geom::Element< dim >::neighbor_ptr_t

◆ neighbor_ref_t

template<int dim>
typedef Element<dim>& bitrl::utils::geom::Element< dim >::neighbor_ref_t

◆ node_ptr_t

template<int dim>
typedef Node<dim>* bitrl::utils::geom::Element< dim >::node_ptr_t

Constructor & Destructor Documentation

◆ ~Element()

template<int dim>
bitrl::utils::geom::Element< dim >::~Element ( )
virtual

Destructor.

◆ Element() [1/3]

template<int dim>
bitrl::utils::geom::Element< dim >::Element ( )
protected

Constructor.

◆ Element() [2/3]

template<int dim>
bitrl::utils::geom::Element< dim >::Element ( uint_t  id,
uint_t  pid 
)
protected

Constructor.

◆ Element() [3/3]

template<int dim>
bitrl::utils::geom::Element< dim >::Element ( uint_t  id,
uint_t  pid,
const std::any &  data 
)
protected

Constructor.

Member Function Documentation

◆ append_node()

template<int dim>
void bitrl::utils::geom::Element< dim >::append_node ( node_ptr_t  node)
virtual

Append a node to the nodes list.

◆ centroid()

template<int dim>
GeomPoint< dim > bitrl::utils::geom::Element< dim >::centroid ( ) const
virtual

Returns the average location of the vertices of the element.

◆ face_normal_vector()

template<int dim>
virtual const DynVec< real_t > bitrl::utils::geom::Element< dim >::face_normal_vector ( uint_t  f) const
pure virtual

Returns the face normal vector.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ face_vertices()

template<int dim>
virtual void bitrl::utils::geom::Element< dim >::face_vertices ( uint_t  f,
std::vector< uint_t > &  ids 
) const
pure virtual

Returns the node ids of the vertices of the given face.

Implemented in bitrl::utils::geom::Quad< 2 >, and bitrl::utils::geom::EdgeElem< 1 >.

◆ get_face() [1/2]

template<int dim>
virtual cface_ref_t bitrl::utils::geom::Element< dim >::get_face ( uint_t  f) const
pure virtual

Returns the f-face.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ get_face() [2/2]

template<int dim>
virtual face_ref_t bitrl::utils::geom::Element< dim >::get_face ( uint_t  f)
pure virtual

Returns the f-face.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ get_neighbor()

template<int dim>
Element< dim >::cneighbor_ref_t bitrl::utils::geom::Element< dim >::get_neighbor ( uint_t  n) const
virtual

Access the n-th neighbor.

◆ get_node()

template<int dim>
Element< dim >::node_ptr_t bitrl::utils::geom::Element< dim >::get_node ( uint_t  n)
virtual

Returns the i-th node.

Reimplemented in bitrl::utils::geom::EdgeElem< 1 >.

◆ get_vertices()

template<int dim>
std::vector< typename Element< dim >::node_ptr_t > bitrl::utils::geom::Element< dim >::get_vertices ( ) const

Return the vertices of the element.

◆ n_edges()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::n_edges ( ) const
pure virtual

How many edges the element has.

Implemented in bitrl::utils::geom::Quad< 2 >, and bitrl::utils::geom::EdgeElem< 1 >.

◆ n_faces()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::n_faces ( ) const
pure virtual

How many faces the element has.

Implemented in bitrl::utils::geom::Quad< 2 >, and bitrl::utils::geom::EdgeElem< 1 >.

◆ n_neighbors()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::n_neighbors ( ) const
pure virtual

Returns the number of neighbors.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ n_nodes()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::n_nodes ( ) const
pure virtual

How many nodes the element has.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ n_vertices()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::n_vertices ( ) const
pure virtual

How many vertices the element has.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ neighbor_ptr() [1/2]

template<int dim>
Element< dim >::neighbor_ptr_t bitrl::utils::geom::Element< dim >::neighbor_ptr ( uint_t  n)
virtual

Access the n-th neighbor pointer.

◆ neighbor_ptr() [2/2]

template<int dim>
const Element< dim >::neighbor_ptr_t bitrl::utils::geom::Element< dim >::neighbor_ptr ( uint_t  n) const
virtual

Access the n-th neighbor pointer.

◆ resize_faces()

template<int dim>
virtual void bitrl::utils::geom::Element< dim >::resize_faces ( )
pure virtual

Resize the space for the faces.

Implemented in bitrl::utils::geom::Quad< 2 >, and bitrl::utils::geom::EdgeElem< 1 >.

◆ resize_neighbors()

template<int dim>
void bitrl::utils::geom::Element< dim >::resize_neighbors ( )
virtual

Reserve space for neighbors.

◆ resize_nodes()

template<int dim>
void bitrl::utils::geom::Element< dim >::resize_nodes ( )
virtual

Reserve space for nodes.

◆ set_face()

template<int dim>
virtual void bitrl::utils::geom::Element< dim >::set_face ( uint_t  f,
face_ptr_t  face 
)
pure virtual

Set the f-th face of the element.

◆ set_neighbor()

template<int dim>
void bitrl::utils::geom::Element< dim >::set_neighbor ( uint_t  n,
neighbor_ptr_t  neigh 
)
virtual

Set the i-th neighbor.

◆ set_node()

template<int dim>
void bitrl::utils::geom::Element< dim >::set_node ( uint_t  i,
node_ptr_t  node 
)
virtual

Set the i-th node.

◆ volume()

template<int dim>
virtual real_t bitrl::utils::geom::Element< dim >::volume ( ) const
pure virtual

Returns the volume of the element.

Implemented in bitrl::utils::geom::EdgeElem< 1 >, and bitrl::utils::geom::Quad< 2 >.

◆ which_face_am_i()

template<int dim>
virtual uint_t bitrl::utils::geom::Element< dim >::which_face_am_i ( cface_ref_t  face) const
pure virtual

Returns the local id relevant to the calling object of the passed object.

◆ which_neighbor_am_i()

template<int dim>
uint_t bitrl::utils::geom::Element< dim >::which_neighbor_am_i ( const Element< dim > &  element) const

Returns the local id relevant to the calling object of the passed object.

Member Data Documentation

◆ neginbors_

template<int dim>
std::vector<neighbor_ptr_t> bitrl::utils::geom::Element< dim >::neginbors_
protected

The neighbors of the element.

◆ nodes_

template<int dim>
std::vector<node_ptr_t> bitrl::utils::geom::Element< dim >::nodes_
protected

The nodes of the element.


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