From 0710b8e5132ecd3e8398a84fc49adf3acaa60faa Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@mi.fu-berlin.de>
Date: Mon, 17 Oct 2011 12:14:00 +0000
Subject: [PATCH] don't hardwire the coefficient type to be
 std::vector<TargetSpace>

[[Imported from SVN: r7936]]
---
 dune/gfe/globalgeodesicfefunction.hh   | 8 +++++---
 dune/gfe/globalgfetestfunctionbasis.hh | 6 +++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dune/gfe/globalgeodesicfefunction.hh b/dune/gfe/globalgeodesicfefunction.hh
index e58f21bb..914c376d 100644
--- a/dune/gfe/globalgeodesicfefunction.hh
+++ b/dune/gfe/globalgeodesicfefunction.hh
@@ -13,10 +13,12 @@
  *
  *  \tparam Basis  - The global basis type.
  *  \tparam TargetSpace - The manifold that this functions takes its values in.
+ *  \tparam CoefficientType - The coefficient vector type.
  */
-template<class Basis, class TargetSpace>
+template<class Basis, class TargetSpace, class CoefficientType>
 GlobalGeodesicFEFunction {
 
+
     typedef typename Basis::LocalFiniteElement LocalFiniteElement;
     typedef typename Basis::GridView GridView;
     typedef typename GridView::template Codim<0>::Entity Element;
@@ -34,7 +36,7 @@ GlobalGeodesicFEFunction {
 public:
 
     //! Create global function by a global basis and the corresponding coefficient vector
-    GlobalGeodesicFEFunction(const Basis& basis, const std::vector<TargetSpace>& coefficients) :
+    GlobalGeodesicFEFunction(const Basis& basis, const CoefficientType& coefficients) :
         basis_(basis),
         coefficients_(coefficients)
     {}
@@ -78,6 +80,6 @@ private:
     //! The global basis
     const Basis& basis_;
     //! The coefficient vector
-    const std::vector<TargetSpace>& coefficients_;
+    const CoefficientType& coefficients_;
 };
 #endif
diff --git a/dune/gfe/globalgfetestfunctionbasis.hh b/dune/gfe/globalgfetestfunctionbasis.hh
index ffe83130..0b495d9d 100644
--- a/dune/gfe/globalgfetestfunctionbasis.hh
+++ b/dune/gfe/globalgfetestfunctionbasis.hh
@@ -21,7 +21,7 @@ class LocalTestFunctionWrapper;
  *  The other LocalFiniteElement methods are not wrapped/implemented by now but it shouldn't be too difficult to do so when they are
  *  needed.
  */
-template <class Basis, class TargetSpace>
+template <class Basis, class TargetSpace, class CoefficientType>
 class GlobalGFETestFunctionBasis : public FunctionSpaceBasis<typename Basis::GridView, typename TargetSpace::EmbeddedTangentVector, LocalTestFunctionWrapper<typename Basis::LocalFiniteElement, TargetSpace> > {
 
 public:
@@ -37,7 +37,7 @@ private:
     const static int tangentDim = TargetSpace::TangentVector::dimension;
 
 public:
-    GlobalGFETestFunctionBasis(const Basis& basis, std::vector<TargetSpace>& baseCoefficients) :
+    GlobalGFETestFunctionBasis(const Basis& basis, const CoefficientType& baseCoefficients) :
         Base(basis.getGridView()),
         basis_(basis),
         baseCoefficients_(baseCoefficients),
@@ -89,7 +89,7 @@ private:
     //! The global basis determining the weights
     const Basis& basis_;
     //! The coefficients of the configuration the tangent spaces are from. */
-    const std::vector<TargetSpace>& baseCoefficients_; 
+    const CoefficientType& baseCoefficients_; 
     //! Save the last local finite element - do I need to do this?
     mutable LocalFiniteElement* lfe_;
 };
-- 
GitLab