From 3177893ec3de88a3ecc8d66bf913bb492c62d746 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 22 Aug 2014 09:37:42 +0000
Subject: [PATCH] Compute Cosserat strain given only the gradient of the
 deformation, and the rotation

[[Imported from SVN: r9847]]
---
 dune/gfe/cosseratstrain.hh | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/dune/gfe/cosseratstrain.hh b/dune/gfe/cosseratstrain.hh
index cc72745d..f69141f1 100644
--- a/dune/gfe/cosseratstrain.hh
+++ b/dune/gfe/cosseratstrain.hh
@@ -54,6 +54,38 @@ namespace Dune {
 
       }
 
+      /** \brief Compute strain from the deformation gradient and the microrotation
+       *
+       * \param R The microrotation
+       */
+      CosseratStrain(const FieldMatrix<T,dimworld,dim>& deformationGradient,
+                     const FieldMatrix<T,dimworld,dimworld>& R)
+      {
+        /* Compute F, the deformation gradient.
+           In the continuum case (domain dimension == world dimension) this is
+           \f$ \hat{F} = \nabla m  \f$
+           In the case of a shell it is
+          \f$ \hat{F} = (\nabla m | \overline{R}_3) \f$
+        */
+        FieldMatrix<T,dimworld,dimworld> F;
+        for (int i=0; i<dimworld; i++)
+            for (int j=0; j<dim; j++)
+                F[i][j] = deformationGradient[i][j];
+
+        for (int i=0; i<dimworld; i++)
+            for (int j=dim; j<dimworld; j++)
+                F[i][j] = R[i][j];
+
+        // U = R^T F
+        for (int i=0; i<dimworld; i++)
+            for (int j=0; j<dimworld; j++) {
+                data_[i][j] = 0;
+                for (int k=0; k<dimworld; k++)
+                    data_[i][j] += R[k][i] * F[k][j];
+            }
+
+      }
+
       T determinant() const
       {
         return data_.determinant();
-- 
GitLab