ryujin 2.1.1 revision 46bf70e400e423a8ffffe8300887eeb35b8dfb2c
geometry_reader.h
Go to the documentation of this file.
1#pragma once
2
3#include <compile_time_options.h>
4
6
7#include <deal.II/grid/grid_in.h>
8
9#include <fstream>
10
11namespace ryujin
12{
13 namespace Geometries
14 {
27 template <int dim>
28 class Reader : public Geometry<dim>
29 {
30 public:
31 Reader(const std::string &subsection)
32 : Geometry<dim>("reader", subsection)
33 {
34 filename_ = "ryujin.msh";
35 this->add_parameter("filename",
36 filename_,
37 "The mesh file to read in via dealii::GridIn. This "
38 "class supports, among others, reading in Gmsh "
39 "*.msh files, and the *.ucd file format.");
40 }
41
43 dealii::Triangulation<dim> &triangulation) const final
44 {
45 dealii::GridIn<dim> gridin;
46 gridin.attach_triangulation(triangulation);
47 gridin.read(filename_);
48 }
49
50 private:
51 std::string filename_;
52 };
53 } // namespace Geometries
54} // namespace ryujin
Reader(const std::string &subsection)
void create_coarse_triangulation(dealii::Triangulation< dim > &triangulation) const final