bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::utils::geom::Mesh< spacedim > Class Template Reference

A class that represents a mesh. More...

#include <mesh.h>

Inheritance diagram for bitrl::utils::geom::Mesh< spacedim >:
Collaboration diagram for bitrl::utils::geom::Mesh< spacedim >:

Public Types

typedef MeshTopology< spacedim >::edge_ptr_t edge_ptr_t
 
typedef MeshTopology< spacedim >::face_ptr_t face_ptr_t
 
typedef MeshTopology< spacedim >::cedge_ptr_t cedge_ptr_t
 
typedef MeshTopology< spacedim >::cface_ptr_t cface_ptr_t
 
typedef std::vector< Node< spacedim > * >::iterator node_iterator_impl
 Node iteration.
 
typedef std::vector< Node< spacedim > * >::const_iterator cnode_iterator_impl
 
typedef std::vector< Element< spacedim > * >::iterator element_iterator_impl
 Element iteration.
 
typedef std::vector< Element< spacedim > * >::const_iterator celement_iterator_impl
 
typedef std::vector< edge_ptr_t >::iterator edge_iterator_impl
 Edge iteration.
 
typedef std::vector< edge_ptr_t >::const_iterator cedge_iterator_impl
 
typedef std::vector< face_ptr_t >::iterator face_iterator_impl
 Face iteration.
 
typedef std::vector< face_ptr_t >::const_iterator cface_iterator_impl
 

Public Member Functions

 Mesh ()
 Constructor. Creates an empty Mesh.
 
virtual ~Mesh ()
 dtor
 
void reserve_n_nodes (uint_t n)
 
void reserve_n_elements (uint_t n)
 
void reserve_n_edges (uint_t n)
 
void reserve_n_faces (uint_t n)
 
Node< spacedim > * create_vertex (const GeomPoint< spacedim, real_t > &point, uint_t global_id=bitrl::consts::INVALID_ID, uint_t pid=0)
 
Node< spacedim > * create_node (const GeomPoint< spacedim, real_t > &point, uint_t global_id=bitrl::consts::INVALID_ID, uint_t pid=0)
 
Element< spacedim > * create_element (ElementType::sub_type t, uint_t global_id=bitrl::consts::INVALID_ID, uint_t pid=0)
 
edge_ptr_t create_edge (ElementType::sub_type t, uint_t global_id=bitrl::consts::INVALID_ID, uint_t pid=0)
 
face_ptr_t create_face (ElementType::sub_type t, uint_t global_id=bitrl::consts::INVALID_ID, uint_t pid=0)
 
void set_n_boundaries (uint_t nb)
 
Node< spacedim > * node (uint_t n)
 
const Node< spacedim > * node (uint_t n) const
 
Element< spacedim > * element (uint_t e)
 
const Element< spacedim > * element (uint_t e) const
 
uint_t n_vertices () const
 
uint_t n_nodes () const
 
uint_t n_elements () const
 
uint_t n_edges () const
 How many edges the mesh has.
 
uint_t n_faces () const
 how many faces the mesh has
 
uint_t n_active_faces () const
 
MeshTopology< spacedim > * topology ()
 Return read/write access to the topology of the mesh.
 
const MeshTopology< spacedim > * topology () const
 Read access to the topology of the mesh.
 
void faces (const MeshConnectivity &faces_idx, std::vector< cface_ptr_t > &faces_ptr) const
 Get the pointers to the faces described by the given MeshConnectivity.
 
uint_t n_boundaries () const
 Get the number of boundaries of the mesh.
 
node_iterator_impl nodes_begin ()
 Raw node iteration.
 
node_iterator_impl nodes_end ()
 
cnode_iterator_impl nodes_begin () const
 Raw node iteration.
 
cnode_iterator_impl nodes_end () const
 
element_iterator_impl elements_begin ()
 Raw elements iteration.
 
element_iterator_impl elements_end ()
 
celement_iterator_impl elements_begin () const
 Raw elements iteration.
 
celement_iterator_impl elements_end () const
 
edge_iterator_impl edges_begin ()
 Raw faces iteration.
 
edge_iterator_impl edges_end ()
 
cedge_iterator_impl edges_begin () const
 Raw faces iteration.
 
cedge_iterator_impl edges_end () const
 
face_iterator_impl faces_begin ()
 Raw faces iteration.
 
face_iterator_impl faces_end ()
 
cface_iterator_impl faces_begin () const
 Raw faces iteration.
 
cface_iterator_impl faces_end () const
 
uint_t n_edges () const
 
uint_t n_faces () const
 

Static Public Attributes

static const int dimension = spacedim
 

Detailed Description

template<int spacedim>
class bitrl::utils::geom::Mesh< spacedim >

A class that represents a mesh.

Member Typedef Documentation

◆ cedge_iterator_impl

template<int spacedim>
typedef std::vector<edge_ptr_t>::const_iterator bitrl::utils::geom::Mesh< spacedim >::cedge_iterator_impl

◆ cedge_ptr_t

template<int spacedim>
typedef MeshTopology<spacedim>::cedge_ptr_t bitrl::utils::geom::Mesh< spacedim >::cedge_ptr_t

