2#ifndef DUNE_PDELAB_LOCALOPERATOR_EVAL_HH
3#define DUNE_PDELAB_LOCALOPERATOR_EVAL_HH
16 template<
class DomainType,
20 inline void evalFunction(
const DomainType& location,
26 typedef typename LFS::Traits::FiniteElementType::
27 Traits::LocalBasisType::Traits::RangeType RangeType;
29 std::vector<RangeType> phi(lfs.size());
30 lfs.finiteElement().localBasis().evaluateFunction( location, phi );
33 valU = RangeFieldType(0.0);
34 for( std::size_t i=0; i<lfs.size(); i++ )
35 valU += xlocal( lfs, i ) * phi[i];
41 template<
class DomainType,
47 inline void evalGradient(
const DomainType& location,
54 typedef typename LFS::Traits::FiniteElementType::
55 Traits::LocalBasisType::Traits::JacobianType JacobianType;
57 typedef typename LFS::Traits::SizeType size_type;
59 std::vector<JacobianType> js(lfs.size());
60 lfs.finiteElement().localBasis().evaluateJacobian( location, js );
62 enum { dim = RangeType::dimension };
64 typename EG::Geometry::JacobianInverseTransposed jac;
67 jac = eg.geometry().jacobianInverseTransposed( location );
68 std::vector<RangeType> gradphi(lfs.size());
69 for (size_type i=0; i<lfs.size(); i++)
70 jac.mv( js[i][0], gradphi[i] );
74 for (size_type i=0; i<lfs.size(); i++)
75 gradu.axpy( xlocal(lfs,i), gradphi[i] );
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Dune namespace.
Definition: alignedallocator.hh:13