dgfparser.hh
1 // -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=2 sw=2 sts=2:
3 #ifndef DUNE_POLYHEDRALGRID_DGFPARSER_HH
4 #define DUNE_POLYHEDRALGRID_DGFPARSER_HH
5 
6 #include <dune/common/typetraits.hh>
7 
8 #include <dune/grid/io/file/dgfparser/dgfparser.hh>
9 
10 #include <dune/grid/polyhedralgrid/grid.hh>
11 
12 namespace Dune
13 {
14 
15 #warning TODO: non-trivial DGFGridFactory
16 
17  // DGFGridFactory for PolyhedralGrid
18  // -------------------------
19 
20  template< int dim, int dimworld >
21  struct DGFGridFactory< PolyhedralGrid< dim, dimworld > >
22  {
24 
25  const static int dimension = Grid::dimension;
26  typedef MPIHelper::MPICommunicator MPICommunicator;
27  typedef typename Grid::template Codim<0>::Entity Element;
28  typedef typename Grid::template Codim<dimension>::Entity Vertex;
29 
30  explicit DGFGridFactory ( std::istream &input,
31  MPICommunicator comm = MPIHelper::getCommunicator() )
32  : grid_( nullptr )
33  {
34  }
35 
36  explicit DGFGridFactory ( const std::string &filename,
37  MPICommunicator comm = MPIHelper::getCommunicator() )
38  : grid_( nullptr )
39  {
40  }
41 
42  Grid *grid () const
43  {
44  return grid_;
45  }
46 
47  template< class Intersection >
48  bool wasInserted ( const Intersection &intersection ) const
49  {
50  return false;
51  }
52 
53  template< class Intersection >
54  int boundaryId ( const Intersection &intersection ) const
55  {
56  return false;
57  }
58 
59  bool haveBoundaryParameters () const
60  {
61  return false;
62  }
63 
64  template< int codim >
65  int numParameters () const
66  {
67  return 0;
68  }
69 
70  template< class Intersection >
71  const typename DGFBoundaryParameter::type &
72  boundaryParameter ( const Intersection &intersection ) const
73  {
74  return DGFBoundaryParameter::defaultValue();
75  }
76 
77  template< class Entity >
78  std::vector< double > &parameter ( const Entity &entity )
79  {
80  static std::vector<double> dummy;
81  return dummy;
82  }
83 
84  private:
85  Grid *grid_;
86  };
87 
88 
89 
90  // DGFGridInfo for PolyhedralGrid
91  // ----------------------
92 
93  template< int dim, int dimworld >
94  struct DGFGridInfo< PolyhedralGrid< dim, dimworld > >
95  {
96  static int refineStepsForHalf ()
97  {
98  return 0;
99  }
100 
101  static double refineWeight ()
102  {
103  return 0;
104  }
105  };
106 
107 } // namespace Dune
108 
109 #endif // #ifndef DUNE_POLYHEDRALGRID_DGFPARSER_HH
Holds the implementation of the CpGrid as a pimple.
Definition: OpmParserIncludes.hpp:42
identical grid wrapper
Definition: declaration.hh:10