◆ celement_iterator_impl

template<int spacedim>
typedef std::vector<Element<spacedim>*>::const_iterator bitrl::utils::geom::Mesh< spacedim >::celement_iterator_impl

◆ cface_iterator_impl

template<int spacedim>
typedef std::vector<face_ptr_t>::const_iterator bitrl::utils::geom::Mesh< spacedim >::cface_iterator_impl

◆ cface_ptr_t

template<int spacedim>
typedef MeshTopology<spacedim>::cface_ptr_t bitrl::utils::geom::Mesh< spacedim >::cface_ptr_t

◆ cnode_iterator_impl

template<int spacedim>
typedef std::vector<Node<spacedim>*>::const_iterator bitrl::utils::geom::Mesh< spacedim >::cnode_iterator_impl

◆ edge_iterator_impl

template<int spacedim>
typedef std::vector<edge_ptr_t>::iterator bitrl::utils::geom::Mesh< spacedim >::edge_iterator_impl

Edge iteration.

◆ edge_ptr_t

template<int spacedim>
typedef MeshTopology<spacedim>::edge_ptr_t bitrl::utils::geom::Mesh< spacedim >::edge_ptr_t

◆ element_iterator_impl

template<int spacedim>
typedef std::vector<Element<spacedim>*>::iterator bitrl::utils::geom::Mesh< spacedim >::element_iterator_impl

Element iteration.

◆ face_iterator_impl

template<int spacedim>
typedef std::vector<face_ptr_t>::iterator bitrl::utils::geom::Mesh< spacedim >::face_iterator_impl

Face iteration.

◆ face_ptr_t

template<int spacedim>
typedef MeshTopology<spacedim>::face_ptr_t bitrl::utils::geom::Mesh< spacedim >::face_ptr_t

◆ node_iterator_impl

template<int spacedim>
typedef std::vector<Node<spacedim>*>::iterator bitrl::utils::geom::Mesh< spacedim >::node_iterator_impl

Node iteration.

Constructor & Destructor Documentation

◆ Mesh()

template<int spacedim>
bitrl::utils::geom::Mesh< spacedim >::Mesh ( )

Constructor. Creates an empty Mesh.

◆ ~Mesh()

template<int spacedim>
bitrl::utils::geom::Mesh< spacedim >::~Mesh ( )
virtual

dtor

Member Function Documentation

◆ create_edge()

template<int spacedim>
Mesh< spacedim >::edge_ptr_t bitrl::utils::geom::Mesh< spacedim >::create_edge ( ElementType::sub_type  t,
uint_t  global_id = bitrl::consts::INVALID_ID,
uint_t  pid = 0 
)

\detailed create an edge and get back the pointer

◆ create_element()

template<int spacedim>
Element< spacedim > * bitrl::utils::geom::Mesh< spacedim >::create_element ( ElementType::sub_type  t,
uint_t  global_id = bitrl::consts::INVALID_ID,
uint_t  pid = 0 
)

\detailed create an Element and get back the pointer

◆ create_face()

template<int spacedim>
Mesh< spacedim >::face_ptr_t bitrl::utils::geom::Mesh< spacedim >::create_face ( ElementType::sub_type  t,
uint_t  global_id = bitrl::consts::INVALID_ID,
uint_t  pid = 0 
)

\detailed create a face and get back the pointer

◆ create_node()

template<int spacedim>
Node< spacedim > * bitrl::utils::geom::Mesh< spacedim >::create_node ( const GeomPoint< spacedim, real_t > &  point,
uint_t  global_id = bitrl::consts::INVALID_ID,
uint_t  pid = 0 
)

\detailed create a Node

◆ create_vertex()

template<int spacedim>
Node< spacedim > * bitrl::utils::geom::Mesh< spacedim >::create_vertex ( const GeomPoint< spacedim, real_t > &  point,
uint_t  global_id = bitrl::consts::INVALID_ID,
uint_t  pid = 0 
)

\detailed create a vertex by passing in the coordinates of the vertex. This will create a Node so optionally we can pass in the global id and the processor id of the created node

◆ edges_begin() [1/2]

template<int spacedim>
edge_iterator_impl bitrl::utils::geom::Mesh< spacedim >::edges_begin ( )
inline

Raw faces iteration.

◆ edges_begin() [2/2]

template<int spacedim>
cedge_iterator_impl bitrl::utils::geom::Mesh< spacedim >::edges_begin ( ) const
inline

Raw faces iteration.

◆ edges_end() [1/2]

template<int spacedim>
edge_iterator_impl bitrl::utils::geom::Mesh< spacedim >::edges_end ( )
inline

◆ edges_end() [2/2]

template<int spacedim>
cedge_iterator_impl bitrl::utils::geom::Mesh< spacedim >::edges_end ( ) const
inline

◆ element() [1/2]

template<int spacedim>
Element< spacedim > * bitrl::utils::geom::Mesh< spacedim >::element ( uint_t  e)
inline

\detailed read/write access to the n-th element

◆ element() [2/2]

