NiHu  2.0
read_off_mesh.hpp File Reference

export NiHu mesh from OFF format More...

#include "../core/mesh.hpp"
#include "../library/lib_element.hpp"
#include "../util/type2tag.hpp"
#include <string>
#include <fstream>
#include <stdexcept>
Include dependency graph for read_off_mesh.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef Eigen::Matrix< unsigned, Eigen::Dynamic, Eigen::Dynamic > NiHu::uMatrix
 
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > NiHu::dMatrix
 

Functions

template<class... Tags>
unsigned NiHu::nvert2elem_id (unsigned nvert, Tags...tags)
 convert number of vertices to element id More...
 
template<class... Tags>
void NiHu::read_off_data (std::istream &is, dMatrix &nodes, uMatrix &elements, Tags...tags)
 
template<class... Tags>
void NiHu::read_off_data (std::string const &fname, dMatrix &nodes, uMatrix &elements, Tags...tags)
 
template<class... Tags>
mesh< tmp::vector< typename tag2type< Tags >::type... > > NiHu::read_off_mesh (std::istream &is, Tags...tags)
 Read mesh from OFF format. More...
 
template<class... Tags>
mesh< tmp::vector< typename tag2type< Tags >::type... > > NiHu::read_off_mesh (std::string const &fname, Tags...tags)
 Read mesh from OFF format. More...
 

Detailed Description

export NiHu mesh from OFF format

Definition in file read_off_mesh.hpp.

Function Documentation

◆ nvert2elem_id()

template<class... Tags>
unsigned NiHu::nvert2elem_id ( unsigned  nvert,
Tags...  tags 
)

convert number of vertices to element id

Template Parameters
Tagselement tags to choose from
Parameters
[in]nvertthe number of element vertices
tagsthe possible element tags
Returns
the first element id from the vector Tags... that matches the number of vertices

Definition at line 73 of file read_off_mesh.hpp.

◆ read_off_mesh() [1/2]

template<class... Tags>
mesh<tmp::vector<typename tag2type<Tags>::type...> > NiHu::read_off_mesh ( std::istream &  is,
Tags...  tags 
)

Read mesh from OFF format.

Template Parameters
Tagsthe element tags to import
Parameters
[in]fnamethe file name
[in]isthe input stream
Returns
the imported mesh

Definition at line 132 of file read_off_mesh.hpp.

◆ read_off_mesh() [2/2]

template<class... Tags>
mesh<tmp::vector<typename tag2type<Tags>::type...> > NiHu::read_off_mesh ( std::string const &  fname,
Tags...  tags 
)

Read mesh from OFF format.

Template Parameters
Tagsthe element tags to import
Parameters
[in]fnamethe file name
[in]tagsthe element tag types
Returns
the imported mesh

Definition at line 153 of file read_off_mesh.hpp.