diff --git a/dune/gfe/rodassembler.cc b/dune/gfe/rodassembler.cc index e51cdf69d63ec9d82a782bee78e6727c69929a73..fb7e472b2fd645f691294b1a3eb4507d016f8687 100644 --- a/dune/gfe/rodassembler.cc +++ b/dune/gfe/rodassembler.cc @@ -25,7 +25,7 @@ assembleGradient(const std::vector<RigidBodyMotion<double,3> >& sol, grad = 0; // A view on the FE basis on a single element - typename Basis::LocalView localView(&this->basis_); + auto localView = this->basis_.localView(); auto localIndexSet = this->basis_.indexSet().localIndexSet(); ElementIterator it = this->basis_.gridView().template begin<0>(); @@ -49,8 +49,7 @@ assembleGradient(const std::vector<RigidBodyMotion<double,3> >& sol, // Assemble local gradient std::vector<FieldVector<double,blocksize> > localGradient(nDofs); - this->localStiffness_->assembleGradient(*it, - localView.tree().finiteElement(), + this->localStiffness_->assembleGradient(localView, localSolution, localGradient); diff --git a/dune/gfe/rodlocalstiffness.hh b/dune/gfe/rodlocalstiffness.hh index ad5133b825e8771ae18000254e53122e99525d79..30e136aaaf052a284a4d43c125713f5d1528e1d8 100644 --- a/dune/gfe/rodlocalstiffness.hh +++ b/dune/gfe/rodlocalstiffness.hh @@ -15,6 +15,7 @@ class RodLocalStiffness : public LocalGeodesicFEStiffness<Dune::Functions::PQkNodalBasis<GridView,1>, RigidBodyMotion<RT,3> > { typedef RigidBodyMotion<RT,3> TargetSpace; + typedef Dune::Functions::PQkNodalBasis<GridView,1> Basis; // grid types typedef typename GridView::Grid::ctype DT; @@ -100,13 +101,12 @@ public: virtual RT energy (const Entity& e, const std::array<RigidBodyMotion<RT,3>, dim+1>& localSolution) const; - virtual RT energy (const Entity& e, - const typename Dune::Functions::PQkNodalBasis<GridView,1>::LocalView::Tree::FiniteElement& localFiniteElement, + virtual RT energy (const typename Basis::LocalView& localView, const std::vector<RigidBodyMotion<RT,3> >& localSolution) const { assert(localSolution.size()==2); std::array<RigidBodyMotion<RT,3>, 2> localSolutionArray = {localSolution[0], localSolution[1]}; - return energy(e,localSolutionArray); + return energy(localView.element(),localSolutionArray); } /** \brief Assemble the element gradient of the energy functional */