Skip to content
Snippets Groups Projects
Commit 3cd89c41 authored by René Heß's avatar René Heß
Browse files

[skip ci] Use a real unstructured grid for the test

Instead of generating gmsh files for a structured grid we use a real
unstructured grid.
parent 2836c23d
No related branches found
No related tags found
No related merge requests found
Showing
with 39 additions and 13 deletions
......@@ -20,7 +20,7 @@ c1_5 = [3,6,12,9,2,5,11,8]
c0s = [c0_0, c0_1, c0_2, c0_3, c0_4, c0_5]
c1s = [c1_0, c1_1, c1_2, c1_3, c1_4, c1_5]
begin = """$MeshFormat
begin_structured = """$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
......@@ -41,20 +41,46 @@ $EndNodes
$Elements
2
"""
begin_transformed = """$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
12
1 0.5 0 0
2 1 1 1
3 1.5 2 2
4 0 1 0
5 0.5 2 1
6 1 3 2
7 0 -1 1
8 0.5 0 2
9 1 1 3
10 -0.5 0 1
11 0 1 2
12 0.5 2 3
$EndNodes
$Elements
2
"""
end = """
$EndElements
"""
filenames = ("grid_structured", "grid_transformed")
begins = (begin_structured, begin_transformed)
from itertools import product
for i, c in enumerate(product(c0s, c1s)):
with open('grid_{}.msh'.format(str(i).zfill(2)), 'w+') as f:
f.write(begin)
f.write('1 5 0')
for a in c[0]:
f.write(' {}'.format(a))
f.write('\n')
f.write('2 5 0')
for a in c[1]:
f.write(' {}'.format(a))
f.write(end)
for name, begin in zip(filenames, begins):
for i, c in enumerate(product(c0s, c1s)):
with open('{}_{}.msh'.format(name, str(i).zfill(2)), 'w+') as f:
f.write(begin)
f.write('1 5 0')
for a in c[0]:
f.write(' {}'.format(a))
f.write('\n')
f.write('2 5 0')
for a in c[1]:
f.write(' {}'.format(a))
f.write(end)
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