From 1241308efeccd345c1fefac9c3dd7120fdf08216 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Tue, 20 Dec 2011 15:02:53 +0000
Subject: [PATCH] testsuite to measure locking effects of Cosserat shell models

[[Imported from SVN: r8310]]
---
 locking_testsuite/cosserat-continuum.parset | 79 +++++++++++++++++++++
 locking_testsuite/deflection.plt            | 18 +++++
 locking_testsuite/testsuite.sh              | 70 ++++++++++++++++++
 3 files changed, 167 insertions(+)
 create mode 100644 locking_testsuite/cosserat-continuum.parset
 create mode 100644 locking_testsuite/deflection.plt
 create mode 100755 locking_testsuite/testsuite.sh

diff --git a/locking_testsuite/cosserat-continuum.parset b/locking_testsuite/cosserat-continuum.parset
new file mode 100644
index 00000000..a90cec4b
--- /dev/null
+++ b/locking_testsuite/cosserat-continuum.parset
@@ -0,0 +1,79 @@
+# Number of grid levels
+numLevels = 2
+
+# Number of homotopy steps for the Dirichlet boundary conditions
+numHomotopySteps = 1
+
+# Tolerance of the trust region solver
+tolerance = 1e-8
+
+# Max number of steps of the trust region solver
+maxTrustRegionSteps = 3000
+
+# Initial trust-region radius
+initialTrustRegionRadius = 1
+
+# Number of multigrid iterations per trust-region step
+numIt = 200
+
+# Number of presmoothing steps
+nu1 = 3
+
+# Number of postsmoothing steps
+nu2 = 3
+
+# Number of coarse grid corrections
+mu = 1
+
+# Number of base solver iterations
+baseIt = 100
+
+# Tolerance of the multigrid solver
+mgTolerance = 1e-7
+
+# Tolerance of the base grid solver
+baseTolerance = 1e-8
+
+# Measure convergence
+instrumented = 0
+
+############################
+#   Problem specifications
+############################
+
+[materialParameters]
+
+# shell thickness
+thickness = 0.05
+
+# Lame parameters
+# corresponds to E = 1e6, nu=0.3
+mu = 3.8462e+05
+lambda = 2.7149e+05
+#mu = 1
+#lambda = 1
+
+# Cosserat couple modulus
+mu_c = 0
+#mu_c = 3.8462e+05
+
+
+# Length scale parameter
+#L_c = 0.05
+L_c = 0.1
+
+# Curvature exponent
+q = 2
+
+# Shear correction factor
+kappa = 0.1
+
+[]
+
+# 2d problem
+#path = /home/haile/sander/data/richards/twosquares/
+#gridFile = twosquares0.grid
+
+# 3d problem
+path = /home/haile/sander/data/contact/tetracubes/
+gridFile = tetracube0.grid
diff --git a/locking_testsuite/deflection.plt b/locking_testsuite/deflection.plt
new file mode 100644
index 00000000..4e0ed8f2
--- /dev/null
+++ b/locking_testsuite/deflection.plt
@@ -0,0 +1,18 @@
+set xlabel 'Refinement'
+set ylabel 'Deflection'
+
+#set terminal postscript eps color "Arial,20" linewidth 6
+set terminal pdf color linewidth 6  
+
+set title 'Deflection of a cantilever beam'
+set output "cantilever_deflection.pdf"
+
+plot  'average_deflection_3.8462e+05' using 1:4 with lines title "mu_c = mu",  \
+      'average_deflection_0' using 1:4 with lines title "mu_c = 0"
+
+set title 'Lateral deflection of a cantilever beam'
+set output "cantilever_lateral_deflection.pdf"
+
+plot  'average_deflection_3.8462e+05' using 1:3 with lines title "mu_c = mu",  \
+      'average_deflection_0' using 1:3 with lines title "mu_c = 0"
+
diff --git a/locking_testsuite/testsuite.sh b/locking_testsuite/testsuite.sh
new file mode 100755
index 00000000..c645ea0c
--- /dev/null
+++ b/locking_testsuite/testsuite.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+set -e
+
+runComputation(){
+
+numLevels=$1
+mu_c=$2
+kappa=$3
+
+#RESULTPATH=`pwd`/richards_surfacewater_results_${leakage}_${richardsonDamping}/
+#LOGFILE=${RESULTPATH}/"richards_${mu_c}_${numLevels}.log"
+LOGFILE="./cosserat_continuum_${mu_c}_${numLevels}_${kappa}.log"
+
+#echo $RESULTPATH
+
+# Set up directory where to store the results
+# if ! test -d "$RESULTPATH"; then
+#     mkdir $RESULTPATH
+# fi
+#rm $RESULTPATH/*
+
+#################################################
+#  Make directories for the iterates
+#################################################
+# for i in $(eval echo "{0..$LASTTIMESTEP}"); do
+#     ITERATESDIRNAME=${RESULTPATH}/iterates_$i
+#     if ! test -d ${ITERATESDIRNAME}; then
+#         mkdir ${ITERATESDIRNAME}
+#     fi
+# done
+
+#################################################
+#  run the actual simulation
+#################################################
+
+../cosserat-continuum -numLevels ${numLevels} -materialParameters.mu_c ${mu_c} -materialParameters.kappa ${kappa} | tee ${LOGFILE}
+
+
+#################################################
+#  Delete the directories for the iterates.
+#  If we let the stay they eat up to much memory
+#################################################
+
+}
+
+
+MAXPROCS=4
+
+
+for numLevels in 1 2 3 4 5; do
+
+    #for mu_c in 3.8462e+05 0; do
+    mu_c=0
+
+    for kappa in 1 0.1 0.01; do     
+ 
+    # Do one simulation run
+      runComputation $numLevels $mu_c $kappa &
+
+      # Never have more than MAXPROCS processes
+      NPROC=$(($NPROC+1))  
+      if [ "$NPROC" -ge "$MAXPROCS" ]; then  
+          wait  
+          NPROC=0  
+      fi  
+      
+    done
+
+done
-- 
GitLab