Skip to content
Snippets Groups Projects
Commit 695f37d0 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

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]]
parent 6318caa8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment