ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
geometry_reader.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2024 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11#include <deal.II/grid/grid_in.h>
12
13#include <fstream>
14
15namespace ryujin
16{
17 namespace Geometries
18 {
31 template <int dim>
32 class Reader : public Geometry<dim>
33 {
34 public:
35 Reader(const std::string &subsection)
36 : Geometry<dim>("reader", subsection)
37 {
38 filename_ = "ryujin.msh";
39 this->add_parameter("filename",
40 filename_,
41 "The mesh file to read in via dealii::GridIn. This "
42 "class supports, among others, reading in Gmsh "
43 "*.msh files, and the *.ucd file format.");
44
45 use_simplices_ = false;
46 this->add_parameter(
47 "simplex mesh",
48 use_simplices_,
49 "If set to true, the triangulation is assumed to use simplices "
50 "instead of quadrangles.");
51 }
52
54 dealii::Triangulation<dim> &triangulation) const final
55 {
56 dealii::GridIn<dim> gridin;
57 gridin.attach_triangulation(triangulation);
58 gridin.read(filename_);
59 }
60
62 populate_hp_collections(const unsigned int /*fe_degree*/,
64 & /*collection*/) const override
65 {
66 if (use_simplices_) {
68 } else {
70 }
71 }
72
73 private:
74 std::string filename_;
75 bool use_simplices_;
76 };
77 } // namespace Geometries
78} // namespace ryujin
Reader(const std::string &subsection)
Geometry< dim >::HP_Collection populate_hp_collections(const unsigned int, typename ryujin::Discretization< dim >::Collection &) const override
void create_coarse_triangulation(dealii::Triangulation< dim > &triangulation) const final