diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d8e45ac..db638db 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: name: cubitpy-testing runs-on: self-hosted env: - BACI_PRE_EXODUS: /home_local/github-runner/testing_lib/baci_master/release/pre_exodus + FOUR_C_PRE_EXODUS: /home_local/github-runner/testing_lib/four_c_master/release/pre_exodus CUBIT_ROOT: /imcs/public/compsim/opt/cubit-15.2 PYTHON_VENV: python-testing-environment SPACK_ACTIVATION_SCRIPT: /home_local/github-runner/testing_lib/spack/share/spack/setup-env.sh diff --git a/README.md b/README.md index 4f5e36c..de0927c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Cubitpy -Cubit features and utilities functions, especially for the creation of input files for BACI. +Cubit features and utilities functions, especially for the creation of input files for 4C. It is tested with Cubit15.2. ## Usage @@ -55,9 +55,9 @@ To run CubitPy it is required to set an environment variable with the path to th export CUBIT_ROOT=path_to_cubit_root_directory ``` -(Optional) Per default CubitPy creates the BACI input file itself and does not rely `pre_exodus`. However, if for some reason `pre_exodus` shall be used, the path to the executable has to be set +(Optional) Per default CubitPy creates the 4C input file itself and does not rely `pre_exodus`. However, if for some reason `pre_exodus` shall be used, the path to the executable has to be set ```bash -export BACI_PRE_EXODUS=path_to_pre-exodus +export FOUR_C_PRE_EXODUS=path_to_four_c_pre-exodus ``` To check if everything worked as expected, run the tests from within the `tests` directory diff --git a/cubitpy/conf.py b/cubitpy/conf.py index 35eed28..09a96fe 100644 --- a/cubitpy/conf.py +++ b/cubitpy/conf.py @@ -94,7 +94,7 @@ def __init__(self): @staticmethod def get_pre_exodus_path(**kwargs): - return get_path("BACI_PRE_EXODUS", os.path.isfile, **kwargs) + return get_path("FOUR_C_PRE_EXODUS", os.path.isfile, **kwargs) @staticmethod def get_cubit_root_path(**kwargs): diff --git a/cubitpy/cubitpy.py b/cubitpy/cubitpy.py index a245004..8eeb37d 100644 --- a/cubitpy/cubitpy.py +++ b/cubitpy/cubitpy.py @@ -57,7 +57,7 @@ def __init__(self, *, cubit_exe=None, pre_exodus=None, **kwargs): cubit_exe: str Path to the cubit executable pre_exodus: str - Path to the pre_exodus pre-processor of BACI + Path to the pre_exodus pre-processor of 4C kwargs: Arguments passed on to the creation of the python wrapper @@ -210,7 +210,7 @@ def add_element_type( # If the user does not give a bc_description, load the default one. if bc_description is None: - bc_description = el_type.get_default_baci_description() + bc_description = el_type.get_default_four_c_description() # Add data that will be written to bc file. self.blocks.append([el_type, " ".join([material, bc_description])]) @@ -365,9 +365,9 @@ def write_head_bc(self, head_path, bc_path): bc_file.write( '*eb{}="ELEMENT"\nsectionname="{}"\ndescription="{}"\nelementname="{}"\n\n'.format( i + 1, - el_type.get_baci_section(), + el_type.get_four_c_section(), block_string, - el_type.get_baci_name(), + el_type.get_four_c_name(), ) ) for i, node_set in enumerate(self.node_sets): @@ -421,7 +421,7 @@ def get_dat_lines(self, pre_exodus=False): def _create_dat(self): """ - This function creates a finished baci input *.dat file. First the mesh, + This function creates a finished 4C input *.dat file. First the mesh, head and bc files are written to a temp directory and then pre_exodus is called to create the *.dat file. """ diff --git a/cubitpy/cubitpy_to_dat.py b/cubitpy/cubitpy_to_dat.py index 50cbee7..de3a0a0 100644 --- a/cubitpy/cubitpy_to_dat.py +++ b/cubitpy/cubitpy_to_dat.py @@ -30,7 +30,7 @@ # ----------------------------------------------------------------------------- """ Implements a function that converts a cubit session to a dat file that can be used -with BACI. +with 4C. """ @@ -126,7 +126,7 @@ def add_node_sets(dat_lines, cubit, exo): def cubit_to_dat(cubit): - """Convert a CubitPy session to a dat file that can be read with BACI""" + """Convert a CubitPy session to a dat file that can be read with 4C""" # Create exodus file os.makedirs(cupy.temp_dir, exist_ok=True) @@ -167,7 +167,7 @@ def cubit_to_dat(cubit): i_element = 0 for i_block, key in enumerate(connectivity_keys): ele_type, block_string = cubit.blocks[i_block] - block_section = ele_type.get_baci_section() + block_section = ele_type.get_four_c_section() if not block_section == current_section: current_section = block_section dat_lines.append( @@ -176,7 +176,7 @@ def cubit_to_dat(cubit): for connectivity in exo.variables[key][:]: connectivity_string = " ".join([f"{item:d}" for item in connectivity]) dat_lines.append( - f"{i_element+1:9d} {ele_type.get_baci_name()} {ele_type.get_baci_type()} {connectivity_string} {block_string}" + f"{i_element+1:9d} {ele_type.get_four_c_name()} {ele_type.get_four_c_type()} {connectivity_string} {block_string}" ) i_element += 1 diff --git a/cubitpy/cubitpy_types.py b/cubitpy/cubitpy_types.py index 2275c62..d10436c 100644 --- a/cubitpy/cubitpy_types.py +++ b/cubitpy/cubitpy_types.py @@ -30,7 +30,7 @@ # ----------------------------------------------------------------------------- """ This module contains ENums for types used in cubitpy as well as functions to -convert them to strings for cubit or baci commands or the wrapper. +convert them to strings for cubit or 4C commands or the wrapper. """ # Python imports. @@ -172,8 +172,8 @@ def get_cubit_names(self): return cubit_scheme, cubit_element_type - def get_baci_name(self): - """Get the name of this element in baci.""" + def get_four_c_name(self): + """Get the name of this element in 4C.""" # Get the element type parameters. if self == self.hex8: @@ -203,8 +203,8 @@ def get_baci_name(self): else: raise ValueError("Got wrong element type {}!".format(self)) - def get_baci_section(self): - """Get the correct section name of this element in baci.""" + def get_four_c_section(self): + """Get the correct section name of this element in 4C.""" if self == self.hex8_fluid: return "FLUID" @@ -228,8 +228,8 @@ def get_baci_section(self): else: raise ValueError("Got wrong element type {}!".format(self)) - def get_baci_type(self): - """Get the correct element shape name of this element in baci.""" + def get_four_c_type(self): + """Get the correct element shape name of this element in 4C.""" if ( self == self.hex8 @@ -251,9 +251,9 @@ def get_baci_type(self): else: raise ValueError("Got wrong element type {}!".format(self)) - def get_default_baci_description(self): + def get_default_four_c_description(self): """ - Get the default text for the description in baci after the material + Get the default text for the description in 4C after the material string. """ diff --git a/tests/input-files-ref/test_block_function_pre_exodus.dat b/tests/input-files-ref/test_block_function_pre_exodus.dat index fd139d6..7edc545 100644 --- a/tests/input-files-ref/test_block_function_pre_exodus.dat +++ b/tests/input-files-ref/test_block_function_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_contact_condition_beam_to_surface_pre_exodus.dat b/tests/input-files-ref/test_contact_condition_beam_to_surface_pre_exodus.dat index c0d50d4..19f7743 100644 --- a/tests/input-files-ref/test_contact_condition_beam_to_surface_pre_exodus.dat +++ b/tests/input-files-ref/test_contact_condition_beam_to_surface_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_contact_condition_surface_to_surface_pre_exodus.dat b/tests/input-files-ref/test_contact_condition_surface_to_surface_pre_exodus.dat index c568e9c..5e83219 100644 --- a/tests/input-files-ref/test_contact_condition_surface_to_surface_pre_exodus.dat +++ b/tests/input-files-ref/test_contact_condition_surface_to_surface_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_create_block_pre_exodus.dat b/tests/input-files-ref/test_create_block_pre_exodus.dat index 4b6c30e..b431ce7 100644 --- a/tests/input-files-ref/test_create_block_pre_exodus.dat +++ b/tests/input-files-ref/test_create_block_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_hex_new_pre_exodus.dat b/tests/input-files-ref/test_element_types_hex_new_pre_exodus.dat index 12d6fd3..a58df5d 100644 --- a/tests/input-files-ref/test_element_types_hex_new_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_hex_new_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_hex_pre_exodus.dat b/tests/input-files-ref/test_element_types_hex_pre_exodus.dat index 023f93a..c086351 100644 --- a/tests/input-files-ref/test_element_types_hex_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_hex_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_quad_y_plane_pre_exodus.dat b/tests/input-files-ref/test_element_types_quad_y_plane_pre_exodus.dat index c2d6191..1ae4b49 100644 --- a/tests/input-files-ref/test_element_types_quad_y_plane_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_quad_y_plane_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_quad_z_plane_pre_exodus.dat b/tests/input-files-ref/test_element_types_quad_z_plane_pre_exodus.dat index bad6c41..3e9f389 100644 --- a/tests/input-files-ref/test_element_types_quad_z_plane_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_quad_z_plane_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_tet_new_pre_exodus.dat b/tests/input-files-ref/test_element_types_tet_new_pre_exodus.dat index 8617e1e..e6989fe 100644 --- a/tests/input-files-ref/test_element_types_tet_new_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_tet_new_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_element_types_tet_pre_exodus.dat b/tests/input-files-ref/test_element_types_tet_pre_exodus.dat index b5b33f6..a6b270e 100644 --- a/tests/input-files-ref/test_element_types_tet_pre_exodus.dat +++ b/tests/input-files-ref/test_element_types_tet_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_extrude_mesh_function_pre_exodus.dat b/tests/input-files-ref/test_extrude_mesh_function_pre_exodus.dat index d142cd4..304e6e1 100644 --- a/tests/input-files-ref/test_extrude_mesh_function_pre_exodus.dat +++ b/tests/input-files-ref/test_extrude_mesh_function_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_fsi_functionality_pre_exodus.dat b/tests/input-files-ref/test_fsi_functionality_pre_exodus.dat index 60db2ef..8954885 100644 --- a/tests/input-files-ref/test_fsi_functionality_pre_exodus.dat +++ b/tests/input-files-ref/test_fsi_functionality_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_group_of_surfaces_pre_exodus.dat b/tests/input-files-ref/test_group_of_surfaces_pre_exodus.dat index d95a80e..48c6390 100644 --- a/tests/input-files-ref/test_group_of_surfaces_pre_exodus.dat +++ b/tests/input-files-ref/test_group_of_surfaces_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_groups_multiple_sets_pre_exodus.dat b/tests/input-files-ref/test_groups_multiple_sets_pre_exodus.dat index 1396761..b807b59 100644 --- a/tests/input-files-ref/test_groups_multiple_sets_pre_exodus.dat +++ b/tests/input-files-ref/test_groups_multiple_sets_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_groups_pre_exodus.dat b/tests/input-files-ref/test_groups_pre_exodus.dat index 69af304..faa8370 100644 --- a/tests/input-files-ref/test_groups_pre_exodus.dat +++ b/tests/input-files-ref/test_groups_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_mesh_import_pre_exodus.dat b/tests/input-files-ref/test_mesh_import_pre_exodus.dat index 5d0de46..c5b1536 100644 --- a/tests/input-files-ref/test_mesh_import_pre_exodus.dat +++ b/tests/input-files-ref/test_mesh_import_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_node_set_geometry_type_pre_exodus.dat b/tests/input-files-ref/test_node_set_geometry_type_pre_exodus.dat index e642629..a1de482 100644 --- a/tests/input-files-ref/test_node_set_geometry_type_pre_exodus.dat +++ b/tests/input-files-ref/test_node_set_geometry_type_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_point_coupling_pre_exodus.dat b/tests/input-files-ref/test_point_coupling_pre_exodus.dat index 20938f8..e6fccae 100644 --- a/tests/input-files-ref/test_point_coupling_pre_exodus.dat +++ b/tests/input-files-ref/test_point_coupling_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_reset_block_1_pre_exodus.dat b/tests/input-files-ref/test_reset_block_1_pre_exodus.dat index 7d092ec..48945c9 100644 --- a/tests/input-files-ref/test_reset_block_1_pre_exodus.dat +++ b/tests/input-files-ref/test_reset_block_1_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_reset_block_2_pre_exodus.dat b/tests/input-files-ref/test_reset_block_2_pre_exodus.dat index b86d078..7a29a7d 100644 --- a/tests/input-files-ref/test_reset_block_2_pre_exodus.dat +++ b/tests/input-files-ref/test_reset_block_2_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/input-files-ref/test_serialize_nested_lists_pre_exodus.dat b/tests/input-files-ref/test_serialize_nested_lists_pre_exodus.dat index 3c99938..53188ad 100644 --- a/tests/input-files-ref/test_serialize_nested_lists_pre_exodus.dat +++ b/tests/input-files-ref/test_serialize_nested_lists_pre_exodus.dat @@ -1,5 +1,5 @@ ================================================================== - General Data File BACI + General Data File 4C ================================================================== -------------------------------------------------------------TITLE created by pre_exodus diff --git a/tests/testing.py b/tests/testing.py index 6bcbe35..ba79dc7 100644 --- a/tests/testing.py +++ b/tests/testing.py @@ -257,7 +257,7 @@ def create_block(cubit, np_arrays=False, **kwargs): bc_description="NUMDOF 6 ONOFF 1 1 1 0 0 0 VAL 0.0 0.0 0.0 0.0 0.0 0.0 FUNCT 0 0 0 0 0 0", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name="test_create_block", **kwargs) @@ -345,7 +345,7 @@ def create_element_types_tet(cubit, element_type_list, name, **kwargs): DISPLACEMENT Yes """ - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name=name, single_precision=True, **kwargs) @@ -429,7 +429,7 @@ def add_arc(radius, angle): DISPLACEMENT Yes """ - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name=name, single_precision=True, **kwargs) @@ -570,7 +570,7 @@ def test_block_function(kwargs): cube.volumes()[0].mesh() count += 1 - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, single_precision=True, **kwargs) @@ -618,7 +618,7 @@ def test_extrude_mesh_function(kwargs): # Set the mesh for output. cubit.add_element_type(volume, cupy.element_type.hex8) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, single_precision=False, **kwargs) @@ -697,7 +697,7 @@ def test_node_set_geometry_type(kwargs): ----------------------------------------------------------MATERIALS MAT 1 MAT_Struct_StVenantKirchhoff YOUNG 10 NUE 0.0 DENS 0.0""" - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, **kwargs) @@ -718,7 +718,7 @@ def test_contact_condition_beam_to_surface(kwargs): bc_description="COUPLING_ID 1", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, **kwargs) @@ -745,7 +745,7 @@ def test_contact_condition_surface_to_surface(kwargs): bc_description="0 Slave", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, **kwargs) @@ -787,7 +787,7 @@ def test_fsi_functionality(kwargs): bc_description="NUMDOF 3 ONOFF 1 1 1 VAL 0 0 0 FUNCT 0 0 0", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, **kwargs) @@ -843,7 +843,7 @@ def test_point_coupling(kwargs): bc_description="NUMDOF 3 ONOFF 1 2 3", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, **kwargs) @@ -894,7 +894,7 @@ def test_group_of_surfaces(kwargs): bc_description="KINEM linear EAS none THICK 1.0 STRESS_STRAIN plane_strain GP 3 3", ) - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name="test_group_of_surfaces", **kwargs) @@ -1012,7 +1012,7 @@ def xtest_groups(block_with_volume, **kwargs): ----------------------------------------------------------MATERIALS MAT 1 MAT_Struct_StVenantKirchhoff YOUNG 10 NUE 0.0 DENS 0.0""" - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name="test_groups", **kwargs) @@ -1066,7 +1066,7 @@ def xtest_groups_multiple_sets_get_by( ----------------------------------------------------------MATERIALS MAT 1 MAT_Struct_StVenantKirchhoff YOUNG 10 NUE 0.0 DENS 0.0""" - # Compare the input file created for baci. + # Compare the input file created for 4C. compare(cubit, name="test_groups_multiple_sets", **kwargs) diff --git a/tutorial/tutorial.py b/tutorial/tutorial.py index fb37072..562f133 100644 --- a/tutorial/tutorial.py +++ b/tutorial/tutorial.py @@ -51,7 +51,7 @@ def cubit_step_by_step_tutorial_cli(input_file_path, *, display=True): # The first step is to setup a CubitPy object. This object is derived from the # cubit python interface and provides all functionality of the direct cubit # python interface and also adds some additional functionality to make the - # creation of BACI input files easier. + # creation of 4C input files easier. cubit = CubitPy() # Once the CubitPy object is initialized, we can create our first brick