3#ifndef DUNE_PDELAB_LOCALOPERATOR_NUMERICALRESIDUAL_HH
4#define DUNE_PDELAB_LOCALOPERATOR_NUMERICALRESIDUAL_HH
9#include <dune/pdelab/gridoperator/common/localmatrix.hh>
34 template<
typename Imp>
40 template<
typename EG,
typename LFSU,
typename X,
typename LFSV,
44 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
48 typedef typename Jacobian::WeightedAccumulationView JacobianView;
50 Jacobian mat(r.size(),x.size(), 0);
51 JacobianView matview = mat.weightedAccumulationView(1.0);
52 asImp().jacobian_volume(eg, lfsu, x, lfsv, matview);
54 mat.usmv(r.weight(),x,r);
58 Imp& asImp () {
return static_cast<Imp &
> (*this); }
59 const Imp& asImp ()
const {
return static_cast<const Imp &
>(*this); }
73 template<
typename Imp>
79 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
83 const LFSU& lfsu_s,
const X& x_s,
const LFSV& lfsv_s,
84 const LFSU& lfsu_n,
const X& x_n,
const LFSV& lfsv_n,
88 typedef typename Jacobian::WeightedAccumulationView JacobianView;
90 Jacobian mat_ss(r_s.size(),x_s.size(),0);
91 Jacobian mat_sn(r_s.size(),x_n.size(),0);
92 Jacobian mat_ns(r_n.size(),x_s.size(),0);
93 Jacobian mat_nn(r_n.size(),x_n.size(),0);
95 JacobianView view_ss = mat_ss.weightedAccumulationView(1.0);
96 JacobianView view_sn = mat_sn.weightedAccumulationView(1.0);
97 JacobianView view_ns = mat_ns.weightedAccumulationView(1.0);
98 JacobianView view_nn = mat_nn.weightedAccumulationView(1.0);
100 asImp().jacobian_skeleton(ig,
103 view_ss, view_sn, view_ns, view_nn);
105 mat_ss.usmv(r_s.weight(),x_s,r_s);
106 mat_ns.usmv(r_n.weight(),x_s,r_n);
107 mat_sn.usmv(r_s.weight(),x_n,r_s);
108 mat_nn.usmv(r_n.weight(),x_n,r_n);
112 Imp& asImp () {
return static_cast<Imp &
> (*this); }
113 const Imp& asImp ()
const {
return static_cast<const Imp &
>(*this); }
127 template<
typename Imp>
133 template<
typename IG,
typename LFSU,
typename X,
typename LFSV,
137 const LFSU& lfsu,
const X& x,
const LFSV& lfsv,
141 typedef typename Jacobian::WeightedAccumulationView JacobianView;
143 Jacobian mat(x.size(),r.size(), 0);
144 JacobianView view = mat.weightedAccumulationView(1.0);
145 asImp().jacobian_boundary(ig, lfsu, x, lfsv, view);
147 mat.usmv(r.weight(),x,r);
151 Imp& asImp () {
return static_cast<Imp &
> (*this); }
152 const Imp& asImp ()
const {
return static_cast<const Imp &
>(*this); }
Implement alpha_boundary() based on jacobian_boundary()
Definition: numericalresidual.hh:129
void alpha_boundary(const IG &ig, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r) const
compute
Definition: numericalresidual.hh:136
Implement alpha_skeleton() based on jacobian_skeleton()
Definition: numericalresidual.hh:75
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
compute
Definition: numericalresidual.hh:82
Implement alpha_volume() based on jacobian_volume()
Definition: numericalresidual.hh:36
void alpha_volume(const EG &eg, const LFSU &lfsu, const X &x, const LFSV &lfsv, R &r) const
compute
Definition: numericalresidual.hh:43
A dense matrix for storing data associated with the degrees of freedom of a pair of LocalFunctionSpac...
Definition: localmatrix.hh:184
Dune namespace.
Definition: alignedallocator.hh:11