-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testing for cubitpy created input files
- Loading branch information
1 parent
18ac4ce
commit cd4a7f8
Showing
10 changed files
with
137 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...4C_input_solid_shell_thickness_blocks.dat → ...create_cubit_input_solid_shell_blocks.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s/4C_input_solid_shell_thickness_dome.dat → ...t_create_cubit_input_solid_shell_dome.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# MeshPy: A beam finite element input generator | ||
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2018-2025 | ||
# Ivo Steinbrecher | ||
# Institute for Mathematics and Computer-Based Simulation | ||
# Universitaet der Bundeswehr Muenchen | ||
# https://www.unibw.de/imcs-en | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
"""Test that the input files created with CubitPy are up to date.""" | ||
|
||
import pytest | ||
|
||
from .create_cubit_input import ( | ||
create_block, | ||
create_solid_shell_meshes, | ||
create_tube, | ||
create_tube_tutorial, | ||
) | ||
|
||
|
||
@pytest.mark.cubitpy | ||
def test_create_cubit_input_tube( | ||
tmp_path, | ||
current_test_name, | ||
get_corresponding_reference_file_path, | ||
assert_results_equal, | ||
): | ||
"""Test that the solid tube reference file is up to date.""" | ||
|
||
file_path = tmp_path / (current_test_name + ".dat") | ||
create_tube(file_path) | ||
assert_results_equal(file_path, get_corresponding_reference_file_path()) | ||
|
||
|
||
@pytest.mark.cubitpy | ||
def test_create_cubit_input_tutorial( | ||
tmp_path, | ||
reference_file_directory, | ||
assert_results_equal, | ||
): | ||
"""Test the creation of the solid input file for the tutorial.""" | ||
|
||
# Create the tube for the tutorial. | ||
result_path = tmp_path / "tutorial.dat" | ||
create_tube_tutorial(result_path) | ||
|
||
tutorial_path = ( | ||
reference_file_directory.parents[1] / "tutorial" / "4C_input_solid_tutorial.dat" | ||
) | ||
assert_results_equal(tutorial_path, result_path) | ||
|
||
|
||
@pytest.mark.cubitpy | ||
def test_create_cubit_input_block( | ||
tmp_path, | ||
current_test_name, | ||
get_corresponding_reference_file_path, | ||
assert_results_equal, | ||
): | ||
"""Test that the solid block reference file is up to date.""" | ||
|
||
file_path = tmp_path / (current_test_name + ".dat") | ||
create_block(file_path) | ||
assert_results_equal(file_path, get_corresponding_reference_file_path()) | ||
|
||
|
||
@pytest.mark.cubitpy | ||
def test_create_cubit_input_solid_shell( | ||
tmp_path, | ||
current_test_name, | ||
get_corresponding_reference_file_path, | ||
assert_results_equal, | ||
): | ||
"""Test that the solid shell reference files are up to date.""" | ||
|
||
file_path_blocks = tmp_path / (current_test_name + "_blocks.dat") | ||
file_path_dome = tmp_path / (current_test_name + "_dome.dat") | ||
create_solid_shell_meshes(file_path_blocks, file_path_dome) | ||
assert_results_equal( | ||
file_path_blocks, | ||
get_corresponding_reference_file_path(additional_identifier="blocks"), | ||
) | ||
assert_results_equal( | ||
file_path_dome, | ||
get_corresponding_reference_file_path(additional_identifier="dome"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters