From 695f37d01b1353c62ba25c88df5b857a9cf9ebae Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Wed, 28 Jan 2015 12:38:43 +0000 Subject: [PATCH] Make the grid symmetric along the x-axis This is actually what is claimed in the paper. Previously, the mirror axis was y=0.005. Having the grid symmetric across the x-axis itself simplifies the expressions for the boundary conditions a little bit. [[Imported from SVN: r10029]] --- cosserat-continuum-twisted-strip.parset | 4 ++-- twisted-strip-dirichlet-values.py | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cosserat-continuum-twisted-strip.parset b/cosserat-continuum-twisted-strip.parset index 6accef9b..211626b5 100644 --- a/cosserat-continuum-twisted-strip.parset +++ b/cosserat-continuum-twisted-strip.parset @@ -3,8 +3,8 @@ ############################################# structuredGrid = true -lower = 0 0 -upper = 0.1 0.01 +lower = 0 -0.005 +upper = 0.1 0.005 elements = 10 1 # Number of grid levels diff --git a/twisted-strip-dirichlet-values.py b/twisted-strip-dirichlet-values.py index 6eb4f921..cef4f742 100644 --- a/twisted-strip-dirichlet-values.py +++ b/twisted-strip-dirichlet-values.py @@ -10,18 +10,12 @@ class DirichletValues: angle = self.totalAngle * x[0]/self.upper[0] angle *= self.homotopyParameter - # Center of rotation - center = [0, 0, 0] - center[1] = self.upper[1]/2.0 - + # Rotation matrix (around y-axis) rotation = [[1,0,0], [0, math.cos(angle), -math.sin(angle)], [0, math.sin(angle), math.cos(angle)]] - inEmbedded = [x[0]-center[0], x[1]-center[1], 0-center[2]] - - # Matrix-vector product - out = [rotation[0][0]*inEmbedded[0]+rotation[0][1]*inEmbedded[1], rotation[1][0]*inEmbedded[0]+rotation[1][1]*inEmbedded[1], rotation[2][0]*inEmbedded[0]+rotation[2][1]*inEmbedded[1]] + # Matrix-vector product, vector is [x[0], x[1], 0] + out = [rotation[0][0]*x[0]+rotation[0][1]*x[1], rotation[1][0]*x[0]+rotation[1][1]*x[1], rotation[2][0]*x[0]+rotation[2][1]*x[1]] - out = [out[0]+center[0], out[1]+center[1], out[2]+center[2]] return out -- GitLab