From c7fdb79a588a966dc9a3db19309259e6b7ea7277 Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Sat, 30 Jan 2016 06:16:58 +0100 Subject: [PATCH] Cleanup; use 'auto' a bit more frequently --- dune/gfe/globalgeodesicfefunction.hh | 2 +- dune/gfe/harmonicenergystiffness.hh | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/dune/gfe/globalgeodesicfefunction.hh b/dune/gfe/globalgeodesicfefunction.hh index 0c78a044..3feda008 100644 --- a/dune/gfe/globalgeodesicfefunction.hh +++ b/dune/gfe/globalgeodesicfefunction.hh @@ -80,7 +80,7 @@ public: out =0.0; //transform the gradient - const Dune::FieldMatrix<double,gridDim,gridDim>& jacInvTrans = element.geometry().jacobianInverseTransposed(local); + const auto jacInvTrans = element.geometry().jacobianInverseTransposed(local); for (size_t k=0; k< refJac.N(); k++) jacInvTrans.umv(refJac[k],out[k]); diff --git a/dune/gfe/harmonicenergystiffness.hh b/dune/gfe/harmonicenergystiffness.hh index ad8f60b6..cc287bc9 100644 --- a/dune/gfe/harmonicenergystiffness.hh +++ b/dune/gfe/harmonicenergystiffness.hh @@ -15,16 +15,12 @@ class HarmonicEnergyLocalStiffness typedef typename Basis::GridView GridView; typedef typename GridView::ctype DT; typedef typename TargetSpace::ctype RT; - typedef typename GridView::template Codim<0>::Entity Entity; // some other sizes enum {gridDim=GridView::dimension}; public: - //! Dimension of a tangent space - enum { blocksize = TargetSpace::TangentVector::dimension }; - /** \brief Assemble the energy for a single element */ RT energy (const typename Basis::LocalView& localView, const std::vector<TargetSpace>& localSolution) const override; @@ -37,8 +33,6 @@ HarmonicEnergyLocalStiffness<Basis, TargetSpace>:: energy(const typename Basis::LocalView& localView, const std::vector<TargetSpace>& localSolution) const { - typedef typename GridView::template Codim<0>::Entity::Geometry Geometry; - RT energy = 0; const auto& localFiniteElement = localView.tree().finiteElement(); @@ -50,8 +44,7 @@ energy(const typename Basis::LocalView& localView, const auto element = localView.element(); - const Dune::QuadratureRule<double, gridDim>& quad - = Dune::QuadratureRules<double, gridDim>::rule(localFiniteElement.type(), quadOrder); + const auto& quad = Dune::QuadratureRules<double, gridDim>::rule(localFiniteElement.type(), quadOrder); for (size_t pt=0; pt<quad.size(); pt++) { @@ -60,12 +53,12 @@ energy(const typename Basis::LocalView& localView, const double integrationElement = element.geometry().integrationElement(quadPos); - const typename Geometry::JacobianInverseTransposed& jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(quadPos); + const auto jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(quadPos); double weight = quad[pt].weight() * integrationElement; // The derivative of the local function defined on the reference element - typename LocalGFEFunctionType::DerivativeType referenceDerivative = localGeodesicFEFunction.evaluateDerivative(quadPos); + auto referenceDerivative = localGeodesicFEFunction.evaluateDerivative(quadPos); // The derivative of the function defined on the actual element typename LocalGFEFunctionType::DerivativeType derivative(0); -- GitLab