Skip to content

Commit

Permalink
Merge pull request #101 from isteinbrecher/update-tests-for-solid-she…
Browse files Browse the repository at this point in the history
…ll-direction

Update tests for solid shell direction detection
  • Loading branch information
isteinbrecher authored Sep 6, 2024
2 parents c20fb42 + 01a9552 commit bb8dc4b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/create_cubit_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,16 @@ def create_block(file_path):
def create_solid_shell_meshes(file_path_blocks, file_path_dome):
"""Create the meshes needed for the solid shell tests."""

def create_brick_mesh(dimensions, n_elements):
def create_brick_mesh(
dimensions, n_elements, *, element_type=cupy.element_type.hex8sh
):
"""Create a MeshPy mesh with a solid brick"""
cubit = CubitPy()
create_brick(
cubit,
*dimensions,
mesh_interval=n_elements,
element_type=cupy.element_type.hex8sh,
element_type=element_type,
mesh=True
)
mpy.import_mesh_full = True
Expand All @@ -274,11 +276,23 @@ def rotate_list(original_list, n):
"""Rotate the list"""
return original_list[-n:] + original_list[:-n]

# Add the plates in all directions (permute the dimension and number of elements
# in each direction)
for i in range(3):
brick = create_brick_mesh(rotate_list(dimensions, i), rotate_list(elements, i))
brick.translate([i * 4, 0, 0])
mesh.add(brick)

# Add a last plate with standard solid elements, to make sure that the algorithm
# skips those
brick = create_brick_mesh(
rotate_list(dimensions, 1),
rotate_list(elements, 1),
element_type=cupy.element_type.hex8,
)
brick.translate([3 * 4, 0, 0])
mesh.add(brick)

mesh.write_input_file(file_path_blocks, header=False)

# Create the dome input
Expand Down
22 changes: 22 additions & 0 deletions tests/reference-files/4C_input_solid_shell_thickness_blocks.dat
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ NODE 51 COORD 9 0 -0.05
NODE 52 COORD 9 0 0.05
NODE 53 COORD 9 2 -0.05
NODE 54 COORD 9 2 0.05
NODE 55 COORD 10 -0.05 1
NODE 56 COORD 10 -0.05 0
NODE 57 COORD 10 0.05 0
NODE 58 COORD 10 0.05 1
NODE 59 COORD 12 -0.05 1
NODE 60 COORD 12 -0.05 0
NODE 61 COORD 12 0.05 0
NODE 62 COORD 12 0.05 1
NODE 63 COORD 10 -0.05 -1
NODE 64 COORD 10 0.05 -1
NODE 65 COORD 12 -0.05 -1
NODE 66 COORD 12 0.05 -1
NODE 67 COORD 14 -0.05 1
NODE 68 COORD 14 -0.05 0
NODE 69 COORD 14 0.05 0
NODE 70 COORD 14 0.05 1
NODE 71 COORD 14 -0.05 -1
NODE 72 COORD 14 0.05 -1
--------------------------------------------------------------STRUCTURE ELEMENTS
1 SOLIDSH8 HEX8 1 2 3 4 5 6 7 8 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
2 SOLIDSH8 HEX8 2 9 10 3 6 11 12 7 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
Expand All @@ -66,4 +84,8 @@ NODE 54 COORD 9 2 0.05
10 SOLIDSH8 HEX8 40 39 45 46 44 43 47 48 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
11 SOLIDSH8 HEX8 41 42 43 44 49 50 51 52 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
12 SOLIDSH8 HEX8 44 43 47 48 52 51 53 54 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
13 SOLID HEX8 55 56 57 58 59 60 61 62 MAT 1 KINEM nonlinear
14 SOLID HEX8 56 63 64 57 60 65 66 61 MAT 1 KINEM nonlinear
15 SOLID HEX8 59 60 61 62 67 68 69 70 MAT 1 KINEM nonlinear
16 SOLID HEX8 60 65 66 61 68 71 72 69 MAT 1 KINEM nonlinear
-----------------------------------------------------------------------------END
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ NODE 51 COORD 9 0 -0.05
NODE 52 COORD 9 0 0.05
NODE 53 COORD 9 2 -0.05
NODE 54 COORD 9 2 0.05
NODE 55 COORD 10 -0.05 1
NODE 56 COORD 10 -0.05 0
NODE 57 COORD 10 0.05 0
NODE 58 COORD 10 0.05 1
NODE 59 COORD 12 -0.05 1
NODE 60 COORD 12 -0.05 0
NODE 61 COORD 12 0.05 0
NODE 62 COORD 12 0.05 1
NODE 63 COORD 10 -0.05 -1
NODE 64 COORD 10 0.05 -1
NODE 65 COORD 12 -0.05 -1
NODE 66 COORD 12 0.05 -1
NODE 67 COORD 14 -0.05 1
NODE 68 COORD 14 -0.05 0
NODE 69 COORD 14 0.05 0
NODE 70 COORD 14 0.05 1
NODE 71 COORD 14 -0.05 -1
NODE 72 COORD 14 0.05 -1
--------------------------------------------------------------STRUCTURE ELEMENTS
1 SOLIDSH8 HEX8 1 2 3 4 5 6 7 8 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
2 SOLIDSH8 HEX8 2 9 10 3 6 11 12 7 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
Expand All @@ -74,4 +92,8 @@ NODE 54 COORD 9 2 0.05
10 SOLIDSH8 HEX8 48 44 40 46 47 43 39 45 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
11 SOLIDSH8 HEX8 52 49 41 44 51 50 42 43 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
12 SOLIDSH8 HEX8 54 52 44 48 53 51 43 47 MAT 1 KINEM nonlinear EAS none ANS none THICKDIR auto
13 SOLID HEX8 55 56 57 58 59 60 61 62 MAT 1 KINEM nonlinear
14 SOLID HEX8 56 63 64 57 60 65 66 61 MAT 1 KINEM nonlinear
15 SOLID HEX8 59 60 61 62 67 68 69 70 MAT 1 KINEM nonlinear
16 SOLID HEX8 60 65 66 61 68 71 72 69 MAT 1 KINEM nonlinear
-----------------------------------------------------------------------------END

0 comments on commit bb8dc4b

Please sign in to comment.