From 70de0bd9ead769b441fad39a1da44d358e8c659c Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 27 Aug 2007 13:35:44 +0000
Subject: [PATCH] bugfix in getResultantForce: get index of correct
 cross-section orientation from the index set instead of having 0 hardwired
 here

[[Imported from SVN: r1594]]
---
 src/rodassembler.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/rodassembler.cc b/src/rodassembler.cc
index 7a2429cf..ae8634df 100644
--- a/src/rodassembler.cc
+++ b/src/rodassembler.cc
@@ -418,7 +418,7 @@ getLocalMatrix( EntityPointer &entity,
                     du_dvij[i][j][m] += 2 * ( q.B(m)*(q.mult(dq_dvij_ds[i][j]) + q_s.mult(tmp)));
                 }
 
-#if 0
+#if 1
                 for (int k=0; k<2; k++) {
 
                     for (int l=0; l<3; l++) {
@@ -1527,6 +1527,9 @@ getResultantForce(const BoundaryPatch<GridType>& boundary,
 {
     using namespace Dune;
 
+    if (grid_ != &boundary.getGrid())
+        DUNE_THROW(Dune::Exception, "The boundary patch has to match the grid of the assembler!");
+
     const typename GridType::Traits::LeafIndexSet& indexSet = grid_->leafIndexSet();
 
     if (sol.size()!=indexSet.size(gridDim))
@@ -1569,9 +1572,8 @@ getResultantForce(const BoundaryPatch<GridType>& boundary,
 
             // Transform stress given with respect to the basis given by the three directors to
             // the canonical basis of R^3
-            /** \todo Hardwired: Entry 0 is the leftmost entry! */
             FieldMatrix<double,3,3> orientationMatrix;
-            sol[0].q.matrix(orientationMatrix);
+            sol[indexSet.template subIndex<1>(*eIt,nIt.numberInSelf())].q.matrix(orientationMatrix);
             
             orientationMatrix.umv(localStress, canonicalStress);
             
-- 
GitLab