From a12175eca22655679b2e698e0087915ae2a5b437 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 19 Feb 2010 12:02:40 +0000
Subject: [PATCH] cleanup

[[Imported from SVN: r5598]]
---
 src/localgeodesicfefunction.hh | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/localgeodesicfefunction.hh b/src/localgeodesicfefunction.hh
index f465e3fa..1fe57995 100644
--- a/src/localgeodesicfefunction.hh
+++ b/src/localgeodesicfefunction.hh
@@ -39,8 +39,8 @@ public:
 
 private:
 
-    static Dune::FieldVector<ctype,dim+1> barycentricCoordinates(const Dune::FieldVector<ctype,dim>& local) {
-        Dune::FieldVector<ctype,dim+1> result;
+    static std::vector<ctype> barycentricCoordinates(const Dune::FieldVector<ctype,dim>& local) {
+        std::vector<ctype> result(dim+1);
         result[0] = 1;
         for (int i=0; i<dim; i++) {
             result[0]  -= local[i];
@@ -59,15 +59,9 @@ TargetSpace LocalGeodesicFEFunction<dim,ctype,TargetSpace>::
 evaluate(const Dune::FieldVector<ctype, dim>& local)
 {
     // First compute the coordinates on the standard simplex (in R^{n+1})
-    std::vector<ctype> barycentricCoordinates(dim+1);
+    std::vector<ctype> w = barycentricCoordinates(local);
 
-    barycentricCoordinates[0] = 1;
-    for (int i=0; i<dim; i++) {
-        barycentricCoordinates[0] -= local[i];
-         barycentricCoordinates[i+1] = local[i];
-    }
-
-    AverageDistanceAssembler<TargetSpace> assembler(coefficients_, barycentricCoordinates);
+    AverageDistanceAssembler<TargetSpace> assembler(coefficients_, w);
 
     TargetSpaceRiemannianTRSolver<TargetSpace> solver;
 
@@ -129,7 +123,7 @@ evaluateDerivative(const Dune::FieldVector<ctype, dim>& local)
     Dune::FMatrixHelp::multMatrix(dFdw,B, RHS);
 
     // the actual system matrix
-    Dune::FieldVector<ctype,dim+1> w = barycentricCoordinates(local);
+    std::vector<ctype> w = barycentricCoordinates(local);
     AverageDistanceAssembler<TargetSpace> assembler(coefficients_, w);
     
     Dune::FieldMatrix<ctype,dim+1,dim+1> dFdq(0);
-- 
GitLab