Skip to content

Commit

Permalink
Rename baci to 4C
Browse files Browse the repository at this point in the history
  • Loading branch information
isteinbrecher committed May 7, 2024
1 parent 1d78c2e commit e8eda96
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cubitpy/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions cubitpy/cubitpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])])
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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.
"""
Expand Down
8 changes: 4 additions & 4 deletions cubitpy/cubitpy_to_dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# -----------------------------------------------------------------------------
"""
Implements a function that converts a cubit session to a dat file that can be used
with BACI.
with 4C.
"""


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down
18 changes: 9 additions & 9 deletions cubitpy/cubitpy_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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.
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_block_function_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_create_block_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_groups_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_mesh_import_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_point_coupling_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_reset_block_1_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
2 changes: 1 addition & 1 deletion tests/input-files-ref/test_reset_block_2_pre_exodus.dat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==================================================================
General Data File BACI
General Data File 4C
==================================================================
-------------------------------------------------------------TITLE
created by pre_exodus
Expand Down
Loading

0 comments on commit e8eda96

Please sign in to comment.