diff --git a/cosserat-continuum-twisted-strip.parset b/cosserat-continuum-twisted-strip.parset index 6accef9b1ac413e15fc749e15074a6622ec7b15e..211626b5bc436a3ef330fa6b0dfc3a99dea7b30e 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 6eb4f921c891fb7bf520c4fe0f2ba5c12530b4e2..cef4f74286cc522fb6282a76100c7e9144ec4585 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