From 5c1c2d757bc6c5abd2b3d20021e5f4401bbb74be Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Tue, 9 Mar 2010 16:05:31 +0000
Subject: [PATCH] class RodAssembler has a template parameter 'spaceDim' now. 
 The old implementation becomes the 'spaceDim==3' specialization

[[Imported from SVN: r5721]]
---
 src/rodassembler.cc |  8 ++++----
 src/rodassembler.hh | 13 +++++++++++--
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/rodassembler.cc b/src/rodassembler.cc
index b1a86a94..34dc9d89 100644
--- a/src/rodassembler.cc
+++ b/src/rodassembler.cc
@@ -12,7 +12,7 @@
 
 
 template <class GridView>
-void RodAssembler<GridView>::
+void RodAssembler<GridView,3>::
 assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
                  Dune::BlockVector<Dune::FieldVector<double, blocksize> >& grad) const
 {
@@ -56,7 +56,7 @@ assembleGradient(const std::vector<RigidBodyMotion<3> >& sol,
 
 
 template <class GridView>
-void RodAssembler<GridView>::
+void RodAssembler<GridView,3>::
 getStrain(const std::vector<RigidBodyMotion<3> >& sol,
           Dune::BlockVector<Dune::FieldVector<double, blocksize> >& strain) const
 {
@@ -119,7 +119,7 @@ getStrain(const std::vector<RigidBodyMotion<3> >& sol,
 }
 
 template <class GridView>
-void RodAssembler<GridView>::
+void RodAssembler<GridView,3>::
 getStress(const std::vector<RigidBodyMotion<3> >& sol,
           Dune::BlockVector<Dune::FieldVector<double, blocksize> >& stress) const
 {
@@ -141,7 +141,7 @@ getStress(const std::vector<RigidBodyMotion<3> >& sol,
 
 template <class GridView>
 template <class PatchGridView>
-Dune::FieldVector<double,3> RodAssembler<GridView>::
+Dune::FieldVector<double,3> RodAssembler<GridView,3>::
 getResultantForce(const BoundaryPatchBase<PatchGridView>& boundary,
                   const std::vector<RigidBodyMotion<3> >& sol,
                   Dune::FieldVector<double,3>& canonicalTorque) const
diff --git a/src/rodassembler.hh b/src/rodassembler.hh
index f5c67235..cbf075bc 100644
--- a/src/rodassembler.hh
+++ b/src/rodassembler.hh
@@ -12,10 +12,19 @@
 #include "rodlocalstiffness.hh"
 #include "geodesicfeassembler.hh"
 
-/** \brief The FEM operator for an extensible, shearable rod
+/** \brief The FEM operator for an extensible, shearable rod in 3d
+ */
+template <class GridView, int spaceDim>
+class RodAssembler
+{
+    dune_static_assert(spaceDim==2 || spaceDim==3, 
+                       "You can only instantiate the class RodAssembler for 2d and 3d spaces");
+};
+
+/** \brief The FEM operator for an extensible, shearable rod in 3d
  */
 template <class GridView>
-class RodAssembler : public GeodesicFEAssembler<GridView, RigidBodyMotion<3> >
+class RodAssembler<GridView,3> : public GeodesicFEAssembler<GridView, RigidBodyMotion<3> >
 {
         
     //typedef typename GridType::template Codim<0>::Entity EntityType;
-- 
GitLab