DUNE PDELab (2.7)

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