From 34b54a63ef86bc1345786b113df415fb59f8265e Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 11 Jul 2011 11:42:10 +0000
Subject: [PATCH] move the evaluation of the Dirichlet values into a separate
 method

[[Imported from SVN: r7544]]
---
 cosserat-continuum.cc | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc
index 8607c1e9..50d69330 100644
--- a/cosserat-continuum.cc
+++ b/cosserat-continuum.cc
@@ -40,6 +40,16 @@ const int blocksize = TargetSpace::TangentVector::size;
 using namespace Dune;
 
 
+void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& out)
+{
+    out = 0;
+    for (int i=0; i<dim; i++)
+        out[i] = in[i];
+    
+    out[0] = 2.2;
+}
+
+
 template <class HostGridView>
 class DeformationFunction
     : public Dune :: DiscreteCoordFunction< double, 3, DeformationFunction<HostGridView> >
@@ -189,7 +199,7 @@ int main (int argc, char *argv[]) try
         if (dirichletNodes[idx][0] and vIt->geometry().corner(0)[0] > upper[0]-1e-3) {
             
             // Only the positions have Dirichlet values
-            x[idx].r[0] = 1.5;
+            dirichletValues(vIt->geometry().corner(0), x[idx].r);
 
         }
 
-- 
GitLab