template<int spacedim>
const Element< spacedim > * bitrl::utils::geom::Mesh< spacedim >::element ( uint_t  e) const
inline

\detailed read access to the n-th element

◆ elements_begin() [1/2]

template<int spacedim>
element_iterator_impl bitrl::utils::geom::Mesh< spacedim >::elements_begin ( )
inline

Raw elements iteration.

◆ elements_begin() [2/2]

template<int spacedim>
celement_iterator_impl bitrl::utils::geom::Mesh< spacedim >::elements_begin ( ) const
inline

Raw elements iteration.

◆ elements_end() [1/2]

template<int spacedim>
element_iterator_impl bitrl::utils::geom::Mesh< spacedim >::elements_end ( )
inline

◆ elements_end() [2/2]

template<int spacedim>
celement_iterator_impl bitrl::utils::geom::Mesh< spacedim >::elements_end ( ) const
inline

◆ faces()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::faces ( const MeshConnectivity faces_idx,
std::vector< cface_ptr_t > &  faces_ptr 
) const
inline

Get the pointers to the faces described by the given MeshConnectivity.

◆ faces_begin() [1/2]

template<int spacedim>
face_iterator_impl bitrl::utils::geom::Mesh< spacedim >::faces_begin ( )
inline

Raw faces iteration.

◆ faces_begin() [2/2]

template<int spacedim>
cface_iterator_impl bitrl::utils::geom::Mesh< spacedim >::faces_begin ( ) const
inline

Raw faces iteration.

◆ faces_end() [1/2]

template<int spacedim>
face_iterator_impl bitrl::utils::geom::Mesh< spacedim >::faces_end ( )
inline

◆ faces_end() [2/2]

template<int spacedim>
cface_iterator_impl bitrl::utils::geom::Mesh< spacedim >::faces_end ( ) const
inline

◆ n_active_faces()

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_active_faces ( ) const

get the active faces of the mesh

◆ n_boundaries()

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_boundaries ( ) const
inline

Get the number of boundaries of the mesh.

◆ n_edges() [1/2]

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_edges ( ) const
inline

How many edges the mesh has.

◆ n_edges() [2/2]

uint_t bitrl::utils::geom::Mesh< 1 >::n_edges ( ) const
inline

◆ n_elements()

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_elements ( ) const
inline

\detailed how many elements the mesh has

◆ n_faces() [1/2]

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_faces ( ) const
inline

how many faces the mesh has

◆ n_faces() [2/2]

uint_t bitrl::utils::geom::Mesh< 1 >::n_faces ( ) const
inline

◆ n_nodes()

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_nodes ( ) const
inline

\detailed how many nodes the mesh has

◆ n_vertices()

template<int spacedim>
uint_t bitrl::utils::geom::Mesh< spacedim >::n_vertices ( ) const

\detailed how many vertices the mesh has

◆ node() [1/2]

template<int spacedim>
Node< spacedim > * bitrl::utils::geom::Mesh< spacedim >::node ( uint_t  n)
inline

\detailed read/write acces to the n-th node

◆ node() [2/2]

template<int spacedim>
const Node< spacedim > * bitrl::utils::geom::Mesh< spacedim >::node ( uint_t  n) const
inline

\detailed read acces to the n-th node

◆ nodes_begin() [1/2]

template<int spacedim>
node_iterator_impl bitrl::utils::geom::Mesh< spacedim >::nodes_begin ( )
inline

Raw node iteration.

◆ nodes_begin() [2/2]

template<int spacedim>
cnode_iterator_impl bitrl::utils::geom::Mesh< spacedim >::nodes_begin ( ) const
inline

Raw node iteration.

◆ nodes_end() [1/2]

template<int spacedim>
node_iterator_impl bitrl::utils::geom::Mesh< spacedim >::nodes_end ( )
inline

◆ nodes_end() [2/2]

template<int spacedim>
cnode_iterator_impl bitrl::utils::geom::Mesh< spacedim >::nodes_end ( ) const
inline

◆ reserve_n_edges()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::reserve_n_edges ( uint_t  n)
inline

◆ reserve_n_elements()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::reserve_n_elements ( uint_t  n)
inline

◆ reserve_n_faces()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::reserve_n_faces ( uint_t  n)
inline

◆ reserve_n_nodes()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::reserve_n_nodes ( uint_t  n)
inline

◆ set_n_boundaries()

template<int spacedim>
void bitrl::utils::geom::Mesh< spacedim >::set_n_boundaries ( uint_t  nb)
inline

\detailed set the number of boundaries for the mesh

◆ topology() [1/2]

template<int spacedim>
MeshTopology< spacedim > * bitrl::utils::geom::Mesh< spacedim >::topology ( )
inline

Return read/write access to the topology of the mesh.

◆ topology() [2/2]

template<int spacedim>
const MeshTopology< spacedim > * bitrl::utils::geom::Mesh< spacedim >::topology ( ) const
inline

Read access to the topology of the mesh.

Member Data Documentation

◆ dimension

template<int spacedim>
const int bitrl::utils::geom::Mesh< spacedim >::dimension = spacedim
static

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