dune-pdelab  2.0.0
weightedsum.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=8 sw=2 sts=2:
3 #ifndef DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH
4 #define DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH
5 
6 #include <cstddef>
7 
8 #include <dune/common/forloop.hh>
9 #include <dune/common/fvector.hh>
10 #include <dune/common/static_assert.hh>
11 #include <dune/common/tuples.hh>
12 #include <dune/common/tupleutility.hh>
13 #include <dune/common/typetraits.hh>
14 
17 
19 
20 namespace Dune {
21  namespace PDELab {
25 
27 
37  template<typename K, typename Args>
39  {
40  static const std::size_t size = tuple_size<Args>::value;
41 
42  typedef typename ForEachType<AddPtrTypeEvaluator, Args>::Type ArgPtrs;
43  typedef typename ForEachType<AddRefTypeEvaluator, Args>::Type ArgRefs;
44 
45  ArgPtrs lops;
46  typedef FieldVector<K, size> Weights;
47  Weights weights;
48 
49  public:
51  //
54  //
55 
57 
62  ( const Weights& weights_ = Weights(1))
63  : weights(weights_)
64  { }
65 
68  ( const ArgRefs& lops_,
69  const Weights& weights_ = Weights(1))
70  : lops(transformTuple<AddPtrTypeEvaluator>(lops_)), weights(weights_)
71  { }
72 
74  template<std::size_t i>
75  void setSummand(typename tuple_element<i,Args>::type& summand)
76  { get<i>(lops) = &summand; }
77 
79  template<std::size_t i>
80  typename tuple_element<i,Args>::type& getSummand()
81  { return *get<i>(lops); }
82 
84  void setWeight(K w, std::size_t i)
85  { weights[i] = w; }
86 
88  K getWeight(std::size_t i)
89  { return weights[i]; }
90 
92 
94  //
97  //
98 
99  private:
100  template<typename T1, typename T2>
101  struct OrOperation
102  : public integral_constant<bool, T1::value || T2:: value>
103  { };
104  template<template<int> class Value>
105  struct AccFlag : public GenericForLoop<OrOperation, Value, 0, size-1>
106  { };
107 
108  template<int i>
109  struct PatternVolumeValue : public integral_constant
110  < bool, tuple_element<i, Args>::type::doPatternVolume>
111  { };
112  template<int i>
113  struct PatternVolumePostSkeletonValue : public integral_constant
114  < bool, tuple_element<i, Args>::type::doPatternVolumePostSkeleton>
115  { };
116  template<int i>
117  struct PatternSkeletonValue : public integral_constant
118  < bool, tuple_element<i, Args>::type::doPatternSkeleton>
119  { };
120  template<int i>
121  struct PatternBoundaryValue : public integral_constant
122  < bool, tuple_element<i, Args>::type::doPatternBoundary>
123  { };
124 
125  template<int i>
126  struct AlphaVolumeValue : public integral_constant
127  < bool, tuple_element<i, Args>::type::doAlphaVolume>
128  { };
129  template<int i>
130  struct AlphaVolumePostSkeletonValue : public integral_constant
131  < bool, tuple_element<i, Args>::type::doAlphaVolumePostSkeleton>
132  { };
133  template<int i>
134  struct AlphaSkeletonValue : public integral_constant
135  < bool, tuple_element<i, Args>::type::doAlphaSkeleton>
136  { };
137  template<int i>
138  struct AlphaBoundaryValue : public integral_constant
139  < bool, tuple_element<i, Args>::type::doAlphaBoundary>
140  { };
141 
142  template<int i>
143  struct LambdaVolumeValue : public integral_constant
144  < bool, tuple_element<i, Args>::type::doLambdaVolume>
145  { };
146  template<int i>
147  struct LambdaVolumePostSkeletonValue : public integral_constant
148  < bool, tuple_element<i, Args>::type::doLambdaVolumePostSkeleton>
149  { };
150  template<int i>
151  struct LambdaSkeletonValue : public integral_constant
152  < bool, tuple_element<i, Args>::type::doLambdaSkeleton>
153  { };
154  template<int i>
155  struct LambdaBoundaryValue : public integral_constant
156  < bool, tuple_element<i, Args>::type::doLambdaBoundary>
157  { };
158 
159  template<int i>
160  struct OneSidedSkeletonRequiredValue : public integral_constant
161  < bool, ( ( tuple_element<i, Args>::type::doAlphaSkeleton ||
162  tuple_element<i, Args>::type::doLambdaSkeleton) &&
163  ! tuple_element<i, Args>::type::doSkeletonTwoSided)>
164  { };
165  template<int i>
166  struct TwoSidedSkeletonRequiredValue : public integral_constant
167  < bool, ( ( tuple_element<i, Args>::type::doAlphaSkeleton ||
168  tuple_element<i, Args>::type::doLambdaSkeleton) &&
169  tuple_element<i, Args>::type::doSkeletonTwoSided)>
170  { };
171 
172  public:
192 
195  enum { doAlphaVolume =
211 
213  enum { doLambdaVolume =
225 
231  "Some summands require a one-sided skelton, others a "
232  "two-sided skeleton. This is not supported.");
233 
235 
237  //
240  //
241 
242  private:
243  // template meta program helpers for the pattern_* methods
244 
245  template<int i>
246  struct PatternVolumeOperation {
247  template<typename LFSU, typename LFSV, typename LocalPattern>
248  static void apply(const ArgPtrs& lops, const Weights& weights,
249  const LFSU& lfsu, const LFSV& lfsv,
250  LocalPattern& pattern)
251  {
252  if(weights[i] != K(0))
254  tuple_element<i,Args>::type::doPatternVolume>::
255  pattern_volume(*get<i>(lops), lfsu, lfsv, pattern);
256  }
257  };
258 
259  template<int i>
260  struct PatternVolumePostSkeletonOperation {
261  template<typename LFSU, typename LFSV, typename LocalPattern>
262  static void apply(const ArgPtrs& lops, const Weights& weights,
263  const LFSU& lfsu, const LFSV& lfsv,
264  LocalPattern& pattern)
265  {
266  if(weights[i] != K(0))
267  LocalAssemblerCallSwitch<typename tuple_element<i,Args>::type,
268  tuple_element<i,Args>::type::doPatternVolumePostSkeleton>::
269  pattern_volume_post_skeleton(*get<i>(lops), lfsu, lfsv, pattern);
270  }
271  };
272 
273  template<int i>
274  struct PatternSkeletonOperation {
275  template<typename LFSU, typename LFSV, typename LocalPattern>
276  static void apply(const ArgPtrs& lops, const Weights& weights,
277  const LFSU& lfsu_s, const LFSV& lfsv_s,
278  const LFSU& lfsu_n, const LFSV& lfsv_n,
279  LocalPattern& pattern_sn,
280  LocalPattern& pattern_ns)
281  {
282  if(weights[i] != K(0))
283  LocalAssemblerCallSwitch<typename tuple_element<i,Args>::type,
284  tuple_element<i,Args>::type::doPatternSkeleton>::
285  pattern_skeleton(*get<i>(lops),
286  lfsu_s, lfsv_s, lfsu_n, lfsv_n,
287  pattern_sn, pattern_ns);
288  }
289  };
290 
291  template<int i>
292  struct PatternBoundaryOperation {
293  template<typename LFSU, typename LFSV, typename LocalPattern>
294  static void apply(const ArgPtrs& lops, const Weights& weights,
295  const LFSU& lfsu_s, const LFSV& lfsv_s,
296  LocalPattern& pattern_ss)
297  {
298  if(weights[i] != K(0))
299  LocalAssemblerCallSwitch<typename tuple_element<i,Args>::type,
300  tuple_element<i,Args>::type::doPatternBoundary>::
301  pattern_boundary(*get<i>(lops), lfsu_s, lfsv_s, pattern_ss);
302  }
303  };
304 
305  public:
307 
312  template<typename LFSU, typename LFSV, typename LocalPattern>
313  void pattern_volume
314  ( const LFSU& lfsu, const LFSV& lfsv,
315  LocalPattern& pattern) const
316  {
317  ForLoop<PatternVolumeOperation, 0, size-1>::
318  apply(lops, weights, lfsu, lfsv, pattern);
319  }
320 
323 
328  template<typename LFSU, typename LFSV, typename LocalPattern>
330  ( const LFSU& lfsu, const LFSV& lfsv,
331  LocalPattern& pattern) const
332  {
333  ForLoop<PatternVolumePostSkeletonOperation, 0, size-1>::
334  apply(lops, weights, lfsu, lfsv, pattern);
335  }
336 
338 
343  template<typename LFSU, typename LFSV, typename LocalPattern>
344  void pattern_skeleton
345  ( const LFSU& lfsu_s, const LFSV& lfsv_s,
346  const LFSU& lfsu_n, const LFSV& lfsv_n,
347  LocalPattern& pattern_sn,
348  LocalPattern& pattern_ns) const
349  {
350  ForLoop<PatternSkeletonOperation, 0, size-1>::
351  apply(lops, weights, lfsu_s, lfsv_s, lfsu_n, lfsv_n,
352  pattern_sn, pattern_ns);
353  }
354 
356 
361  template<typename LFSU, typename LFSV, typename LocalPattern>
362  void pattern_boundary
363  ( const LFSU& lfsu_s, const LFSV& lfsv_s,
364  LocalPattern& pattern_ss) const
365  {
366  ForLoop<PatternBoundaryOperation, 0, size-1>::
367  apply(lops, weights, lfsu_s, lfsv_s, pattern_ss);
368  }
369 
371 
373  //
376  //
377 
378  private:
379  // template meta program helpers for the alpha_* methods
380 
381  template<int i>
382  struct AlphaVolumeOperation {
383  typedef typename tuple_element<i,Args>::type Arg;
384  template<typename EG, typename LFSU, typename X, typename LFSV,
385  typename C>
386  static void apply(const ArgPtrs& lops, const Weights& weights,
387  const EG& eg,
388  const LFSU& lfsu, const X& x, const LFSV& lfsv,
390  {
391  apply(lops, weights[i]*r.weight(), eg, lfsu, x, lfsv, r.container());
392  }
393  template<typename EG, typename LFSU, typename X, typename LFSV,
394  typename C>
395  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
396  const EG& eg,
397  const LFSU& lfsu, const X& x, const LFSV& lfsv,
398  C& r)
399  {
400  if(weight != K(0)) {
401  WeightedVectorAccumulationView<C> view(r, weight);
403  alpha_volume(*get<i>(lops), eg, lfsu, x, lfsv, view);
404  }
405  }
406  };
407 
408  template<int i>
409  struct AlphaVolumePostSkeletonOperation {
410  typedef typename tuple_element<i,Args>::type Arg;
411  template<typename EG, typename LFSU, typename X, typename LFSV,
412  typename C>
413  static void apply(const ArgPtrs& lops, const Weights& weights,
414  const EG& eg,
415  const LFSU& lfsu, const X& x, const LFSV& lfsv,
416  WeightedVectorAccumulationView<C>& r)
417  {
418  apply(lops, weights[i]*r.weight(), eg, lfsu, x, lfsv, r.container());
419  }
420  template<typename EG, typename LFSU, typename X, typename LFSV,
421  typename C>
422  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
423  const EG& eg,
424  const LFSU& lfsu, const X& x, const LFSV& lfsv,
425  C& r)
426  {
427  if(weight != K(0)) {
428  WeightedVectorAccumulationView<C> view(r, weight);
430  alpha_volume_post_skeleton(*get<i>(lops), eg,
431  lfsu, x, lfsv,
432  view);
433  }
434  }
435  };
436 
437  template<int i>
438  struct AlphaSkeletonOperation {
439  typedef typename tuple_element<i,Args>::type Arg;
440  template<typename IG, typename LFSU, typename X, typename LFSV,
441  typename C>
442  static void apply(const ArgPtrs& lops, const Weights& weights,
443  const IG& ig,
444  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
445  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
446  WeightedVectorAccumulationView<C>& r_s,
447  WeightedVectorAccumulationView<C>& r_n)
448  {
449  apply(lops, weights[i]*r_s.weight(), weights[i]*r_n.weight(),
450  ig,
451  lfsu_s, x_s, lfsv_s,
452  lfsu_n, x_n, lfsv_n,
453  r_s.container(), r_n.container());
454  }
455  template<typename IG, typename LFSU, typename X, typename LFSV,
456  typename C>
457  static void apply(const ArgPtrs& lops,
458  typename C::weight_type weight_s,
459  typename C::weight_type weight_n,
460  const IG& ig,
461  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
462  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
463  C& r_s, C& r_n)
464  {
465  if(weight_s != K(0) || weight_n != K(0)) {
466  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
467  WeightedVectorAccumulationView<C> view_n(r_n, weight_n);
469  alpha_skeleton(*get<i>(lops), ig,
470  lfsu_s, x_s, lfsv_s,
471  lfsu_n, x_n, lfsv_n,
472  view_s, view_n);
473  }
474  }
475  };
476 
477  template<int i>
478  struct AlphaBoundaryOperation {
479  typedef typename tuple_element<i,Args>::type Arg;
480  template<typename IG, typename LFSU, typename X, typename LFSV,
481  typename C>
482  static void apply(const ArgPtrs& lops, const Weights& weights,
483  const IG& ig,
484  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
485  WeightedVectorAccumulationView<C>& r_s)
486  {
487  apply(lops, weights[i]*r_s.weight(), ig,
488  lfsu_s, x_s, lfsv_s,
489  r_s.container());
490  }
491  template<typename IG, typename LFSU, typename X, typename LFSV,
492  typename C>
493  static void apply(const ArgPtrs& lops,
494  typename C::weight_type weight_s,
495  const IG& ig,
496  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
497  C& r_s)
498  {
499  if(weight_s != K(0)) {
500  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
502  alpha_boundary(*get<i>(lops), ig, lfsu_s, x_s, lfsv_s, view_s);
503  }
504  }
505  };
506 
507  public:
509 
513  template<typename EG, typename LFSU, typename X, typename LFSV,
514  typename C>
515  void alpha_volume
516  ( const EG& eg,
517  const LFSU& lfsu, const X& x, const LFSV& lfsv,
518  C& r) const
519  {
520  ForLoop<AlphaVolumeOperation, 0, size-1>::
521  apply(lops, weights, eg, lfsu, x, lfsv, r);
522  }
523 
526 
530  template<typename EG, typename LFSU, typename X, typename LFSV,
531  typename C>
533  ( const EG& eg,
534  const LFSU& lfsu, const X& x, const LFSV& lfsv,
535  C& r) const
536  {
537  ForLoop<AlphaVolumePostSkeletonOperation, 0, size-1>::
538  apply(lops, weights, eg, lfsu, x, lfsv, r);
539  }
540 
542 
546  template<typename IG, typename LFSU, typename X, typename LFSV,
547  typename C>
548  void alpha_skeleton
549  ( const IG& ig,
550  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
551  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
552  C& r_s, C& r_n) const
553  {
554  ForLoop<AlphaSkeletonOperation, 0, size-1>::
555  apply(lops, weights, ig,
556  lfsu_s, x_s, lfsv_s,
557  lfsu_n, x_n, lfsv_n,
558  r_s, r_n);
559  }
560 
562 
566  template<typename IG, typename LFSU, typename X, typename LFSV,
567  typename C>
568  void alpha_boundary
569  ( const IG& ig,
570  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
571  C& r_s) const
572  {
573  ForLoop<AlphaBoundaryOperation, 0, size-1>::
574  apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, r_s);
575  }
576 
578 
580  //
583  //
584 
585  private:
586  // template meta program helpers for the lambda_* methods
587 
588  template<int i>
589  struct LambdaVolumeOperation {
590  typedef typename tuple_element<i,Args>::type Arg;
591  template<typename EG, typename LFSV, typename C>
592  static void apply(const ArgPtrs& lops, const Weights& weights,
593  const EG& eg,
594  const LFSV& lfsv,
596  {
597  apply(lops, weights[i]*r.weight(), eg, lfsv, r.container());
598  }
599  template<typename EG, typename LFSV, typename C>
600  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
601  const EG& eg,
602  const LFSV& lfsv,
603  C& r)
604  {
605  if(weight != K(0)) {
606  WeightedVectorAccumulationView<C> view(r, weight);
608  lambda_volume(*get<i>(lops), eg, lfsv, view);
609  }
610  }
611  };
612 
613  template<int i>
614  struct LambdaVolumePostSkeletonOperation {
615  typedef typename tuple_element<i,Args>::type Arg;
616  template<typename EG, typename LFSV, typename C>
617  static void apply(const ArgPtrs& lops, const Weights& weights,
618  const EG& eg,
619  const LFSV& lfsv,
620  WeightedVectorAccumulationView<C>& r)
621  {
622  apply(lops, weights[i]*r.weight(), eg, lfsv, r.container());
623  }
624  template<typename EG, typename LFSV, typename C>
625  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
626  const EG& eg,
627  const LFSV& lfsv,
628  C& r)
629  {
630  if(weight != K(0)) {
631  WeightedVectorAccumulationView<C> view(r, weight);
633  lambda_volume_post_skeleton(*get<i>(lops), eg, lfsv, view);
634  }
635  }
636  };
637 
638  template<int i>
639  struct LambdaSkeletonOperation {
640  typedef typename tuple_element<i,Args>::type Arg;
641  template<typename IG, typename LFSV, typename C>
642  static void apply(const ArgPtrs& lops, const Weights& weights,
643  const IG& ig,
644  const LFSV& lfsv_s, const LFSV& lfsv_n,
645  WeightedVectorAccumulationView<C>& r_s,
646  WeightedVectorAccumulationView<C>& r_n)
647  {
648  apply(lops, weights[i]*r_s.weight(), weights[i]*r_n.weight(),
649  ig,
650  lfsv_s, lfsv_n,
651  r_s.container(), r_n.container());
652  }
653  template<typename IG, typename LFSV, typename C>
654  static void apply(const ArgPtrs& lops,
655  typename C::weight_type weight_s,
656  typename C::weight_type weight_n,
657  const IG& ig,
658  const LFSV& lfsv_s, const LFSV& lfsv_n,
659  C& r_s, C& r_n)
660  {
661  if(weight_s != K(0) || weight_n != K(0)) {
662  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
663  WeightedVectorAccumulationView<C> view_n(r_n, weight_n);
665  lambda_skeleton(*get<i>(lops), ig,
666  lfsv_s, lfsv_n,
667  view_s, view_n);
668  }
669  }
670  };
671 
672  template<int i>
673  struct LambdaBoundaryOperation {
674  typedef typename tuple_element<i,Args>::type Arg;
675  template<typename IG, typename LFSV, typename C>
676  static void apply(const ArgPtrs& lops, const Weights& weights,
677  const IG& ig,
678  const LFSV& lfsv_s,
679  WeightedVectorAccumulationView<C>& r_s)
680  {
681  apply(lops, weights[i]*r_s.weight(), ig, lfsv_s, r_s.container());
682  }
683  template<typename IG, typename LFSV, typename C>
684  static void apply(const ArgPtrs& lops,
685  typename C::weight_type weight_s,
686  const IG& ig,
687  const LFSV& lfsv_s,
688  C& r_s)
689  {
690  if(weight_s != K(0)) {
691  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
693  lambda_boundary(*get<i>(lops), ig, lfsv_s, view_s);
694  }
695  }
696  };
697 
698  public:
700 
704  template<typename EG, typename LFSV, typename C>
705  void lambda_volume(const EG& eg, const LFSV& lfsv, C& r) const
706  {
707  ForLoop<LambdaVolumeOperation, 0, size-1>::
708  apply(lops, weights, eg, lfsv, r);
709  }
710 
713 
717  template<typename EG, typename LFSV, typename C>
718  void lambda_volume_post_skeleton(const EG& eg,
719  const LFSV& lfsv,
720  C& r) const
721  {
722  ForLoop<LambdaVolumePostSkeletonOperation, 0, size-1>::
723  apply(lops, weights, eg, lfsv, r);
724  }
725 
727 
731  template<typename IG, typename LFSV, typename C>
732  void lambda_skeleton(const IG& ig,
733  const LFSV& lfsv_s, const LFSV& lfsv_n,
734  C& r_s, C& r_n) const
735  {
736  ForLoop<LambdaSkeletonOperation, 0, size-1>::
737  apply(lops, weights, ig, lfsv_s, lfsv_n, r_s, r_n);
738  }
739 
741 
745  template<typename IG, typename LFSV, typename C>
746  void lambda_boundary(const IG& ig, const LFSV& lfsv_s, C& r_s) const
747  {
748  ForLoop<LambdaBoundaryOperation, 0, size-1>::
749  apply(lops, weights, ig, lfsv_s, r_s);
750  }
751 
753 
755  //
758  //
759 
760  private:
761  // template meta program helpers for the jacobian_apply_* methods
762 
763  template<int i>
764  struct JacobianApplyVolumeOperation {
765  typedef typename tuple_element<i,Args>::type Arg;
766  template<typename EG, typename LFSU, typename X, typename LFSV,
767  typename C>
768  static void apply(const ArgPtrs& lops, const Weights& weights,
769  const EG& eg,
770  const LFSU& lfsu, const X& x, const LFSV& lfsv,
772  {
773  apply(lops, weights[i]*r.weight(), eg, lfsu, x, lfsv, r.container());
774  }
775  template<typename EG, typename LFSU, typename X, typename LFSV,
776  typename C>
777  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
778  const EG& eg,
779  const LFSU& lfsu, const X& x, const LFSV& lfsv,
780  C& r)
781  {
782  if(weight != K(0)) {
783  WeightedVectorAccumulationView<C> view(r, weight);
785  jacobian_apply_volume(*get<i>(lops), eg, lfsu, x, lfsv, view);
786  }
787  }
788  };
789 
790  template<int i>
791  struct JacobianApplyVolumePostSkeletonOperation {
792  typedef typename tuple_element<i,Args>::type Arg;
793  template<typename EG, typename LFSU, typename X, typename LFSV,
794  typename C>
795  static void apply(const ArgPtrs& lops, const Weights& weights,
796  const EG& eg,
797  const LFSU& lfsu, const X& x, const LFSV& lfsv,
798  WeightedVectorAccumulationView<C>& r)
799  {
800  apply(lops, weights[i]*r.weight(), eg, lfsu, x, lfsv, r.container());
801  }
802  template<typename EG, typename LFSU, typename X, typename LFSV,
803  typename C>
804  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
805  const EG& eg,
806  const LFSU& lfsu, const X& x, const LFSV& lfsv,
807  C& r)
808  {
809  if(weight != K(0)) {
810  WeightedVectorAccumulationView<C> view(r, weight);
812  jacobian_apply_volume_post_skeleton(*get<i>(lops), eg,
813  lfsu, x, lfsv,
814  view);
815  }
816  }
817  };
818 
819  template<int i>
820  struct JacobianApplySkeletonOperation {
821  typedef typename tuple_element<i,Args>::type Arg;
822  template<typename IG, typename LFSU, typename X, typename LFSV,
823  typename C>
824  static void apply(const ArgPtrs& lops, const Weights& weights,
825  const IG& ig,
826  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
827  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
828  WeightedVectorAccumulationView<C>& r_s,
829  WeightedVectorAccumulationView<C>& r_n)
830  {
831  apply(lops, weights[i]*r_s.weight(), weights[i]*r_n.weight(),
832  ig,
833  lfsu_s, x_s, lfsv_s,
834  lfsu_n, x_n, lfsv_n,
835  r_s.container(), r_n.container());
836  }
837  template<typename IG, typename LFSU, typename X, typename LFSV,
838  typename C>
839  static void apply(const ArgPtrs& lops,
840  typename C::weight_type weight_s,
841  typename C::weight_type weight_n,
842  const IG& ig,
843  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
844  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
845  C& r_s, C& r_n)
846  {
847  if(weight_s != K(0) || weight_n != K(0)) {
848  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
849  WeightedVectorAccumulationView<C> view_n(r_n, weight_n);
851  jacobian_apply_skeleton(*get<i>(lops), ig,
852  lfsu_s, x_s, lfsv_s,
853  lfsu_n, x_n, lfsv_n,
854  view_s, view_n);
855  }
856  }
857  };
858 
859  template<int i>
860  struct JacobianApplyBoundaryOperation {
861  typedef typename tuple_element<i,Args>::type Arg;
862  template<typename IG, typename LFSU, typename X, typename LFSV,
863  typename C>
864  static void apply(const ArgPtrs& lops, const Weights& weights,
865  const IG& ig,
866  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
867  WeightedVectorAccumulationView<C>& r_s)
868  {
869  apply(lops, weights[i]*r_s.weight(), ig,
870  lfsu_s, x_s, lfsv_s,
871  r_s.container());
872  }
873  template<typename IG, typename LFSU, typename X, typename LFSV,
874  typename C>
875  static void apply(const ArgPtrs& lops,
876  typename C::weight_type weight_s,
877  const IG& ig,
878  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
879  C& r_s)
880  {
881  if(weight_s != K(0)) {
882  WeightedVectorAccumulationView<C> view_s(r_s, weight_s);
884  jacobian_apply_boundary(*get<i>(lops), ig,
885  lfsu_s, x_s, lfsv_s,
886  view_s);
887  }
888  }
889  };
890 
891  public:
893 
897  template<typename EG, typename LFSU, typename X, typename LFSV,
898  typename C>
900  ( const EG& eg,
901  const LFSU& lfsu, const X& x, const LFSV& lfsv,
902  C& r) const
903  {
904  ForLoop<JacobianApplyVolumeOperation, 0, size-1>::
905  apply(lops, weights, eg, lfsu, x, lfsv, r);
906  }
907 
910 
914  template<typename EG, typename LFSU, typename X, typename LFSV,
915  typename C>
917  ( const EG& eg,
918  const LFSU& lfsu, const X& x, const LFSV& lfsv,
919  C& r) const
920  {
921  ForLoop<JacobianApplyVolumePostSkeletonOperation, 0, size-1>::
922  apply(lops, weights, eg, lfsu, x, lfsv, r);
923  }
924 
926 
930  template<typename IG, typename LFSU, typename X, typename LFSV,
931  typename C>
933  ( const IG& ig,
934  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
935  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
936  C& r_s, C& r_n) const
937  {
938  ForLoop<JacobianApplySkeletonOperation, 0, size-1>::
939  apply(lops, weights, ig,
940  lfsu_s, x_s, lfsv_s,
941  lfsu_n, x_n, lfsv_n,
942  r_s, r_n);
943  }
944 
946 
950  template<typename IG, typename LFSU, typename X, typename LFSV,
951  typename C>
953  ( const IG& ig,
954  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
955  C& r_s) const
956  {
957  ForLoop<JacobianApplyBoundaryOperation, 0, size-1>::
958  apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, r_s);
959  }
960 
962 
964  //
967  //
968 
969  private:
970  // template meta program helpers for the jacobian_apply_* methods
971 
972  template<int i>
973  struct JacobianVolumeOperation {
974  typedef typename tuple_element<i,Args>::type Arg;
975  template<typename EG, typename LFSU, typename X, typename LFSV,
976  typename C>
977  static void apply(const ArgPtrs& lops, const Weights& weights,
978  const EG& eg,
979  const LFSU& lfsu, const X& x, const LFSV& lfsv,
981  {
982  apply(lops, weights[i]*m.weight(), eg, lfsu, x, lfsv, m.container());
983  }
984  template<typename EG, typename LFSU, typename X, typename LFSV,
985  typename C>
986  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
987  const EG& eg,
988  const LFSU& lfsu, const X& x, const LFSV& lfsv,
989  C& m)
990  {
991  if(weight != K(0)) {
992  WeightedMatrixAccumulationView<C> view(m, weight);
994  jacobian_volume(*get<i>(lops), eg, lfsu, x, lfsv, view);
995  }
996  }
997  };
998 
999  template<int i>
1000  struct JacobianVolumePostSkeletonOperation {
1001  typedef typename tuple_element<i,Args>::type Arg;
1002  template<typename EG, typename LFSU, typename X, typename LFSV,
1003  typename C>
1004  static void apply(const ArgPtrs& lops, const Weights& weights,
1005  const EG& eg,
1006  const LFSU& lfsu, const X& x, const LFSV& lfsv,
1007  WeightedMatrixAccumulationView<C>& m)
1008  {
1009  apply(lops, weights[i]*m.weight(), eg, lfsu, x, lfsv, m.container());
1010  }
1011  template<typename EG, typename LFSU, typename X, typename LFSV,
1012  typename C>
1013  static void apply(const ArgPtrs& lops, typename C::weight_type weight,
1014  const EG& eg,
1015  const LFSU& lfsu, const X& x, const LFSV& lfsv,
1016  C& m)
1017  {
1018  if(weight != K(0)) {
1019  WeightedMatrixAccumulationView<C> view(m, weight);
1021  jacobian_volume_post_skeleton(*get<i>(lops), eg,
1022  lfsu, x, lfsv,
1023  view);
1024  }
1025  }
1026  };
1027 
1028  template<int i>
1029  struct JacobianSkeletonOperation {
1030  typedef typename tuple_element<i,Args>::type Arg;
1031  template<typename IG, typename LFSU, typename X, typename LFSV,
1032  typename C>
1033  static void apply(const ArgPtrs& lops, const Weights& weights,
1034  const IG& ig,
1035  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1036  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
1037  WeightedMatrixAccumulationView<C>& m_ss,
1038  WeightedMatrixAccumulationView<C>& m_sn,
1039  WeightedMatrixAccumulationView<C>& m_ns,
1040  WeightedMatrixAccumulationView<C>& m_nn)
1041  {
1042  apply(lops,
1043  weights[i]*m_ss.weight(), weights[i]*m_sn.weight(),
1044  weights[i]*m_ns.weight(), weights[i]*m_nn.weight(),
1045  ig,
1046  lfsu_s, x_s, lfsv_s,
1047  lfsu_n, x_n, lfsv_n,
1048  m_ss.container(), m_sn.container(),
1049  m_ns.container(), m_nn.container());
1050  }
1051  template<typename IG, typename LFSU, typename X, typename LFSV,
1052  typename C>
1053  static void apply(const ArgPtrs& lops,
1054  typename C::weight_type weight_ss,
1055  typename C::weight_type weight_sn,
1056  typename C::weight_type weight_ns,
1057  typename C::weight_type weight_nn,
1058  const IG& ig,
1059  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1060  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
1061  C& m_ss, C& m_sn, C& m_ns, C& m_nn)
1062  {
1063  if(weight_ss != K(0) || weight_sn != K(0) ||
1064  weight_ns != K(0) || weight_nn != K(0))
1065  {
1066  WeightedMatrixAccumulationView<C> view_ss(m_ss, weight_ss);
1067  WeightedMatrixAccumulationView<C> view_sn(m_sn, weight_sn);
1068  WeightedMatrixAccumulationView<C> view_ns(m_ns, weight_ns);
1069  WeightedMatrixAccumulationView<C> view_nn(m_nn, weight_nn);
1071  jacobian_skeleton(*get<i>(lops), ig,
1072  lfsu_s, x_s, lfsv_s,
1073  lfsu_n, x_n, lfsv_n,
1074  view_ss, view_sn, view_ns, view_nn);
1075  }
1076  }
1077  };
1078 
1079  template<int i>
1080  struct JacobianBoundaryOperation {
1081  typedef typename tuple_element<i,Args>::type Arg;
1082  template<typename IG, typename LFSU, typename X, typename LFSV,
1083  typename C>
1084  static void apply(const ArgPtrs& lops, const Weights& weights,
1085  const IG& ig,
1086  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1087  WeightedMatrixAccumulationView<C>& m_ss)
1088  {
1089  apply(lops, weights[i]*m_ss.weight(), ig,
1090  lfsu_s, x_s, lfsv_s,
1091  m_ss.container());
1092  }
1093  template<typename IG, typename LFSU, typename X, typename LFSV,
1094  typename C>
1095  static void apply(const ArgPtrs& lops,
1096  typename C::weight_type weight_ss,
1097  const IG& ig,
1098  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1099  C& m_ss)
1100  {
1101  if(weight_ss != K(0))
1102  {
1103  WeightedMatrixAccumulationView<C> view_ss(m_ss, weight_ss);
1105  jacobian_boundary(*get<i>(lops), ig,
1106  lfsu_s, x_s, lfsv_s, view_ss);
1107  }
1108  }
1109  };
1110 
1111  public:
1113 
1117  template<typename EG, typename LFSU, typename X, typename LFSV,
1118  typename C>
1119  void jacobian_volume
1120  ( const EG& eg,
1121  const LFSU& lfsu, const X& x, const LFSV& lfsv,
1122  C& m) const
1123  {
1124  ForLoop<JacobianVolumeOperation, 0, size-1>::
1125  apply(lops, weights, eg, lfsu, x, lfsv, m);
1126  }
1127 
1129 
1133  template<typename EG, typename LFSU, typename X, typename LFSV,
1134  typename C>
1136  ( const EG& eg,
1137  const LFSU& lfsu, const X& x, const LFSV& lfsv,
1138  C& m) const
1139  {
1140  ForLoop<JacobianVolumePostSkeletonOperation, 0, size-1>::
1141  apply(lops, weights, eg, lfsu, x, lfsv, m);
1142  }
1143 
1145 
1149  template<typename IG, typename LFSU, typename X, typename LFSV,
1150  typename C>
1151  void jacobian_skeleton
1152  ( const IG& ig,
1153  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1154  const LFSU& lfsu_n, const X& x_n, const LFSV& lfsv_n,
1155  C& m_ss, C& m_sn, C& m_ns, C& m_nn) const
1156  {
1157  ForLoop<JacobianSkeletonOperation, 0, size-1>::
1158  apply(lops, weights, ig,
1159  lfsu_s, x_s, lfsv_s,
1160  lfsu_n, x_n, lfsv_n,
1161  m_ss, m_sn, m_ns, m_nn);
1162  }
1163 
1165 
1169  template<typename IG, typename LFSU, typename X, typename LFSV,
1170  typename C>
1171  void jacobian_boundary
1172  ( const IG& ig,
1173  const LFSU& lfsu_s, const X& x_s, const LFSV& lfsv_s,
1174  C& m_ss) const
1175  {
1176  ForLoop<JacobianBoundaryOperation, 0, size-1>::
1177  apply(lops, weights, ig, lfsu_s, x_s, lfsv_s, m_ss);
1178  }
1179 
1181 
1183  //
1186  //
1187 
1189  typedef typename tuple_element<0, Args>::type::RealType RealType;
1190 
1191  private:
1192  // template meta program helpers for the methods related to instationary
1193  // stuff
1194 
1195  template<int i> struct SetTimeOperation {
1196  static void apply(ArgPtrs& lops, RealType t)
1197  { get<i>(lops)->setTime(t); }
1198  };
1199 
1200  template<int i> struct PreStepOperation {
1201  static void apply(ArgPtrs& lops,
1202  RealType time, RealType dt, int stages)
1203  { get<i>(lops)->preStep(time, dt, stages); }
1204  };
1205 
1206  template<int i> struct PostStepOperation {
1207  static void apply(ArgPtrs& lops)
1208  { get<i>(lops)->postStep(); }
1209  };
1210 
1211  template<int i> struct PreStageOperation {
1212  static void apply(ArgPtrs& lops, RealType time, int r)
1213  { get<i>(lops)->preStage(time, r); }
1214  };
1215 
1216  template<int i> struct PostStageOperation {
1217  static void apply(ArgPtrs& lops)
1218  { get<i>(lops)->postStage(); }
1219  };
1220 
1221  template<int i> struct SuggestTimestepOperation {
1222  static void apply(ArgPtrs& lops, RealType& dt)
1223  { dt = get<i>(lops)->suggestTimestep(dt); }
1224  };
1225 
1226  public:
1229  {
1230  ForLoop<SetTimeOperation, 0, size-1>::apply(lops, t);
1231  }
1232 
1235  {
1236  return get<0>(lops)->getTime();
1237  }
1238 
1240  void preStep (RealType time, RealType dt, int stages)
1241  {
1242  ForLoop<PreStepOperation, 0, size-1>::apply(lops, time, dt, stages);
1243  }
1244 
1246  void postStep ()
1247  {
1248  ForLoop<PostStepOperation, 0, size-1>::apply(lops);
1249  }
1250 
1252  void preStage (RealType time, int r)
1253  {
1254  ForLoop<PreStageOperation, 0, size-1>::apply(lops, time, r);
1255  }
1256 
1258  int getStage () const
1259  {
1260  return get<0>(lops)->getStage();
1261  }
1262 
1264  void postStage ()
1265  {
1266  ForLoop<PostStageOperation, 0, size-1>::apply(lops);
1267  }
1268 
1270 
1276  {
1277  ForLoop<SuggestTimestepOperation, 0, size-1>::apply(lops, dt);
1278  return dt;
1279  }
1280 
1282  };
1283 
1285  }
1286 }
1287 
1288 #endif // DUNE_PDELAB_LOCALOPERATOR_WEIGHTEDSUM_HH
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:718
RealType suggestTimestep(RealType dt) const
to be called after stage 1
Definition: weightedsum.hh:1275
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:117
RealType getTime() const
get current time
Definition: weightedsum.hh:1234
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:533
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:363
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:746
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:69
K getWeight(std::size_t i)
get the weight for the i'th component of the sum
Definition: weightedsum.hh:88
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:549
dune_static_assert(!(AccFlag< OneSidedSkeletonRequiredValue >::value &&AccFlag< TwoSidedSkeletonRequiredValue >::value),"Some summands require a one-sided skelton, others a ""two-sided skeleton. This is not supported.")
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:109
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:330
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:43
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:95
Container & container()
Returns the container (of type LocalVector) that this view is based on.
Definition: localvector.hh:127
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:569
tuple_element< 0, Args >::type::RealType RealType
Export type used for time values.
Definition: weightedsum.hh:1189
VTKWriter & w
Definition: function.hh:1102
A local operator to take the weighted sum of other local operators.
Definition: weightedsum.hh:38
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:516
void pattern_volume(const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern) const
get an element's contribution to the sparsity pattern
Definition: weightedsum.hh:314
void preStage(RealType time, int r)
to be called once before each stage
Definition: weightedsum.hh:1252
void postStep()
to be called once at the end of each time step
Definition: weightedsum.hh:1246
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:1172
Definition: callswitch.hh:12
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:80
static void lambda_boundary(const LA &la, const IG &ig, const LFSV &lfsv, R &r)
Definition: callswitch.hh:75
static void jacobian_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat)
Definition: callswitch.hh:101
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:953
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:47
int getStage() const
get current stage
Definition: weightedsum.hh:1258
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:1152
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:1136
static void lambda_volume(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:61
const IG & ig
Definition: common/constraints.hh:146
void lambda_volume(const EG &eg, const LFSV &lfsv, C &r) const
get an element's contribution to lambda
Definition: weightedsum.hh:705
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:54
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:900
An accumulate-only view on a local matrix that automatically takes into account an accumulation weigh...
Definition: common/localmatrix.hh:21
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:917
void setTime(RealType t)
set time for subsequent evaluation
Definition: weightedsum.hh:1228
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
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:732
static void lambda_volume_post_skeleton(const LA &la, const EG &eg, const LFSV &lfsv, R &r)
Definition: callswitch.hh:65
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:84
static void alpha_volume(const LA &la, const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r)
Definition: callswitch.hh:39
weight_type weight()
Returns the weight associated with this view.
Definition: localvector.hh:61
weight_type weight()
Returns the weight associated with this view.
Definition: common/localmatrix.hh:60
tuple_element< i, Args >::type & getSummand()
get the i'th component of the sum
Definition: weightedsum.hh:80
const EG & eg
Definition: common/constraints.hh:277
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:1120
void preStep(RealType time, RealType dt, int stages)
to be called once before each time step
Definition: weightedsum.hh:1240
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:933
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:105
WeightedSumLocalOperator(const Weights &weights_=Weights(1))
construct a WeightedSumLocalOperator
Definition: weightedsum.hh:62
An accumulate-only view on a local vector that automatically takes into account an accumulation weigh...
Definition: localvector.hh:26
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:88
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:345
void postStage()
to be called once at the end of each stage
Definition: weightedsum.hh:1264
void setWeight(K w, std::size_t i)
set the weight for the i'th component of the sum
Definition: weightedsum.hh:84
Container & container()
Returns the container (of type LocalMatrix) that this view is based on.
Definition: common/localmatrix.hh:129
void setSummand(typename tuple_element< i, Args >::type &summand)
set the i'th component of the sum
Definition: weightedsum.hh:75