3 #ifndef DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH 4 #define DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH 8 #include <dune/common/forloop.hh> 9 #include <dune/common/fvector.hh> 10 #include <dune/common/tuples.hh> 11 #include <dune/common/tupleutility.hh> 12 #include <dune/common/typetraits.hh> 36 template<
typename K,
typename Args>
41 typedef typename ForEachType<AddPtrTypeEvaluator, Args>::Type ArgPtrs;
42 typedef typename ForEachType<AddRefTypeEvaluator, Args>::Type ArgRefs;
45 typedef FieldVector<K, size> Weights;
61 (
const Weights& weights_ = Weights(1))
67 (
const ArgRefs& lops_,
68 const Weights& weights_ = Weights(1))
69 : lops(transformTuple<AddPtrTypeEvaluator>(lops_)), weights(weights_)
73 template<std::
size_t i>
74 void setSummand(
typename tuple_element<i,Args>::type& summand)
75 { get<i>(lops) = &summand; }
78 template<std::
size_t i>
80 {
return *get<i>(lops); }
88 {
return weights[i]; }
99 template<
typename T1,
typename T2>
101 :
public integral_constant<bool, T1::value || T2:: value>
103 template<
template<
int>
class Value>
104 struct AccFlag :
public GenericForLoop<OrOperation, Value, 0, size-1>
108 struct PatternVolumeValue :
public integral_constant
109 < bool, tuple_element<i, Args>::type::doPatternVolume>
112 struct PatternVolumePostSkeletonValue :
public integral_constant
113 < bool, tuple_element<i, Args>::type::doPatternVolumePostSkeleton>
116 struct PatternSkeletonValue :
public integral_constant
117 < bool, tuple_element<i, Args>::type::doPatternSkeleton>
120 struct PatternBoundaryValue :
public integral_constant
121 < bool, tuple_element<i, Args>::type::doPatternBoundary>
125 struct AlphaVolumeValue :
public integral_constant
126 < bool, tuple_element<i, Args>::type::doAlphaVolume>
129 struct AlphaVolumePostSkeletonValue :
public integral_constant
130 < bool, tuple_element<i, Args>::type::doAlphaVolumePostSkeleton>
133 struct AlphaSkeletonValue :
public integral_constant
134 < bool, tuple_element<i, Args>::type::doAlphaSkeleton>
137 struct AlphaBoundaryValue :
public integral_constant
138 < bool, tuple_element<i, Args>::type::doAlphaBoundary>
142 struct LambdaVolumeValue :
public integral_constant
143 < bool, tuple_element<i, Args>::type::doLambdaVolume>
146 struct LambdaVolumePostSkeletonValue :
public integral_constant
147 < bool, tuple_element<i, Args>::type::doLambdaVolumePostSkeleton>
150 struct LambdaSkeletonValue :
public integral_constant
151 < bool, tuple_element<i, Args>::type::doLambdaSkeleton>
154 struct LambdaBoundaryValue :
public integral_constant
155 < bool, tuple_element<i, Args>::type::doLambdaBoundary>
159 struct OneSidedSkeletonRequiredValue :
public integral_constant
160 < bool, ( ( tuple_element<i, Args>::type::doAlphaSkeleton ||
161 tuple_element<i, Args>::type::doLambdaSkeleton) &&
162 ! tuple_element<i, Args>::type::doSkeletonTwoSided)>
165 struct TwoSidedSkeletonRequiredValue :
public integral_constant
166 < bool, ( ( tuple_element<i, Args>::type::doAlphaSkeleton ||
167 tuple_element<i, Args>::type::doLambdaSkeleton) &&
168 tuple_element<i, Args>::type::doSkeletonTwoSided)>
230 "Some summands require a one-sided skelton, others a " 231 "two-sided skeleton. This is not supported.");
245 struct PatternVolumeOperation {
246 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
247 static void apply(
const ArgPtrs& lops,
const Weights& weights,
248 const LFSU& lfsu,
const LFSV& lfsv,
249 LocalPattern& pattern)
251 if(weights[i] != K(0))
253 tuple_element<i,Args>::type::doPatternVolume>
:: 259 struct PatternVolumePostSkeletonOperation {
260 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
261 static void apply(
const ArgPtrs& lops,
const Weights& weights,
262 const LFSU& lfsu,
const LFSV& lfsv,
263 LocalPattern& pattern)
265 if(weights[i] != K(0))
267 tuple_element<i,Args>::type::doPatternVolumePostSkeleton>
:: 273 struct PatternSkeletonOperation {
274 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
275 static void apply(
const ArgPtrs& lops,
const Weights& weights,
276 const LFSU& lfsu_s,
const LFSV& lfsv_s,
277 const LFSU& lfsu_n,
const LFSV& lfsv_n,
278 LocalPattern& pattern_sn,
279 LocalPattern& pattern_ns)
281 if(weights[i] != K(0))
283 tuple_element<i,Args>::type::doPatternSkeleton>
:: 285 lfsu_s, lfsv_s, lfsu_n, lfsv_n,
286 pattern_sn, pattern_ns);
291 struct PatternBoundaryOperation {
292 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
293 static void apply(
const ArgPtrs& lops,
const Weights& weights,
294 const LFSU& lfsu_s,
const LFSV& lfsv_s,
295 LocalPattern& pattern_ss)
297 if(weights[i] != K(0))
299 tuple_element<i,Args>::type::doPatternBoundary>
:: 311 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
313 (
const LFSU& lfsu,
const LFSV& lfsv,
314 LocalPattern& pattern)
const 316 ForLoop<PatternVolumeOperation, 0, size-1>::
317 apply(lops, weights, lfsu, lfsv, pattern);
327 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
329 (
const LFSU& lfsu,
const LFSV& lfsv,
330 LocalPattern& pattern)
const 332 ForLoop<PatternVolumePostSkeletonOperation, 0, size-1>::
333 apply(lops, weights, lfsu, lfsv, pattern);
342 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
344 (
const LFSU& lfsu_s,
const LFSV& lfsv_s,
345 const LFSU& lfsu_n,
const LFSV& lfsv_n,
346 LocalPattern& pattern_sn,
347 LocalPattern& pattern_ns)
const 349 ForLoop<PatternSkeletonOperation, 0, size-1>::
350 apply(lops, weights, lfsu_s, lfsv_s, lfsu_n, lfsv_n,
351 pattern_sn, pattern_ns);
360 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
362 (
const LFSU& lfsu_s,
const LFSV& lfsv_s,
363 LocalPattern& pattern_ss)
const 365 ForLoop<PatternBoundaryOperation, 0, size-1>::
366 apply(lops, weights, lfsu_s, lfsv_s, pattern_ss);
381 struct AlphaVolumeOperation {
382 typedef typename tuple_element<i,Args>::type Arg;
383 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
385 static void apply(
const ArgPtrs& lops,
const Weights& weights,
387 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
392 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
394 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
396 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
408 struct AlphaVolumePostSkeletonOperation {
409 typedef typename tuple_element<i,Args>::type Arg;
410 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
412 static void apply(
const ArgPtrs& lops,
const Weights& weights,
414 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
419 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
421 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
423 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
437 struct AlphaSkeletonOperation {
438 typedef typename tuple_element<i,Args>::type Arg;
439 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
441 static void apply(
const ArgPtrs& lops,
const Weights& weights,
443 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
444 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
448 apply(lops, weights[i]*r_s.
weight(), weights[i]*r_n.
weight(),
454 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
456 static void apply(
const ArgPtrs& lops,
457 typename C::weight_type weight_s,
458 typename C::weight_type weight_n,
460 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
461 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
464 if(weight_s != K(0) || weight_n != K(0)) {
477 struct AlphaBoundaryOperation {
478 typedef typename tuple_element<i,Args>::type Arg;
479 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
481 static void apply(
const ArgPtrs& lops,
const Weights& weights,
483 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
486 apply(lops, weights[i]*r_s.
weight(),
ig,
490 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
492 static void apply(
const ArgPtrs& lops,
493 typename C::weight_type weight_s,
495 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
498 if(weight_s != K(0)) {
512 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
516 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
519 ForLoop<AlphaVolumeOperation, 0, size-1>::
520 apply(lops, weights, eg, lfsu, x, lfsv, r);
529 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
533 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
536 ForLoop<AlphaVolumePostSkeletonOperation, 0, size-1>::
537 apply(lops, weights, eg, lfsu, x, lfsv, r);
545 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
549 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
550 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
551 C& r_s, C& r_n)
const 553 ForLoop<AlphaSkeletonOperation, 0, size-1>::
554 apply(lops, weights, ig,
565 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
569 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
572 ForLoop<AlphaBoundaryOperation, 0, size-1>::
573 apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, r_s);
588 struct LambdaVolumeOperation {
589 typedef typename tuple_element<i,Args>::type Arg;
590 template<
typename EG,
typename LFSV,
typename C>
591 static void apply(
const ArgPtrs& lops,
const Weights& weights,
598 template<
typename EG,
typename LFSV,
typename C>
599 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
613 struct LambdaVolumePostSkeletonOperation {
614 typedef typename tuple_element<i,Args>::type Arg;
615 template<
typename EG,
typename LFSV,
typename C>
616 static void apply(
const ArgPtrs& lops,
const Weights& weights,
623 template<
typename EG,
typename LFSV,
typename C>
624 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
638 struct LambdaSkeletonOperation {
639 typedef typename tuple_element<i,Args>::type Arg;
640 template<
typename IG,
typename LFSV,
typename C>
641 static void apply(
const ArgPtrs& lops,
const Weights& weights,
643 const LFSV& lfsv_s,
const LFSV& lfsv_n,
647 apply(lops, weights[i]*r_s.
weight(), weights[i]*r_n.
weight(),
652 template<
typename IG,
typename LFSV,
typename C>
653 static void apply(
const ArgPtrs& lops,
654 typename C::weight_type weight_s,
655 typename C::weight_type weight_n,
657 const LFSV& lfsv_s,
const LFSV& lfsv_n,
660 if(weight_s != K(0) || weight_n != K(0)) {
672 struct LambdaBoundaryOperation {
673 typedef typename tuple_element<i,Args>::type Arg;
674 template<
typename IG,
typename LFSV,
typename C>
675 static void apply(
const ArgPtrs& lops,
const Weights& weights,
682 template<
typename IG,
typename LFSV,
typename C>
683 static void apply(
const ArgPtrs& lops,
684 typename C::weight_type weight_s,
689 if(weight_s != K(0)) {
703 template<
typename EG,
typename LFSV,
typename C>
706 ForLoop<LambdaVolumeOperation, 0, size-1>::
707 apply(lops, weights, eg, lfsv, r);
716 template<
typename EG,
typename LFSV,
typename C>
721 ForLoop<LambdaVolumePostSkeletonOperation, 0, size-1>::
722 apply(lops, weights, eg, lfsv, r);
730 template<
typename IG,
typename LFSV,
typename C>
732 const LFSV& lfsv_s,
const LFSV& lfsv_n,
733 C& r_s, C& r_n)
const 735 ForLoop<LambdaSkeletonOperation, 0, size-1>::
736 apply(lops, weights, ig, lfsv_s, lfsv_n, r_s, r_n);
744 template<
typename IG,
typename LFSV,
typename C>
747 ForLoop<LambdaBoundaryOperation, 0, size-1>::
748 apply(lops, weights, ig, lfsv_s, r_s);
763 struct JacobianApplyVolumeOperation {
764 typedef typename tuple_element<i,Args>::type Arg;
765 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
767 static void apply(
const ArgPtrs& lops,
const Weights& weights,
769 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
774 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
776 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
778 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
790 struct JacobianApplyVolumePostSkeletonOperation {
791 typedef typename tuple_element<i,Args>::type Arg;
792 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
794 static void apply(
const ArgPtrs& lops,
const Weights& weights,
796 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
801 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
803 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
805 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
819 struct JacobianApplySkeletonOperation {
820 typedef typename tuple_element<i,Args>::type Arg;
821 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
823 static void apply(
const ArgPtrs& lops,
const Weights& weights,
825 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
826 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
830 apply(lops, weights[i]*r_s.
weight(), weights[i]*r_n.
weight(),
836 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
838 static void apply(
const ArgPtrs& lops,
839 typename C::weight_type weight_s,
840 typename C::weight_type weight_n,
842 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
843 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
846 if(weight_s != K(0) || weight_n != K(0)) {
859 struct JacobianApplyBoundaryOperation {
860 typedef typename tuple_element<i,Args>::type Arg;
861 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
863 static void apply(
const ArgPtrs& lops,
const Weights& weights,
865 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
868 apply(lops, weights[i]*r_s.
weight(),
ig,
872 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
874 static void apply(
const ArgPtrs& lops,
875 typename C::weight_type weight_s,
877 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
880 if(weight_s != K(0)) {
896 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
900 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
903 ForLoop<JacobianApplyVolumeOperation, 0, size-1>::
904 apply(lops, weights, eg, lfsu, x, lfsv, r);
913 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
917 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
920 ForLoop<JacobianApplyVolumePostSkeletonOperation, 0, size-1>::
921 apply(lops, weights, eg, lfsu, x, lfsv, r);
929 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
933 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
934 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
935 C& r_s, C& r_n)
const 937 ForLoop<JacobianApplySkeletonOperation, 0, size-1>::
938 apply(lops, weights, ig,
949 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
953 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
956 ForLoop<JacobianApplyBoundaryOperation, 0, size-1>::
957 apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, r_s);
972 struct JacobianVolumeOperation {
973 typedef typename tuple_element<i,Args>::type Arg;
974 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
976 static void apply(
const ArgPtrs& lops,
const Weights& weights,
978 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
983 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
985 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
987 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
999 struct JacobianVolumePostSkeletonOperation {
1000 typedef typename tuple_element<i,Args>::type Arg;
1001 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
1003 static void apply(
const ArgPtrs& lops,
const Weights& weights,
1005 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
1010 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
1012 static void apply(
const ArgPtrs& lops,
typename C::weight_type weight,
1014 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
1017 if(weight != K(0)) {
1028 struct JacobianSkeletonOperation {
1029 typedef typename tuple_element<i,Args>::type Arg;
1030 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1032 static void apply(
const ArgPtrs& lops,
const Weights& weights,
1034 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1035 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
1045 lfsu_s, x_s, lfsv_s,
1046 lfsu_n, x_n, lfsv_n,
1050 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1052 static void apply(
const ArgPtrs& lops,
1053 typename C::weight_type weight_ss,
1054 typename C::weight_type weight_sn,
1055 typename C::weight_type weight_ns,
1056 typename C::weight_type weight_nn,
1058 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1059 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
1060 C& m_ss, C& m_sn, C& m_ns, C& m_nn)
1062 if(weight_ss != K(0) || weight_sn != K(0) ||
1063 weight_ns != K(0) || weight_nn != K(0))
1071 lfsu_s, x_s, lfsv_s,
1072 lfsu_n, x_n, lfsv_n,
1073 view_ss, view_sn, view_ns, view_nn);
1079 struct JacobianBoundaryOperation {
1080 typedef typename tuple_element<i,Args>::type Arg;
1081 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1083 static void apply(
const ArgPtrs& lops,
const Weights& weights,
1085 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1088 apply(lops, weights[i]*m_ss.
weight(),
ig,
1089 lfsu_s, x_s, lfsv_s,
1092 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1094 static void apply(
const ArgPtrs& lops,
1095 typename C::weight_type weight_ss,
1097 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1100 if(weight_ss != K(0))
1105 lfsu_s, x_s, lfsv_s, view_ss);
1116 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
1120 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
1123 ForLoop<JacobianVolumeOperation, 0, size-1>::
1124 apply(lops, weights, eg, lfsu, x, lfsv, m);
1132 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
1136 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
1139 ForLoop<JacobianVolumePostSkeletonOperation, 0, size-1>::
1140 apply(lops, weights, eg, lfsu, x, lfsv, m);
1148 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1152 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1153 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
1154 C& m_ss, C& m_sn, C& m_ns, C& m_nn)
const 1156 ForLoop<JacobianSkeletonOperation, 0, size-1>::
1157 apply(lops, weights, ig,
1158 lfsu_s, x_s, lfsv_s,
1159 lfsu_n, x_n, lfsv_n,
1160 m_ss, m_sn, m_ns, m_nn);
1168 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
1172 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
1175 ForLoop<JacobianBoundaryOperation, 0, size-1>::
1176 apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, m_ss);
1188 typedef typename tuple_element<0, Args>::type::RealType
RealType;
1194 template<
int i>
struct SetTimeOperation {
1195 static void apply(ArgPtrs& lops, RealType t)
1199 template<
int i>
struct PreStepOperation {
1200 static void apply(ArgPtrs& lops,
1201 RealType time, RealType dt,
int stages)
1202 { get<i>(lops)->
preStep(time, dt, stages); }
1205 template<
int i>
struct PostStepOperation {
1206 static void apply(ArgPtrs& lops)
1210 template<
int i>
struct PreStageOperation {
1211 static void apply(ArgPtrs& lops, RealType time,
int r)
1212 { get<i>(lops)->
preStage(time, r); }
1215 template<
int i>
struct PostStageOperation {
1216 static void apply(ArgPtrs& lops)
1220 template<
int i>
struct SuggestTimestepOperation {
1221 static void apply(ArgPtrs& lops, RealType& dt)
1229 ForLoop<SetTimeOperation, 0, size-1>::apply(lops, t);
1235 return get<0>(lops)->
getTime();
1239 void preStep (RealType time, RealType dt,
int stages)
1241 ForLoop<PreStepOperation, 0, size-1>::apply(lops, time, dt, stages);
1247 ForLoop<PostStepOperation, 0, size-1>::apply(lops);
1253 ForLoop<PreStageOperation, 0, size-1>::apply(lops, time, r);
1265 ForLoop<PostStageOperation, 0, size-1>::apply(lops);
1276 ForLoop<SuggestTimestepOperation, 0, size-1>::apply(lops, dt);
1287 #endif // DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH Definition: weightedsum.hh:204
void jacobian_apply_skeleton(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, C &r_s, C &r_n) const
apply an internal intersections's jacobians
Definition: weightedsum.hh:932
Definition: weightedsum.hh:179
void jacobian_apply_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &r) const
apply an element's jacobian
Definition: weightedsum.hh:899
void jacobian_skeleton(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, C &m_ss, C &m_sn, C &m_ns, C &m_nn) const
apply an internal intersections's jacobians
Definition: weightedsum.hh:1151
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
void lambda_skeleton(const IG &ig, const LFSV &lfsv_s, const LFSV &lfsv_n, C &r_s, C &r_n) const
get an internal intersections's contribution to lambda
Definition: weightedsum.hh:731
Definition: weightedsum.hh:219
void alpha_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &r) const
get an element's contribution to alpha
Definition: weightedsum.hh:515
static const unsigned int value
Definition: gridfunctionspace/tags.hh:177
void setSummand(typename tuple_element< i, Args >::type &summand)
set the i'th component of the sum
Definition: weightedsum.hh:74
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
RealType suggestTimestep(RealType dt) const
to be called after stage 1
Definition: weightedsum.hh:1274
void pattern_boundary(const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss) const
get a boundary intersection's contribution to the sparsity pattern
Definition: weightedsum.hh:362
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
K getWeight(std::size_t i)
get the weight for the i'th component of the sum
Definition: weightedsum.hh:87
void preStep(RealType time, RealType dt, int stages)
to be called once before each time step
Definition: weightedsum.hh:1239
void alpha_skeleton(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, C &r_s, C &r_n) const
get an internal intersections's contribution to alpha
Definition: weightedsum.hh:548
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:126
Definition: adaptivity.hh:27
A local operator to take the weighted sum of other local operators.
Definition: weightedsum.hh:37
Definition: weightedsum.hh:189
Definition: weightedsum.hh:212
WeightedSumLocalOperator(const Weights &weights_=Weights(1))
construct a WeightedSumLocalOperator
Definition: weightedsum.hh:61
void jacobian_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &m) const
get an element's jacobian
Definition: weightedsum.hh:1119
void postStage()
to be called once at the end of each stage
Definition: weightedsum.hh:1263
Definition: weightedsum.hh:200
void setWeight(K w, std::size_t i)
set the weight for the i'th component of the sum
Definition: weightedsum.hh:83
weight_type weight()
Returns the weight associated with this view.
Definition: localmatrix.hh:60
tuple_element< 0, Args >::type::RealType RealType
Export type used for time values.
Definition: weightedsum.hh:1188
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
Definition: weightedsum.hh:174
Definition: weightedsum.hh:208
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:116
Definition: weightedsum.hh:222
void jacobian_apply_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &r) const
apply an element's jacobian after the intersections have been handled
Definition: weightedsum.hh:916
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
void postStep()
to be called once at the end of each time step
Definition: weightedsum.hh:1245
Container & container()
Returns the container (of type LocalMatrix) that this view is based on.
Definition: localmatrix.hh:129
An accumulate-only view on a local matrix that automatically takes into account an accumulation weigh...
Definition: localmatrix.hh:21
Definition: weightedsum.hh:194
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
void jacobian_apply_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, C &r_s) const
apply a boundary intersections's jacobian
Definition: weightedsum.hh:952
void alpha_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, C &r_s) const
get a boundary intersections's contribution to alpha
Definition: weightedsum.hh:568
weight_type weight()
Returns the weight associated with this view.
Definition: localvector.hh:61
VTKWriter & w
Definition: function.hh:1101
int getStage() const
get current stage
Definition: weightedsum.hh:1257
Definition: weightedsum.hh:226
void pattern_volume_post_skeleton(const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern) const
get an element's contribution to the sparsity pattern after the intersections have been handled ...
Definition: weightedsum.hh:329
Definition: weightedsum.hh:184
void pattern_skeleton(const LFSU &lfsu_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const LFSV &lfsv_n, LocalPattern &pattern_sn, LocalPattern &pattern_ns) const
get an internal intersection's contribution to the sparsity pattern
Definition: weightedsum.hh:344
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
void setTime(RealType t)
set time for subsequent evaluation
Definition: weightedsum.hh:1227
Container & container()
Returns the container (of type LocalVector) that this view is based on.
Definition: localvector.hh:127
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:112
Definition: weightedsum.hh:216
void lambda_volume_post_skeleton(const EG &eg, const LFSV &lfsv, C &r) const
get an element's contribution to lambda after the intersections have been handled ...
Definition: weightedsum.hh:717
RealType getTime() const
get current time
Definition: weightedsum.hh:1233
void pattern_volume(const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern) const
get an element's contribution to the sparsity pattern
Definition: weightedsum.hh:313
void alpha_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &r) const
get an element's contribution to alpha after the intersections have been handled
Definition: weightedsum.hh:532
void preStage(RealType time, int r)
to be called once before each stage
Definition: weightedsum.hh:1251
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
void jacobian_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, C &m_ss) const
get a boundary intersections's jacobian
Definition: weightedsum.hh:1171
void lambda_boundary(const IG &ig, const LFSV &lfsv_s, C &r_s) const
get a boundary intersections's contribution to lambda
Definition: weightedsum.hh:745
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
tuple_element< i, Args >::type & getSummand()
get the i'th component of the sum
Definition: weightedsum.hh:79
void jacobian_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, C &m) const
get an element's jacobian after the intersections have been handled
Definition: weightedsum.hh:1135
An accumulate-only view on a local vector that automatically takes into account an accumulation weigh...
Definition: localvector.hh:26
Definition: callswitch.hh:63
void lambda_volume(const EG &eg, const LFSV &lfsv, C &r) const
get an element's contribution to lambda
Definition: weightedsum.hh:704