HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
mesh_reader.hpp
Go to the documentation of this file.
1// Class to read a mesh file (typ2 or GMesh mesh with GMSH support)
2//
3// Author: Liam Yemm (liam.yemm@monash.edu), Jerome Droniou (jerome.droniou@cnrs.fr)
4//
5
6#ifndef MESHREADER_HPP
7#define MESHREADER_HPP
8
9#include <string>
10#include <iostream>
11#include <fstream>
12#include <vector>
13#include <array>
14
15namespace Mesh2D
16{
17
18 // ----------------------------------------------------------------------------
19 // Class definition
20 // ----------------------------------------------------------------------------
21
29 {
30 public:
38 MeshReader(std::string file_name);
39
40 ~MeshReader() {} // default destructor
41
45 void read_file(std::vector<std::array<double, 2>> &vertices, std::vector<std::vector<size_t>> &cells);
46
53 void read_typ2file(std::vector<std::array<double, 2>> &vertices, std::vector<std::vector<size_t>> &cells);
54
55 #ifdef WITH_GMSH
62 void read_GMeshfile(std::vector<std::array<double, 2>> &vertices, std::vector<std::vector<size_t>> &cells);
63 #endif
64
65 private:
66 std::string _file_name;
67 };
68
69
70} // end namespace Mesh2D
71#endif
The MeshReader class provides functions to read a typ2 or GMesh file.
Definition mesh_reader.hpp:29
Generate vertices vertices
Definition generate_cartesian_mesh.m:26
id cells()
void read_file(std::vector< std::array< double, 2 > > &vertices, std::vector< std::vector< size_t > > &cells)
Definition mesh_reader.cpp:21
~MeshReader()
Definition mesh_reader.hpp:40
void read_typ2file(std::vector< std::array< double, 2 > > &vertices, std::vector< std::vector< size_t > > &cells)
Definition mesh_reader.cpp:44
Definition Mesh2D.hpp:7