dune-mmesh (unstable)

dgfparser.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_MMESH_INTERFACE_DGFPARSER_HH
4#define DUNE_MMESH_INTERFACE_DGFPARSER_HH
5
6// System includes
7#include <memory>
8#include <utility>
9#include <vector>
10
11// Dune includes
12#include <dune/grid/common/intersection.hh>
13#include <dune/grid/io/file/dgfparser/blocks/projection.hh>
14#include <dune/grid/io/file/dgfparser/dgfparser.hh>
15#include <dune/grid/io/file/dgfparser/parser.hh>
16
17// MMesh includes
18#include <dune/mmesh/grid/explicitgridfactory.hh>
19
20namespace Dune {
21
22// External Forward Declarations
23// -----------------------------
24template <class GridImp, class IntersectionImp>
25class Intersection;
26
27// dummy specialization of DGFGridFactory for MMeshInterfaceGrid
28// -------------------------------------------------------------
29template <class MMeshImp>
30struct DGFGridFactory<MMeshInterfaceGrid<MMeshImp> > {
31 typedef MMeshInterfaceGrid<MMeshImp> Grid;
32 const static int dimension = Grid::dimension;
33 typedef MPIHelper::MPICommunicator MPICommunicatorType;
34 typedef typename Grid::template Codim<0>::Entity Element;
35 typedef typename Grid::template Codim<dimension>::Entity Vertex;
36
37 explicit DGFGridFactory(
38 std::istream &input,
39 MPICommunicatorType comm = MPIHelper::getCommunicator());
40 explicit DGFGridFactory(
41 const std::string &filename,
42 MPICommunicatorType comm = MPIHelper::getCommunicator());
43
45 Grid *grid() const {
46 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
47 return grid_;
48 }
49
51 template <class Intersection>
52 bool wasInserted(const Intersection &intersection) const {
53 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
54 return false;
55 }
56
58 template <class Intersection>
59 int boundaryId(const Intersection &intersection) const {
60 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
61 return 0;
62 }
63
65 std::vector<double> parameter(const Element &element) {
66 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
67 return {0.0};
68 }
69
71 std::vector<double> parameter(const Vertex &vertex) {
72 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
73 return {0.0};
74 }
75
77 bool haveBoundaryParameters() const {
78 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
79 return false;
80 }
81
82 template <class GG, class II>
83 const DGFBoundaryParameter::type boundaryParameter(
84 const Intersection<GG, II> &intersection) const {
85 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
86 return DGFBoundaryParameter::type();
87 }
88
89 template <int codim>
90 int numParameters() const {
91 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
92 return 0;
93 }
94
95 private:
96 Grid *grid_;
97 DuneGridFormatParser dgf_;
98};
99
100// Implementation of DGFGridFactory for MMeshInterfaceGrid
101// -------------------------------------------------------
102
104template <class MMeshImp>
105inline DGFGridFactory<MMeshInterfaceGrid<MMeshImp> >::DGFGridFactory(
106 std::istream &input, MPICommunicatorType comm)
107 : dgf_(0, 1) {
108 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
109}
110
112template <class MMeshImp>
113inline DGFGridFactory<MMeshInterfaceGrid<MMeshImp> >::DGFGridFactory(
114 const std::string &filename, MPICommunicatorType comm)
115 : dgf_(0, 1) {
116 DUNE_THROW(NotImplemented, "DGFGridFactory for MMeshInterfaceGrid");
117}
118
119} // namespace Dune
120
121#endif
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Sep 4, 22:38, 2025)