From d596edec97808c62fc3820a59068a06972b0506e Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 19 Jan 2011 16:19:24 +0000
Subject: [PATCH] move the creation of the rod interface boundary out of the
 main loop

[[Imported from SVN: r6792]]
---
 dirneucoupling.cc | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/dirneucoupling.cc b/dirneucoupling.cc
index 740b029a..0139f280 100644
--- a/dirneucoupling.cc
+++ b/dirneucoupling.cc
@@ -332,6 +332,17 @@ int main (int argc, char *argv[]) try
         newTransferOp->setup(*complex.continuumGrids_["continuum"],i,i+1);
         multigridStep.mgTransfer_[i] = newTransferOp;
     }
+    
+    /////////////////////////////////////////////////////////////////////
+    //  Create the two interface boundary patches
+    /////////////////////////////////////////////////////////////////////
+
+    BitSetVector<1> rodCouplingBitfield(rodX.size(),false);
+    // Using that index 0 is always the left boundary for a uniformly refined OneDGrid
+    rodCouplingBitfield[0] = true;
+    LeafBoundaryPatch<RodGridType> rodCouplingBoundary(*complex.rodGrids_["rod"], rodCouplingBitfield);
+
+
 
     // /////////////////////////////////////////////////////
     //   Dirichlet-Neumann Solver
@@ -374,13 +385,8 @@ int main (int argc, char *argv[]) try
             //   Extract Neumann values and transfer it to the 3d object
             // ///////////////////////////////////////////////////////////
 
-            BitSetVector<1> couplingBitfield(rodX.size(),false);
-            // Using that index 0 is always the left boundary for a uniformly refined OneDGrid
-            couplingBitfield[0] = true;
-            LeafBoundaryPatch<RodGridType> couplingBoundary(*complex.rodGrids_["rod"], couplingBitfield);
-
             FieldVector<double,dim> resultantForce, resultantTorque;
-            resultantForce  = rodAssembler.getResultantForce(couplingBoundary, rodX, resultantTorque);
+            resultantForce  = rodAssembler.getResultantForce(rodCouplingBoundary, rodX, resultantTorque);
 
             // Flip orientation
             resultantForce  *= -1;
-- 
GitLab