3#ifndef DUNE_PDELAB_LOCALOPERATOR_SCALED_HH
4#define DUNE_PDELAB_LOCALOPERATOR_SCALED_HH
33 template<
typename Backend,
typename Factor,
typename Time =
double>
72 : factor(factor_), bp(&backend) { }
83 void setFactor(Factor factor_) { factor = factor_; }
102 enum { doPatternVolume = Backend::doPatternVolume };
107 doPatternVolumePostSkeleton = Backend::doPatternVolumePostSkeleton
112 enum { doPatternSkeleton = Backend::doPatternSkeleton };
116 enum { doPatternBoundary = Backend::doPatternBoundary };
120 enum { doAlphaVolume = Backend::doAlphaVolume };
125 enum { doAlphaVolumePostSkeleton = Backend::doAlphaVolumePostSkeleton };
128 enum { doAlphaSkeleton = Backend::doAlphaSkeleton };
131 enum { doAlphaBoundary = Backend::doAlphaBoundary };
134 enum { doLambdaVolume = Backend::doLambdaVolume };
138 doLambdaVolumePostSkeleton = Backend::doLambdaVolumePostSkeleton
141 enum { doLambdaSkeleton = Backend::doLambdaSkeleton };
143 enum { doLambdaBoundary = Backend::doLambdaBoundary };
146 enum { doSkeletonTwoSided = Backend::doSkeletonTwoSided };
169 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
171 (
const LFSU& lfsu,
const LFSV& lfsv,
172 LocalPattern& pattern)
const
175 bp->pattern_volume(lfsu, lfsv, pattern);
192 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
194 (
const LFSU& lfsu,
const LFSV& lfsv,
195 LocalPattern& pattern)
const
198 bp->pattern_volume_post_skeleton(lfsu, lfsv, pattern);
222 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
224 (
const LFSU& lfsu_s,
const LFSV& lfsv_s,
225 const LFSU& lfsu_n,
const LFSV& lfsv_n,
226 LocalPattern& pattern_sn,
227 LocalPattern& pattern_ns)
const
230 bp->pattern_skeleton(lfsu_s, lfsv_s, lfsu_n, lfsv_n,
231 pattern_sn, pattern_ns);
250 template<
typename LFSU,
typename LFSV,
typename LocalPattern>
252 (
const LFSU& lfsu_s,
const LFSV& lfsv_s,
253 LocalPattern& pattern_ss)
const
256 bp->pattern_boundary(lfsu_s, lfsv_s, pattern_ss);
289 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
293 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
297 typename R::WeightedAccumulationView
298 my_r(r.weightedAccumulationView(factor));
299 bp->alpha_volume(eg, lfsu, x, lfsv, my_r);
327 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
331 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
335 typename R::WeightedAccumulationView
336 my_r(r.weightedAccumulationView(factor));
337 bp->alpha_volume_post_skeleton(eg, lfsu, x, lfsv, my_r);
374 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
378 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
379 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
380 R& r_s, R& r_n)
const
383 typename R::WeightedAccumulationView
384 my_r_s(r_s.weightedAccumulationView(factor));
385 typename R::WeightedAccumulationView
386 my_r_n(r_n.weightedAccumulationView(factor));
387 bp->alpha_skeleton(ig,
420 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
424 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
428 typename R::WeightedAccumulationView
429 my_r_s(r_s.weightedAccumulationView(factor));
430 bp->alpha_boundary(ig, lfsu_s, x_s, lfsv_s, my_r_s);
457 template<
typename EG,
typename LFSV,
typename R>
461 typename R::WeightedAccumulationView
462 my_r(r.weightedAccumulationView(factor));
463 bp->lambda_volume(eg, lfsv, my_r);
485 template<
typename EG,
typename LFSV,
typename R>
491 typename R::WeightedAccumulationView
492 my_r(r.weightedAccumulationView(factor));
493 bp->lambda_volume_post_skeleton(eg, lfsv, my_r);
518 template<
typename IG,
typename LFSV,
typename R>
520 const LFSV& lfsv_s,
const LFSV& lfsv_n,
521 R& r_s, R& r_n)
const
524 typename R::WeightedAccumulationView
525 my_r_s(r_s.weightedAccumulationView(factor));
526 typename R::WeightedAccumulationView
527 my_r_n(r_n.weightedAccumulationView(factor));
528 bp->lambda_skeleton(ig, lfsv_s, lfsv_n, my_r_s, my_r_n);
550 template<
typename IG,
typename LFSV,
typename R>
554 typename R::WeightedAccumulationView
555 my_r_s(r_s.weightedAccumulationView(factor));
556 bp->lambda_boundary(ig, lfsv_s, my_r_s);
594 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
598 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
602 typename Y::WeightedAccumulationView
603 my_y(y.weightedAccumulationView(factor));
604 bp->jacobian_apply_volume(eg, lfsu, x, lfsv, my_y);
636 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
640 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
644 typename Y::WeightedAccumulationView
645 my_y(y.weightedAccumulationView(factor));
646 bp->jacobian_apply_volume_post_skeleton(eg, lfsu, x, lfsv, my_y);
688 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
692 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
693 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
694 Y& y_s, Y& y_n)
const
697 typename Y::WeightedAccumulationView
698 my_y_s(y_s.weightedAccumulationView(factor));
699 typename Y::WeightedAccumulationView
700 my_y_n(y_n.weightedAccumulationView(factor));
701 bp->jacobian_apply_skeleton(ig,
738 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
742 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
746 typename Y::WeightedAccumulationView
747 my_y_s(y_s.weightedAccumulationView(factor));
748 bp->jacobian_apply_boundary(ig, lfsu_s, x_s, lfsv_s, my_y_s);
777 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
781 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
785 typename M::WeightedAccumulationView
786 my_mat(mat.weightedAccumulationView(factor));
787 bp->jacobian_volume(eg, lfsu, x, lfsv, my_mat);
809 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
813 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
817 typename M::WeightedAccumulationView
818 my_mat(mat.weightedAccumulationView(factor));
819 bp->jacobian_volume_post_skeleton(eg, lfsu, x, lfsv, my_mat);
858 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
862 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
863 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
864 M& mat_ss, M& mat_sn, M& mat_ns, M& mat_nn)
const
867 typename M::WeightedAccumulationView
868 my_mat_ss(mat_ss.weightedAccumulationView(factor));
869 typename M::WeightedAccumulationView
870 my_mat_sn(mat_sn.weightedAccumulationView(factor));
871 typename M::WeightedAccumulationView
872 my_mat_ns(mat_ns.weightedAccumulationView(factor));
873 typename M::WeightedAccumulationView
874 my_mat_nn(mat_nn.weightedAccumulationView(factor));
875 bp->jacobian_skeleton(ig,
878 my_mat_ss, my_mat_sn, my_mat_ns, my_mat_nn);
904 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
908 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
912 typename M::WeightedAccumulationView
913 my_mat_ss(mat_ss.weightedAccumulationView(factor));
914 bp->jacobian_boundary(ig, lfsu_s, x_s, lfsv_s, my_mat_ss);
925 typedef Time RealType;
942 Time
getTime ()
const {
return bp->getTime(); }
961 { bp->preStep(time, dt, stages); }
986 void preStage (Time time,
int r) { bp->preStage(time, r); }
1009 {
return bp->suggestTimestep(dt); }
A local operator that scales the result of another local operator.
Definition: scaled.hh:55
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: scaled.hh:194
int getStage() const
get current stage
Definition: scaled.hh:992
ScaledLocalOperator(Backend &backend, Factor factor_=0)
construct a ScaledLocalOperator
Definition: scaled.hh:71
void lambda_boundary(const IG &ig, const LFSV &lfsv_s, R &r_s) const
get a boundary intersections's contribution to lambda
Definition: scaled.hh:551
ScaledLocalOperator(Factor factor_=0)
construct a ScaledLocalOperator
Definition: scaled.hh:80
void jacobian_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat) const
get an element's jacobian
Definition: scaled.hh:780
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, M &mat_ss, M &mat_sn, M &mat_ns, M &mat_nn) const
apply an internal intersections's jacobians
Definition: scaled.hh:861
void pattern_volume(const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern) const
get an element's contribution to the sparsity pattern
Definition: scaled.hh:171
void lambda_skeleton(const IG &ig, const LFSV &lfsv_s, const LFSV &lfsv_n, R &r_s, R &r_n) const
get an internal intersections's contribution to lambda
Definition: scaled.hh:519
Backend & getBackend() const
get a reference to the backend
Definition: scaled.hh:90
void jacobian_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, M &mat) const
get an element's jacobian after the intersections have been handled
Definition: scaled.hh:812
void jacobian_apply_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, Y &y_s) const
apply a boundary intersections's jacobian
Definition: scaled.hh:741
void jacobian_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, M &mat_ss) const
get a boundary intersections's jacobian
Definition: scaled.hh:907
void setBackend(Backend &backend)
set the backend
Definition: scaled.hh:88
void lambda_volume_post_skeleton(const EG &eg, const LFSV &lfsv, R &r) const
get an element's contribution to lambda after the intersections have been handled
Definition: scaled.hh:486
void setFactor(Factor factor_)
set the scaling factor
Definition: scaled.hh:83
void preStep(Time time, Time dt, int stages)
to be called once before each time step
Definition: scaled.hh:960
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: scaled.hh:252
void jacobian_apply_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y) const
apply an element's jacobian
Definition: scaled.hh:597
void postStage()
to be called once at the end of each stage
Definition: scaled.hh:995
void lambda_volume(const EG &eg, const LFSV &lfsv, R &r) const
get an element's contribution to lambda
Definition: scaled.hh:458
void alpha_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r) const
get an element's contribution to alpha
Definition: scaled.hh:292
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, R &r_s, R &r_n) const
get an internal intersections's contribution to alpha
Definition: scaled.hh:377
void alpha_boundary(const IG &ig, const LFSU &lfsu_s, const X &x_s, const LFSV &lfsv_s, R &r_s) const
get a boundary intersections's contribution to alpha
Definition: scaled.hh:423
void postStep()
to be called once at the end of each time step
Definition: scaled.hh:970
Factor getFactor() const
get the scaling factor
Definition: scaled.hh:85
Time suggestTimestep(Time dt) const
to be called after stage 1
Definition: scaled.hh:1008
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: scaled.hh:224
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, Y &y_s, Y &y_n) const
apply an internal intersections's jacobians
Definition: scaled.hh:691
void alpha_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r) const
get an element's contribution to alpha after the intersections have been handled
Definition: scaled.hh:330
void setTime(Time t)
set time for subsequent evaluation
Definition: scaled.hh:936
void jacobian_apply_volume_post_skeleton(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, Y &y) const
apply an element's jacobian after the intersections have been handled
Definition: scaled.hh:639
Time getTime() const
get current time
Definition: scaled.hh:942
void preStage(Time time, int r)
to be called once before each stage
Definition: scaled.hh:986
Dune namespace.
Definition: alignedallocator.hh:11