3 #ifndef DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH 4 #define DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH 21 template<
typename... Args>
22 struct HasJacobianApplyVolume
25 auto require(LO&& lo) -> decltype(
26 lo.jacobian_apply_volume(std::declval<Args>()...)
30 template<
typename... Args>
31 struct HasJacobianApplyVolumePostSkeleton
34 auto require(LO&& lo) -> decltype(
35 lo.jacobian_apply_volume_post_skeleton(std::declval<Args>()...)
39 template<
typename... Args>
40 struct HasJacobianApplyBoundary
43 auto require(LO&& lo) -> decltype(
44 lo.jacobian_apply_boundary(std::declval<Args>()...)
48 template<
typename... Args>
49 struct HasJacobianApplySkeleton
52 auto require(LO&& lo) -> decltype(
53 lo.jacobian_apply_skeleton(std::declval<Args>()...)
62 template<
typename LA,
bool doIt>
65 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
66 static void pattern_volume (
const LA& la,
const LFSU& lfsu,
const LFSV& lfsv, LocalPattern& pattern)
69 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
70 static void pattern_volume_post_skeleton
72 const LFSU& lfsu,
const LFSV& lfsv,
73 LocalPattern& pattern)
76 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
78 const LFSU& lfsu_n,
const LFSV& lfsv_n,
79 LocalPattern& pattern_sn,
80 LocalPattern& pattern_ns)
83 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
85 const LFSU& lfsu_s,
const LFSV& lfsv_s,
86 LocalPattern& pattern_ss)
89 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
90 static void alpha_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, R& r)
93 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
97 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
99 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
100 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
104 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
106 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
111 template<
typename EG,
typename LFSV,
typename R>
112 static void lambda_volume (
const LA& la,
const EG& eg,
const LFSV& lfsv, R& r)
115 template<
typename EG,
typename LFSV,
typename R>
119 template<
typename IG,
typename LFSV,
typename R>
121 const LFSV& lfsv_s,
const LFSV& lfsv_n,
125 template<
typename IG,
typename LFSV,
typename R>
130 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
131 static void jacobian_apply_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, Y& y)
134 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
138 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
140 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
141 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
145 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
147 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
153 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
157 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
161 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
163 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
164 const LFSU& lfsu_n,
const X& x_n,
const X& z_n,
const LFSV& lfsv_n,
168 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
170 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
176 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
177 static void jacobian_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, M & mat)
180 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
184 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
186 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
187 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
188 M & mat_ss, M & mat_sn,
189 M & mat_ns, M & mat_nn)
192 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
194 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
199 template<
typename LA>
202 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
203 static void pattern_volume (
const LA& la,
const LFSU& lfsu,
const LFSV& lfsv, LocalPattern& pattern)
205 la.pattern_volume(lfsu,lfsv,pattern);
207 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
208 static void pattern_volume_post_skeleton
210 const LFSU& lfsu,
const LFSV& lfsv,
211 LocalPattern& pattern)
213 la.pattern_volume_post_skeleton(lfsu,lfsv,pattern);
215 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
217 const LFSU& lfsu_n,
const LFSV& lfsv_n,
218 LocalPattern& pattern_sn,
219 LocalPattern& pattern_ns)
221 la.pattern_skeleton(lfsu_s,lfsv_s,lfsu_n,lfsv_n,
222 pattern_sn, pattern_ns);
224 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
226 const LFSU& lfsu_s,
const LFSV& lfsv_s,
227 LocalPattern& pattern_ss)
229 la.pattern_boundary(lfsu_s,lfsv_s,pattern_ss);
232 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
233 static void alpha_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, R& r)
235 la.alpha_volume(eg,lfsu,x,lfsv,r);
237 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
240 la.alpha_volume_post_skeleton(eg,lfsu,x,lfsv,r);
242 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
244 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
245 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
248 la.alpha_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,r_s,r_n);
250 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
252 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
255 la.alpha_boundary(ig,lfsu_s,x_s,lfsv_s,r_s);
258 template<
typename EG,
typename LFSV,
typename R>
259 static void lambda_volume (
const LA& la,
const EG& eg,
const LFSV& lfsv, R& r)
261 la.lambda_volume(eg,lfsv,r);
263 template<
typename EG,
typename LFSV,
typename R>
266 la.lambda_volume_post_skeleton(eg,lfsv,r);
268 template<
typename IG,
typename LFSV,
typename R>
270 const LFSV& lfsv_s,
const LFSV& lfsv_n,
273 la.lambda_skeleton(ig, lfsv_s, lfsv_n, r_s, r_n);
275 template<
typename IG,
typename LFSV,
typename R>
278 la.lambda_boundary(ig,lfsv,r);
282 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
283 static void jacobian_apply_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, Y& y)
286 models<impl::HasJacobianApplyVolume<EG,LFSU,X,LFSV,Y&>,LA>(),
287 "Your local operator does not implement jacobian_apply_volume() for linear problems (without explicit Jacobian evaluation point)" 289 la.jacobian_apply_volume(eg,lfsu,x,lfsv,y);
292 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
296 models<impl::HasJacobianApplyVolumePostSkeleton<EG,LFSU,X,LFSV,Y&>,LA>(),
297 "Your local operator does not implement jacobian_apply_volume_post_skeleton() for linear problems (without explicit Jacobian evaluation point)" 299 la.jacobian_apply_volume_post_skeleton(eg,lfsu,x,lfsv,y);
302 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
304 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
305 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
309 models<impl::HasJacobianApplySkeleton<IG,LFSU,X,LFSV,LFSU,X,LFSV,Y&,Y&>,LA>(),
310 "Your local operator does not implement jacobian_apply_skeleton() for linear problems (without explicit Jacobian evaluation point)" 312 la.jacobian_apply_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,y_s,y_n);
314 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
316 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
320 models<impl::HasJacobianApplyBoundary<IG,LFSU,X,LFSV,Y&>,LA>(),
321 "Your local operator does not implement jacobian_apply_boundary() for linear problems (without explicit Jacobian evaluation point)" 323 la.jacobian_apply_boundary(ig,lfsu_s,x_s,lfsv_s,y_s);
327 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
329 ->
typename std::enable_if<models<impl::HasJacobianApplyVolume<EG,LFSU,X,X,LFSV,Y&>,LA>()>::type
331 la.jacobian_apply_volume(eg,lfsu,x,z,lfsv,y);
334 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
336 ->
typename std::enable_if<not models<impl::HasJacobianApplyVolume<EG,LFSU,X,X,LFSV,Y&>,LA>()>::type
338 static_assert(
AlwaysFalse<EG>::value,
"Your local operator does not implement jacobian_apply_volume() for nonlinear problems (Jacobian evaluation point given as argument)");
341 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
344 la.jacobian_apply_volume_post_skeleton(eg,lfsu,x,z,lfsv,y);
346 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
348 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
349 const LFSU& lfsu_n,
const X& x_n,
const X& z_n,
const LFSV& lfsv_n,
352 la.jacobian_apply_skeleton(ig,lfsu_s,x_s,z_s,lfsv_s,lfsu_n,x_n,z_n,lfsv_n,y_s,y_n);
354 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
356 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
359 la.jacobian_apply_boundary(ig,lfsu_s,x_s,z_s,lfsv_s,y_s);
363 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
364 static void jacobian_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, M & mat)
366 la.jacobian_volume(eg,lfsu,x,lfsv,mat);
368 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
371 la.jacobian_volume_post_skeleton(eg,lfsu,x,lfsv,mat);
373 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
375 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
376 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
377 M & mat_ss, M & mat_sn,
378 M & mat_ns, M & mat_nn)
380 la.jacobian_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,
381 mat_ss, mat_sn, mat_ns, mat_nn);
383 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
385 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
388 la.jacobian_boundary(ig,lfsu_s,x_s,lfsv_s,mat_ss);
395 #endif // DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH static void jacobian_apply_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:135
static const unsigned int value
Definition: gridfunctionspace/tags.hh:177
static void jacobian_apply_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, Y &y_s)
Definition: callswitch.hh:315
static void alpha_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, R &r_s, R &r_n)
Definition: callswitch.hh:98
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:264
static void nonlinear_jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const X &z, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:154
static void nonlinear_jacobian_apply_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const X &z, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:158
static void alpha_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:94
const IG & ig
Definition: constraints.hh:148
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:364
static void pattern_boundary(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss)
Definition: callswitch.hh:84
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:126
Definition: adaptivity.hh:27
static auto nonlinear_jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const X &z, const LFSV &lfsv, Y &y) -> typename std::enable_if< not models< impl::HasJacobianApplyVolume< EG, LFSU, X, X, LFSV, Y & >, LA >()>::type
Definition: callswitch.hh:335
static void pattern_skeleton(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const LFSV &lfsv_n, LocalPattern &pattern_sn, LocalPattern &pattern_ns)
Definition: callswitch.hh:77
static void nonlinear_jacobian_apply_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const X &z_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const X &z_n, const LFSV &lfsv_n, Y &y_s, Y &y_n)
Definition: callswitch.hh:162
static void jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:131
static void alpha_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:90
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:116
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:259
static void nonlinear_jacobian_apply_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const X &z_s, const LFSV &lfsv_s, Y &y_s)
Definition: callswitch.hh:355
static void pattern_volume(const LA &la, const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern)
Definition: callswitch.hh:66
static void jacobian_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:181
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:276
static void nonlinear_jacobian_apply_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const X &z, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:342
static void jacobian_apply_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:293
static void jacobian_apply_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, Y &y_s, Y &y_n)
Definition: callswitch.hh:139
static void pattern_skeleton(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const LFSV &lfsv_n, LocalPattern &pattern_sn, LocalPattern &pattern_ns)
Definition: callswitch.hh:216
static void alpha_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, R &r_s, R &r_n)
Definition: callswitch.hh:243
static void jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y)
Definition: callswitch.hh:283
static void alpha_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, R &r_s)
Definition: callswitch.hh:251
static auto nonlinear_jacobian_apply_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const X &z, const LFSV &lfsv, Y &y) -> typename std::enable_if< models< impl::HasJacobianApplyVolume< EG, LFSU, X, X, LFSV, Y & >, LA >()>::type
Definition: callswitch.hh:328
static void jacobian_apply_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, Y &y_s, Y &y_n)
Definition: callswitch.hh:303
static void alpha_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:238
static void lambda_skeleton(const LA &la, const IG &ig, const LFSV &lfsv_s, const LFSV &lfsv_n, R &r_s, R &r_n)
Definition: callswitch.hh:269
static void nonlinear_jacobian_apply_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const X &z_s, const LFSV &lfsv_s, Y &y_s)
Definition: callswitch.hh:169
static void jacobian_apply_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, Y &y_s)
Definition: callswitch.hh:146
static void lambda_skeleton(const LA &la, const IG &ig, const LFSV &lfsv_s, const LFSV &lfsv_n, R &r_s, R &r_n)
Definition: callswitch.hh:120
static void alpha_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, R &r_s)
Definition: callswitch.hh:105
static void jacobian_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, M &mat_ss, M &mat_sn, M &mat_ns, M &mat_nn)
Definition: callswitch.hh:185
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:112
static void nonlinear_jacobian_apply_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const X &z_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const X &z_n, const LFSV &lfsv_n, Y &y_s, Y &y_n)
Definition: callswitch.hh:347
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:177
static void pattern_boundary(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss)
Definition: callswitch.hh:225
static void jacobian_volume_post_skeleton(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:369
static void jacobian_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, M &mat_ss)
Definition: callswitch.hh:193
static void jacobian_boundary(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, M &mat_ss)
Definition: callswitch.hh:384
constexpr bool models()
Check if concept is modeled by given types.
Definition: concept.hh:282
static void alpha_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:233
static void pattern_volume(const LA &la, const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern)
Definition: callswitch.hh:203
static void jacobian_skeleton(const LA &la, const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const X &x_n, const LFSV &lfsv_n, M &mat_ss, M &mat_sn, M &mat_ns, M &mat_nn)
Definition: callswitch.hh:374
Definition: callswitch.hh:63