3 #ifndef DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH 4 #define DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH 6 #include <dune/common/concept.hh> 7 #include <dune/common/typetraits.hh> 22 template<
typename... Args>
23 struct HasJacobianApplyVolume
26 auto require(LO&& lo) -> decltype(
27 lo.jacobian_apply_volume(std::declval<Args>()...)
31 template<
typename... Args>
32 struct HasJacobianApplyVolumePostSkeleton
35 auto require(LO&& lo) -> decltype(
36 lo.jacobian_apply_volume_post_skeleton(std::declval<Args>()...)
40 template<
typename... Args>
41 struct HasJacobianApplyBoundary
44 auto require(LO&& lo) -> decltype(
45 lo.jacobian_apply_boundary(std::declval<Args>()...)
49 template<
typename... Args>
50 struct HasJacobianApplySkeleton
53 auto require(LO&& lo) -> decltype(
54 lo.jacobian_apply_skeleton(std::declval<Args>()...)
63 template<
typename LA,
bool doIt>
66 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
67 static void pattern_volume (
const LA& la,
const LFSU& lfsu,
const LFSV& lfsv, LocalPattern& pattern)
70 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
71 static void pattern_volume_post_skeleton
73 const LFSU& lfsu,
const LFSV& lfsv,
74 LocalPattern& pattern)
77 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
79 const LFSU& lfsu_n,
const LFSV& lfsv_n,
80 LocalPattern& pattern_sn,
81 LocalPattern& pattern_ns)
84 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
86 const LFSU& lfsu_s,
const LFSV& lfsv_s,
87 LocalPattern& pattern_ss)
90 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
91 static void alpha_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, R& r)
94 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
98 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
100 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
101 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
105 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
107 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
112 template<
typename EG,
typename LFSV,
typename R>
113 static void lambda_volume (
const LA& la,
const EG& eg,
const LFSV& lfsv, R& r)
116 template<
typename EG,
typename LFSV,
typename R>
120 template<
typename IG,
typename LFSV,
typename R>
122 const LFSV& lfsv_s,
const LFSV& lfsv_n,
126 template<
typename IG,
typename LFSV,
typename R>
131 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
132 static void jacobian_apply_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, Y& y)
135 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
139 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
141 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
142 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
146 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
148 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
154 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
158 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
162 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
164 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
165 const LFSU& lfsu_n,
const X& x_n,
const X& z_n,
const LFSV& lfsv_n,
169 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
171 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
177 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
178 static void jacobian_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, M & mat)
181 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
185 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
187 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
188 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
189 M & mat_ss, M & mat_sn,
190 M & mat_ns, M & mat_nn)
193 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
195 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
200 template<
typename LA>
203 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
204 static void pattern_volume (
const LA& la,
const LFSU& lfsu,
const LFSV& lfsv, LocalPattern& pattern)
206 la.pattern_volume(lfsu,lfsv,pattern);
208 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
209 static void pattern_volume_post_skeleton
211 const LFSU& lfsu,
const LFSV& lfsv,
212 LocalPattern& pattern)
214 la.pattern_volume_post_skeleton(lfsu,lfsv,pattern);
216 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
218 const LFSU& lfsu_n,
const LFSV& lfsv_n,
219 LocalPattern& pattern_sn,
220 LocalPattern& pattern_ns)
222 la.pattern_skeleton(lfsu_s,lfsv_s,lfsu_n,lfsv_n,
223 pattern_sn, pattern_ns);
225 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
227 const LFSU& lfsu_s,
const LFSV& lfsv_s,
228 LocalPattern& pattern_ss)
230 la.pattern_boundary(lfsu_s,lfsv_s,pattern_ss);
233 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
234 static void alpha_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, R& r)
236 la.alpha_volume(eg,lfsu,x,lfsv,r);
238 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename R>
241 la.alpha_volume_post_skeleton(eg,lfsu,x,lfsv,r);
243 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
245 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
246 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
249 la.alpha_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,r_s,r_n);
251 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename R>
253 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
256 la.alpha_boundary(ig,lfsu_s,x_s,lfsv_s,r_s);
259 template<
typename EG,
typename LFSV,
typename R>
260 static void lambda_volume (
const LA& la,
const EG& eg,
const LFSV& lfsv, R& r)
262 la.lambda_volume(eg,lfsv,r);
264 template<
typename EG,
typename LFSV,
typename R>
267 la.lambda_volume_post_skeleton(eg,lfsv,r);
269 template<
typename IG,
typename LFSV,
typename R>
271 const LFSV& lfsv_s,
const LFSV& lfsv_n,
274 la.lambda_skeleton(ig, lfsv_s, lfsv_n, r_s, r_n);
276 template<
typename IG,
typename LFSV,
typename R>
279 la.lambda_boundary(ig,lfsv,r);
283 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
284 static void jacobian_apply_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, Y& y)
287 models<impl::HasJacobianApplyVolume<EG,LFSU,X,LFSV,Y&>,LA>(),
288 "Your local operator does not implement jacobian_apply_volume() for linear problems (without explicit Jacobian evaluation point)" 290 la.jacobian_apply_volume(eg,lfsu,x,lfsv,y);
293 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
297 models<impl::HasJacobianApplyVolumePostSkeleton<EG,LFSU,X,LFSV,Y&>,LA>(),
298 "Your local operator does not implement jacobian_apply_volume_post_skeleton() for linear problems (without explicit Jacobian evaluation point)" 300 la.jacobian_apply_volume_post_skeleton(eg,lfsu,x,lfsv,y);
303 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
305 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
306 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
310 models<impl::HasJacobianApplySkeleton<IG,LFSU,X,LFSV,LFSU,X,LFSV,Y&,Y&>,LA>(),
311 "Your local operator does not implement jacobian_apply_skeleton() for linear problems (without explicit Jacobian evaluation point)" 313 la.jacobian_apply_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,y_s,y_n);
315 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
317 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
321 models<impl::HasJacobianApplyBoundary<IG,LFSU,X,LFSV,Y&>,LA>(),
322 "Your local operator does not implement jacobian_apply_boundary() for linear problems (without explicit Jacobian evaluation point)" 324 la.jacobian_apply_boundary(ig,lfsu_s,x_s,lfsv_s,y_s);
328 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
330 ->
typename std::enable_if<models<impl::HasJacobianApplyVolume<EG,LFSU,X,X,LFSV,Y&>,LA>()>::type
332 la.jacobian_apply_volume(eg,lfsu,x,z,lfsv,y);
335 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
337 ->
typename std::enable_if<not models<impl::HasJacobianApplyVolume<EG,LFSU,X,X,LFSV,Y&>,LA>()>::type
339 static_assert(
AlwaysFalse<EG>::value,
"Your local operator does not implement jacobian_apply_volume() for nonlinear problems (Jacobian evaluation point given as argument)");
342 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
345 la.jacobian_apply_volume_post_skeleton(eg,lfsu,x,z,lfsv,y);
347 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
349 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
350 const LFSU& lfsu_n,
const X& x_n,
const X& z_n,
const LFSV& lfsv_n,
353 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);
355 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename Y>
357 const LFSU& lfsu_s,
const X& x_s,
const X& z_s,
const LFSV& lfsv_s,
360 la.jacobian_apply_boundary(ig,lfsu_s,x_s,z_s,lfsv_s,y_s);
364 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
365 static void jacobian_volume (
const LA& la,
const EG& eg,
const LFSU& lfsu,
const X& x,
const LFSV& lfsv, M & mat)
367 la.jacobian_volume(eg,lfsu,x,lfsv,mat);
369 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
typename M>
372 la.jacobian_volume_post_skeleton(eg,lfsu,x,lfsv,mat);
374 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
376 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
377 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
378 M & mat_ss, M & mat_sn,
379 M & mat_ns, M & mat_nn)
381 la.jacobian_skeleton(ig,lfsu_s,x_s,lfsv_s,lfsu_n,x_n,lfsv_n,
382 mat_ss, mat_sn, mat_ns, mat_nn);
384 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
typename M>
386 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
389 la.jacobian_boundary(ig,lfsu_s,x_s,lfsv_s,mat_ss);
396 #endif // DUNE_PDELAB_LOCALOPERATOR_CALLSWITCH_HH 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:336
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:343
const IG & ig
Definition: constraints.hh:148
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:270
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:370
static void alpha_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:91
static void alpha_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:234
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:182
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:252
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:132
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:136
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:265
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:294
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:356
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:113
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:277
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:78
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:140
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:348
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:217
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:244
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
static void pattern_volume(const LA &la, const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern)
Definition: callswitch.hh:204
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:284
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:304
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:106
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:155
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:159
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:178
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:375
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:316
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:385
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:170
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:260
Definition: callswitch.hh:64
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:127
static void pattern_boundary(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss)
Definition: callswitch.hh:85
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:99
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:163
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:95
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:121
static void pattern_boundary(const LA &la, const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss)
Definition: callswitch.hh:226
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:186
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:365
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:194
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
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:147
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:117
static void pattern_volume(const LA &la, const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern)
Definition: callswitch.hh:67
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:239
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:329