From 2f61206c0c6e8e40d2a530daded2670cf2a355a5 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 11 Jul 2011 12:05:22 +0000
Subject: [PATCH] new Dirichlet value function that induces a torsion

[[Imported from SVN: r7545]]
---
 cosserat-continuum.cc | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc
index 50d69330..8858148f 100644
--- a/cosserat-continuum.cc
+++ b/cosserat-continuum.cc
@@ -39,7 +39,7 @@ const int blocksize = TargetSpace::TangentVector::size;
 
 using namespace Dune;
 
-
+#if 0
 void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& out)
 {
     out = 0;
@@ -48,7 +48,29 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
     
     out[0] = 2.2;
 }
-
+#endif
+void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& out)
+{
+    double angle = M_PI/4;
+    FieldVector<double,3> center(0);
+    center[1] = 0.5;
+    
+    FieldMatrix<double,3,3> rotation(0);
+    rotation[0][0] = 1;
+    rotation[1][1] =  std::cos(angle);
+    rotation[1][2] = -std::sin(angle);
+    rotation[2][1] =  std::sin(angle);
+    rotation[2][2] =  std::cos(angle);
+
+    FieldVector<double,3> inEmbedded(0);
+    for (int i=0; i<dim; i++)
+        inEmbedded[i] = in[i];
+    inEmbedded -= center;
+    
+    rotation.mv(inEmbedded, out);
+    
+    out += center;
+}
 
 template <class HostGridView>
 class DeformationFunction
-- 
GitLab