From d229081db311056c0a63dc34cb2c5b005965caf3 Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@math.fu-berlin.de>
Date: Wed, 10 Oct 2018 10:52:18 +0200
Subject: [PATCH] Switch to Mooney Rivlin with Adol-C material

---
 nonlinelast.cc | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/nonlinelast.cc b/nonlinelast.cc
index d0ea39b..aa49f53 100644
--- a/nonlinelast.cc
+++ b/nonlinelast.cc
@@ -1,5 +1,6 @@
 #include <config.h>
 
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
 #include <dune/common/parametertreeparser.hh>
 #include <dune/common/bitsetvector.hh>
 
@@ -34,6 +35,8 @@
 #include <dune/elasticity/common/nonlinearelasticityproblem.hh>
 #define LAURSEN
 #include <dune/elasticity/materials/neohookeanmaterial.hh>
+#include <dune/elasticity/materials/adolcmaterial.hh>
+#include <dune/elasticity/materials/mooneyrivlinmaterial.hh>
 
 // The grid dimension
 const int dim = 3;
@@ -152,11 +155,17 @@ int main (int argc, char *argv[]) try
 
     typedef P1NodalBasis<GridType::LeafGridView> P1Basis;
     P1Basis p1Basis(grid->leafGridView());
-    typedef NeoHookeanMaterial<P1Basis> MaterialType;
+    //typedef NeoHookeanMaterial<P1Basis> MaterialType;
+    MooneyRivlinMaterial<P1Basis> localEnergy(p1Basis,
+                          parameterSet.get<double>("E"),
+                          parameterSet.get<double>("nu"));
+    using MaterialType = AdolcMaterial<P1Basis>;
+    MaterialType material(p1Basis, localEnergy, parameterSet.get<bool>("vectorMode"));
+   /*
     MaterialType material(p1Basis,
                           parameterSet.get<double>("E"),
                           parameterSet.get<double>("nu"));
-
+*/
 
     // ///////////////////////////////////////////////////
     //   Do a homotopy of the Dirichlet boundary data
@@ -291,9 +300,10 @@ int main (int argc, char *argv[]) try
         typedef P2NodalBasis<GridType::LeafGridView> P2Basis;
         P2Basis p2Basis(grid->leafGridView());
 
-        typedef NeoHookeanMaterial<P2Basis> MaterialTypeP2;
-        MaterialTypeP2 p2Material(p2Basis, parameterSet.get<field_type>("E"),
+        typedef MooneyRivlinMaterial<P2Basis> MaterialType2;
+        MaterialType2 p2localEnergy(p2Basis, parameterSet.get<field_type>("E"),
                                    parameterSet.get<field_type>("nu"));
+        AdolcMaterial<P2Basis> p2Material(p2Basis, p2localEnergy, false);
 
         // P2 Forces
         VectorType p2ExtForces(p2Basis.size());
-- 
GitLab