From 306881e70bedc5ecd78fd1af46143eb308937ebb Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Mon, 9 Jan 2012 17:52:44 +0100
Subject: [PATCH] Retrieve dimension from VectorType

---
 dune/tectonic/globallaursennonlinearity.hh | 6 ++++--
 dune/tectonic/globalnonlinearity.hh        | 3 ++-
 dune/tectonic/globalruinanonlinearity.hh   | 6 ++++--
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dune/tectonic/globallaursennonlinearity.hh b/dune/tectonic/globallaursennonlinearity.hh
index 4bf9dd87..84e13def 100644
--- a/dune/tectonic/globallaursennonlinearity.hh
+++ b/dune/tectonic/globallaursennonlinearity.hh
@@ -13,10 +13,12 @@
 #include "nicefunction.hh"
 
 namespace Dune {
-template <int dim, class OuterFunctionType, class VectorType, class MatrixType>
+template <int dimZ, class OuterFunctionType, class VectorType, class MatrixType>
 class GlobalLaursenNonlinearity
-    : public GlobalNonlinearity<dim, VectorType, MatrixType> {
+    : public GlobalNonlinearity<dimZ, VectorType, MatrixType> {
 public:
+  using GlobalNonlinearity<dimZ, VectorType, MatrixType>::dim;
+
   GlobalLaursenNonlinearity(
       shared_ptr<BlockVector<FieldVector<double, 1>> const> mu,
       shared_ptr<BlockVector<FieldVector<double, 1>> const> normalStress,
diff --git a/dune/tectonic/globalnonlinearity.hh b/dune/tectonic/globalnonlinearity.hh
index 61f5c744..64e3178c 100644
--- a/dune/tectonic/globalnonlinearity.hh
+++ b/dune/tectonic/globalnonlinearity.hh
@@ -12,11 +12,12 @@
 #include "localnonlinearity.hh"
 
 namespace Dune {
-template <int dim, class VectorTypeTEMPLATE, class MatrixTypeTEMPLATE>
+template <int dimX, class VectorTypeTEMPLATE, class MatrixTypeTEMPLATE>
 class GlobalNonlinearity {
 public:
   typedef VectorTypeTEMPLATE VectorType;
   typedef MatrixTypeTEMPLATE MatrixType;
+  int static const dim = VectorTypeTEMPLATE::block_type::dimension;
 
   double operator()(VectorType const &x) const {
     double tmp = 0;
diff --git a/dune/tectonic/globalruinanonlinearity.hh b/dune/tectonic/globalruinanonlinearity.hh
index c3643cf1..c4229812 100644
--- a/dune/tectonic/globalruinanonlinearity.hh
+++ b/dune/tectonic/globalruinanonlinearity.hh
@@ -14,10 +14,12 @@
 #include "nicefunction.hh"
 
 namespace Dune {
-template <int dim, class VectorType, class MatrixType>
+template <int dimX, class VectorType, class MatrixType>
 class GlobalRuinaNonlinearity
-    : public GlobalNonlinearity<dim, VectorType, MatrixType> {
+    : public GlobalNonlinearity<dimX, VectorType, MatrixType> {
 public:
+  using GlobalNonlinearity<dimX, VectorType, MatrixType>::dim;
+
   GlobalRuinaNonlinearity(
       shared_ptr<BlockVector<FieldVector<double, 1>> const> nodalIntegrals,
       shared_ptr<BlockVector<FieldVector<double, 1>> const> a,
-- 
GitLab