DUNE-FEM (unstable)

capabilities.hh
1#ifndef DUNE_FEM_SPACE_LOCALFINITEELEMENT_CAPABILITIES_HH
2#define DUNE_FEM_SPACE_LOCALFINITEELEMENT_CAPABILITIES_HH
3
4
5
6#include <dune/fem/gridpart/common/capabilities.hh>
7#include <dune/fem/space/common/capabilities.hh>
8#include <dune/fem/space/shapefunctionset/selectcaching.hh>
9
10#include <dune/fem/quadrature/interpolationquadrature.hh>
11
12namespace Dune
13{
14
15 namespace Fem
16 {
17
18 // External Forward Declarations
19 // -----------------------------
20
21 template< class LFEMap, class FunctionSpace, class Storage = CachingStorage >
22 class LocalFiniteElementSpace;
23
24 template< class LFEMap, class FunctionSpace, class Storage = CachingStorage >
25 class DiscontinuousLocalFiniteElementSpace;
26
27 template< class FunctionSpace, class GridPart, unsigned int order,
28 template< class, unsigned int > class PointSet>
29 struct FixedOrderLagrangeFiniteElementMap;
30
31
32 namespace Capabilities
33 {
34
35 template< class LFEMap, class FunctionSpace, class Storage >
36 struct hasFixedPolynomialOrder< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
37 {
38 static const bool v = false;
39 };
40
41 template< class LFEMap, class FunctionSpace, class Storage >
42 struct hasFixedPolynomialOrder< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
43 {
44 static const bool v = false;
45 };
46
47
48 template< class LFEMap, class FunctionSpace, class Storage >
49 struct hasStaticPolynomialOrder< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
50 {
51 static const bool v = false;
52 static const int order = 6; // default polynomial order if not specified otherwise
53 };
54
55 template< class LFEMap, class FunctionSpace, class Storage >
56 struct hasStaticPolynomialOrder< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
57 {
58 static const bool v = false;
59 static const int order = 6; // default polynomial order if not specified otherwise
60 };
61
62
63 template< class LFEMap, class FunctionSpace, class Storage >
64 struct isContinuous< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
65 {
66 static const bool v = false;
67 };
68
69 template< class LFEMap, class FunctionSpace, class Storage >
70 struct isContinuous< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
71 {
72 static const bool v = false;
73 };
74
75
76 template< class LFEMap, class FunctionSpace, class Storage >
77 struct isLocalized< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
78 {
79 static const bool v = true;
80 };
81
82 template< class LFEMap, class FunctionSpace, class Storage >
83 struct isLocalized< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
84 {
85 static const bool v = true;
86 };
87
88
89 template< class LFEMap, class FunctionSpace, class Storage >
90 struct isAdaptive< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
91 {
92 static const bool v = false;
93 };
94
95 template< class LFEMap, class FunctionSpace, class Storage >
96 struct isAdaptive< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
97 {
98 static const bool v = false;
99 };
100
101
102 template< class LFEMap, class FunctionSpace, class Storage >
103 struct threadSafe< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
104 {
105 static const bool v = false;
106 };
107
108 template< class LFEMap, class FunctionSpace, class Storage >
109 struct threadSafe< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
110 {
111 static const bool v = false;
112 };
113
114
115 template< class LFEMap, class FunctionSpace, class Storage >
116 struct viewThreadSafe< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
117 {
118 static const bool v = false;
119 };
120
121 template< class LFEMap, class FunctionSpace, class Storage >
122 struct viewThreadSafe< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
123 {
124 static const bool v = false;
125 };
126
127
128#if HAVE_DUNE_LOCALFUNCTIONS
129 namespace detail
130 {
131
132 struct DefaultQuadratureEquidistant
133 {
134 template <class F, int d>
135 using DefaultQuadratureTraits = Dune::Fem::EquidistantQuadratureTraits< F, d >;
136
137 // TODO: double check this
138 static int volumeOrder ( const int k ) { return k; }
139 static int surfaceOrder( const int k ) { return k; }
140 };
141
142 struct DefaultQuadratureGaussLobatto
143 {
144 template <class F, int d>
145 using DefaultQuadratureTraits = Dune::Fem::GaussLobattoQuadratureTraits< F, d >;
146
147 static int volumeOrder ( const int k ) { return (k > 0) ? (2 * k - 1) : 0; }
148 static int surfaceOrder( const int k ) { return (k > 0) ? (2 * k - 1) : 0; }
149 };
150
151 struct DefaultQuadratureGaussLegendre
152 {
153 template <class F, int d>
154 using DefaultQuadratureTraits = Dune::Fem::GaussLegendreQuadratureTraits< F, d >;
155
156 static int volumeOrder ( const int k ) { return 2 * k + 1; }
157 static int surfaceOrder( const int k ) { return 2 * k + 1; }
158 };
159
160 struct DefaultQuadratureCellCenters
161 {
162 template <class F, int d>
163 using DefaultQuadratureTraits = Dune::Fem::CellCentersQuadratureTraits< F, d >;
164
165 static int volumeOrder ( const int k ) { return k; }
166 static int surfaceOrder( const int k ) { return k; }
167 };
168
169 // default uses the default values for all spaces (see space/common/capabilities.hh)
170 template< class LFEMap >
171 struct DefaultQuadratureSpec : public Dune::Fem::Capabilities::DefaultQuadrature< LFEMap >
172 {};
173
174
176 template < class FunctionSpace, class GridPart, unsigned int order >
177 struct DefaultQuadratureSpec< Dune::Fem::FixedOrderLagrangeFiniteElementMap< FunctionSpace, GridPart, order, Dune::EquidistantPointSetDerived > >
178 : public DefaultQuadratureEquidistant {};
179
181 template < class FunctionSpace, class GridPart, unsigned int order >
182 struct DefaultQuadratureSpec< Dune::Fem::FixedOrderLagrangeFiniteElementMap< FunctionSpace, GridPart, order, Dune::GaussLobattoPointSet > >
183 : public DefaultQuadratureGaussLobatto {};
184
186 template < class FunctionSpace, class GridPart, unsigned int order >
187 struct DefaultQuadratureSpec< Dune::Fem::FixedOrderLagrangeFiniteElementMap< FunctionSpace, GridPart, order, Dune::GaussLegendrePointSet > >
188 : public DefaultQuadratureGaussLegendre {};
189
191 template < class FunctionSpace, class GridPart, unsigned int order >
192 struct DefaultQuadratureSpec< Dune::Fem::FixedOrderLagrangeFiniteElementMap< FunctionSpace, GridPart, order, Dune::CellCentersPointSet > >
193 : public DefaultQuadratureCellCenters {};
194 } // end namespace detail
195
196 template< class LFEMap, class FunctionSpace, class Storage >
197 struct DefaultQuadrature< LocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
198 : public detail::DefaultQuadratureSpec< LFEMap >
199 {
200 };
201
202 template< class LFEMap, class FunctionSpace, class Storage >
203 struct DefaultQuadrature< DiscontinuousLocalFiniteElementSpace< LFEMap, FunctionSpace, Storage > >
204 : public detail::DefaultQuadratureSpec< LFEMap >
205 {
206 };
207#endif // #ifndef HAVE_DUNE_LOCALFUNCTIONS
208
209
210 } // namespace Capabilities
211
212 } // namespace Fem
213
214} // namespace Dune
215
216
217#endif // #ifndef DUNE_FEM_SPACE_LOCALFINITEELEMENT_CAPABILITIES_HH
Dune namespace.
Definition: alignedallocator.hh:13
specialize when quadrature other than the standard quadrature should be used for volume and surface i...
Definition: capabilities.hh:132
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)