DUNE PDELab (2.8)

raviartthomasfem.hh
1// -*- tab-width: 4; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_FINITEELEMENTMAP_RAVIARTTHOMASFEM_HH
3#define DUNE_PDELAB_FINITEELEMENTMAP_RAVIARTTHOMASFEM_HH
4
6
7#include <dune/pdelab/common/topologyutility.hh>
8#include <dune/pdelab/finiteelementmap/rt0simplex2dfem.hh>
9#include <dune/pdelab/finiteelementmap/rt1simplex2dfem.hh>
10#include <dune/pdelab/finiteelementmap/rt0cube2dfem.hh>
11#include <dune/pdelab/finiteelementmap/rt1cube2dfem.hh>
12#include <dune/pdelab/finiteelementmap/rt2cube2dfem.hh>
13#include <dune/pdelab/finiteelementmap/rt0simplex3dfem.hh>
14#include <dune/pdelab/finiteelementmap/rt0cube3dfem.hh>
15#include <dune/pdelab/finiteelementmap/rt1cube3dfem.hh>
16
17
18namespace Dune {
19 namespace PDELab {
20
21#ifndef DOXYGEN
22
23 namespace detail {
24
26
31 template<typename GV, int dim, GeometryType::BasicType basic_type, typename D, typename R, std::size_t k>
32 struct RaviartThomasLocalFiniteElementMapBaseSelector
33 {
34 static_assert((AlwaysFalse<GV>::value),"The requested type of Raviart-Thomas element is not implemented, sorry!");
35 };
36
37
38 // ********************************************************************************
39 // Specializations
40 // ********************************************************************************
41
42 template<typename GV, typename D, typename R>
43 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,2,GeometryType::simplex,D,R,0>
44 {
45 typedef RT0Simplex2DLocalFiniteElementMap<GV,D,R> type;
46 };
47
48 template<typename GV, typename D, typename R>
49 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,2,GeometryType::simplex,D,R,1>
50 {
51 typedef RT1Simplex2DLocalFiniteElementMap<GV,D,R> type;
52 };
53
54
55 template<typename GV, typename D, typename R>
56 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,2,GeometryType::cube,D,R,0>
57 {
58 typedef RT0Cube2DLocalFiniteElementMap<GV,D,R> type;
59 };
60
61 template<typename GV, typename D, typename R>
62 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,2,GeometryType::cube,D,R,1>
63 {
64 typedef RT1Cube2DLocalFiniteElementMap<GV,D,R> type;
65 };
66
67 template<typename GV, typename D, typename R>
68 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,2,GeometryType::cube,D,R,2>
69 {
70 typedef RT2Cube2DLocalFiniteElementMap<GV,D,R> type;
71 };
72
73
74 template<typename GV, typename D, typename R>
75 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,3,GeometryType::simplex,D,R,0>
76 {
77 typedef RT0Simplex3DLocalFiniteElementMap<GV,D,R> type;
78 };
79
80
81 template<typename GV, typename D, typename R>
82 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,3,GeometryType::cube,D,R,0>
83 {
84 typedef RT0Cube3DLocalFiniteElementMap<GV,D,R> type;
85 };
86
87 template<typename GV, typename D, typename R>
88 struct RaviartThomasLocalFiniteElementMapBaseSelector<GV,3,GeometryType::cube,D,R,1>
89 {
90 typedef RT1Cube3DLocalFiniteElementMap<GV,D,R> type;
91 };
92
93 } // end namespace detail
94
95#endif // DOXYGEN
96
97
99
120 template<typename GV,
121 typename D,
122 typename R,
123 std::size_t k,
124 GeometryType::BasicType basic_type = BasicTypeFromDimensionAndTopologyId<
125 GV::dimension,
126 Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId
127 >::value
128 >
130 public detail::RaviartThomasLocalFiniteElementMapBaseSelector<GV,GV::dimension,basic_type,D,R,k>::type
131 {
132
133 public:
134
136 static constexpr int dimension = GV::dimension;
137
140 : detail::RaviartThomasLocalFiniteElementMapBaseSelector<GV,GV::dimension,basic_type,D,R,k>::type(gv)
141 {}
142
143 };
144
145#ifndef DOXYGEN
146
147 // Specialization for grids that don't provide a valid topology id for their cells.
148 template<typename GV, typename D, typename R, std::size_t k>
149 class RaviartThomasLocalFiniteElementMap<GV,D,R,k,GeometryType::none>
150 {
151 static_assert((AlwaysFalse<GV>::value),
152 "Your chosen grid does not export a usable topology id for its cells."
153 "Please provide the correct GeometryType::BasicType as an additional template parameter.");
154 };
155
156#endif // DOXYGEN
157
158 } // end namespace PDELab
159} // end namespace Dune
160
161#endif // DUNE_PDELAB_FINITEELEMENTMAP_RAVIARTTHOMASFEM_HH
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:123
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition: type.hh:129
Raviart-Thomas elements of order k.
Definition: raviartthomasfem.hh:131
static constexpr int dimension
The dimension of the finite elements returned by this map.
Definition: raviartthomasfem.hh:136
RaviartThomasLocalFiniteElementMap(const GV &gv)
Constructs a finite element map on the GridView gv.
Definition: raviartthomasfem.hh:139
A set of traits classes to store static information about grid implementation.
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:470
constexpr GeometryType none(unsigned int dim)
Returns a GeometryType representing a singular of dimension dim.
Definition: type.hh:479
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:461
Dune namespace.
Definition: alignedallocator.hh:11
template which always yields a false value
Definition: typetraits.hh:124
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)