NiHu  2.0
NiHu::mesh< ElemTypeVector > Class Template Reference

container class for a mesh More...

#include <mesh.hpp>

Classes

struct  elem_adder
 
struct  elem_iterator_t
 

Public Types

typedef ElemTypeVector elem_type_vector_t
 define template parameter as nested type
 
typedef field_points< typename first_elements_x_type< ElemTypeVector >::type > base_t
 type of base class
 
typedef tmp::inherit< typename tmp::transform< elem_type_vector_t, tmp::inserter< typename tmp::empty< elem_type_vector_t >::type, tmp::push_back< tmp::_1, tmp::_2 > >, eigen_std_vector< tmp::_1 > >::type >::type elem_container_t
 combine elem_vector into a BIG heterogeneous std::vector container
 
typedef base_t::x_t x_t
 type of a nodal vector
 
typedef x_t::Scalar scalar_t
 type of a nodal coordinate
 
- Public Types inherited from NiHu::field_points< first_elements_x_type< ElemTypeVector >::type >
typedef first_elements_x_type< ElemTypeVector >::type x_t
 template parameter as nested type
 
typedef eigen_std_vector< x_t >::type::const_iterator iterator_t
 node iterator type
 

Public Member Functions

template<class node_t , class elem_t >
 mesh (node_t const &nodes, elem_t const &elements)
 build the mesh from mesh description matrices More...
 
template<class ElemType >
elem_iterator_t< ElemType >::type begin () const
 return begin iterator of the elements
 
template<class ElemType >
elem_iterator_t< ElemType >::type end () const
 return end iterator of the elements
 
template<class ElemType >
const ElemType & get_elem (size_t i) const
 return element with a given index
 
bool add_elem (unsigned const input[])
 add a new element to the mesh More...
 
void add_node (scalar_t input[])
 add a new node to the mesh More...
 
template<class elem_t >
const elem_tpush_element (element_base< elem_t > const &e)
 add a new element to the mesh More...
 
unsigned get_num_elements () const
 return number of elements More...
 
- Public Member Functions inherited from NiHu::field_points< first_elements_x_type< ElemTypeVector >::type >
void add_point (x_t const &p)
 add a point to the field point mesh More...
 
size_t get_num_points () const
 return number of points More...
 

Static Public Attributes

static const unsigned nDim = base_t::nDim
 number of dimensions of the mesh
 
- Static Public Attributes inherited from NiHu::field_points< first_elements_x_type< ElemTypeVector >::type >
static const unsigned nDim
 number of dimensions
 

Protected Attributes

elem_container_t m_elements
 element geometries (BIG heterogeneous container)
 
unsigned m_num_elements
 total number of elements in the mesh
 
- Protected Attributes inherited from NiHu::field_points< first_elements_x_type< ElemTypeVector >::type >
eigen_std_vector< x_t >::type points
 nodal coordinates
 

Detailed Description

template<class ElemTypeVector>
class NiHu::mesh< ElemTypeVector >

container class for a mesh

Template Parameters
ElemTypeVectorcompile time vector of the contained element types

Definition at line 110 of file mesh.hpp.

Constructor & Destructor Documentation

◆ mesh()

template<class ElemTypeVector >
template<class node_t , class elem_t >
NiHu::mesh< ElemTypeVector >::mesh ( node_t const &  nodes,
elem_t const &  elements 
)
inline

build the mesh from mesh description matrices

Template Parameters
node_ttype of nodes matrix
elem_ttype of elements matrix
Parameters
[in]nodesmatrix of nodal coordinates
[in]elementsmatrix of element node indices

Definition at line 186 of file mesh.hpp.

Member Function Documentation

◆ add_elem()

template<class ElemTypeVector >
bool NiHu::mesh< ElemTypeVector >::add_elem ( unsigned const  input[])
inline

add a new element to the mesh

Parameters
inputarray of unsigned values. input[0] is the elem ID, the subsequent elements are the nodal indices in the mesh
Returns
true if the element is inserted into the mesh

Definition at line 239 of file mesh.hpp.

◆ add_node()

template<class ElemTypeVector >
void NiHu::mesh< ElemTypeVector >::add_node ( scalar_t  input[])
inline

add a new node to the mesh

Parameters
inputarray of scalars containing the coordinates

Definition at line 253 of file mesh.hpp.

◆ get_num_elements()

template<class ElemTypeVector >
unsigned NiHu::mesh< ElemTypeVector >::get_num_elements ( ) const
inline

return number of elements

Returns
number of elements in the mesh

Definition at line 277 of file mesh.hpp.

◆ push_element()

template<class ElemTypeVector >
template<class elem_t >
const elem_t& NiHu::mesh< ElemTypeVector >::push_element ( element_base< elem_t > const &  e)
inline

add a new element to the mesh

Template Parameters
elem_tthe element type
Parameters
ethe element to be added

Definition at line 267 of file mesh.hpp.


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