dune-pdelab  2.0.0
brezzidouglasmarinifem.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PDELAB_FINITELEMENTMAP_BREZZIDOUGLASMARINIFEM_HH
3 #define DUNE_PDELAB_FINITELEMENTMAP_BREZZIDOUGLASMARINIFEM_HH
4 
5 #include <dune/common/static_assert.hh>
6 #include <dune/grid/common/capabilities.hh>
7 
11 
12 
13 namespace Dune {
14  namespace PDELab {
15 
16 #ifndef DOXYGEN
17 
18  namespace detail {
19 
21 
26  template<typename GV, int dim, GeometryType::BasicType basic_type, typename D, typename R, std::size_t k>
27  struct BrezziDouglasMariniLocalFiniteElementMapBaseSelector
28  {
29  dune_static_assert((AlwaysFalse<GV>::value),"The requested type of Brezzi-Douglas-Marini element is not implemented, sorry!");
30  };
31 
32 
33  // ********************************************************************************
34  // Specializations
35  // ********************************************************************************
36 
37  template<typename GV, typename D, typename R>
38  struct BrezziDouglasMariniLocalFiniteElementMapBaseSelector<GV,2,GeometryType::simplex,D,R,1>
39  {
40  typedef BDM1Simplex2DLocalFiniteElementMap<GV,D,R> type;
41  };
42 
43  template<typename GV, typename D, typename R>
44  struct BrezziDouglasMariniLocalFiniteElementMapBaseSelector<GV,2,GeometryType::cube,D,R,1>
45  {
46  typedef BDM1Cube2DLocalFiniteElementMap<GV,D,R> type;
47  };
48 
49  } // end namespace detail
50 
51 #endif // DOXYGEN
52 
53 
56 
73  template<typename GV,
74  typename D,
75  typename R,
76  std::size_t k,
77  GeometryType::BasicType basic_type = BasicTypeFromDimensionAndTopologyId<
78  GV::dimension,
79  Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId
80  >::value
81  >
83  public detail::BrezziDouglasMariniLocalFiniteElementMapBaseSelector<GV,GV::dimension,basic_type,D,R,k>::type
84  {
85 
86  public:
87 
90  : detail::BrezziDouglasMariniLocalFiniteElementMapBaseSelector<GV,GV::dimension,basic_type,D,R,k>::type(gv)
91  {}
92 
93  };
94 
95 #ifndef DOXYGEN
96 
97  // Specialization for grids that don't provide a valid topology id for their cells.
98  template<typename GV, typename D, typename R, std::size_t k>
99  class BrezziDouglasMariniLocalFiniteElementMap<GV,D,R,k,GeometryType::none>
100  {
101  dune_static_assert((AlwaysFalse<GV>::value),
102  "Your chosen grid does not export a usable topology id for its cells."
103  "Please provide the correct GeometryType::BasicType as an additional template parameter.");
104  };
105 
106 #endif // DOXYGEN
107 
108  } // end namespace PDELab
109 } // end namespace Dune
110 
111 #endif // DUNE_PDELAB_FINITELEMENTMAP_BREZZIDOUGLASMARINIFEM_HH
Definition: brezzidouglasmarinifem.hh:82
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
BrezziDouglasMariniLocalFiniteElementMap(const GV &gv)
Constructs a finite element map on the GridView gv.
Definition: brezzidouglasmarinifem.hh:89