Skip to content

Commit

Permalink
refactor(fourc_mc_tests): convert dat to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
gilrrei committed Feb 26, 2025
1 parent 06cf7c8 commit 9aa3d66
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 92 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
# Run the linter.
# Needs to placed before black, isort, and other formatters
- id: ruff
args: [ --fix ]
args: [--fix]
- repo: local
hooks:
- id: trailing-whitespace
Expand All @@ -27,7 +27,7 @@ repos:
- id: check-license-header
name: check for correct license header
entry: licenseheaders
args: ["-t", "license_header.tmpl", '--files']
args: ["-t", "license_header.tmpl", "--files"]
language: python
types: ["python"]
pass_filenames: true
Expand All @@ -40,7 +40,7 @@ repos:
- id: commitizen
name: commitizen
entry: cz
args: ['check', '--commit-msg-file', '.git/COMMIT_EDITMSG']
args: ["check", "--commit-msg-file", ".git/COMMIT_EDITMSG"]
pass_filenames: false
language: system
stages: [commit-msg, manual]
Expand All @@ -65,7 +65,7 @@ repos:
args:
- > # This is needed to lint the jinja templates
-d={extends: default, rules: {braces: {max-spaces-inside: 1}
, brackets: disable, document-start: disable}}
, brackets: disable, document-start: disable, "line-length": {"max": 100}}}
- -f=colored
language: python
types: ["yaml"]
Expand Down
83 changes: 83 additions & 0 deletions tests/input_files/third_party/fourc/solid_runtime_hex8.4C.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
TITLE: |
This is a simple test that tests the extrapolation of stressees from Gauss points to nodes for a
hex8 discretization tested date: 19.12.2024
PROBLEM TYPE:
PROBLEMTYPE: "Structure"
IO:
OUTPUT_SPRING: true
STRUCT_STRESS: "Cauchy"
STRUCT_STRAIN: "Yes"
VERBOSITY: "standard"
IO/RUNTIME VTK OUTPUT:
INTERVAL_STEPS: 1
OUTPUT_DATA_FORMAT: "ascii"
IO/RUNTIME VTK OUTPUT/STRUCTURE:
OUTPUT_STRUCTURE: true
DISPLACEMENT: true
STRESS_STRAIN: true
SOLVER 1:
SOLVER: "Superlu"
NAME: "Structure_Solver"
STRUCTURAL DYNAMIC:
INT_STRATEGY: "Standard"
DYNAMICTYPE: "Statics"
TIMESTEP: 0.5
NUMSTEP: 2
MAXTIME: 1
TOLDISP: 1e-09
TOLRES: 1e-09
LOADLIN: true
LINEAR_SOLVER: 1
STRUCT NOX/Printing:
Inner Iteration: false
Outer Iteration StatusTest: false
MATERIALS:
- MAT: 1
MAT_Struct_StVenantKirchhoff:
YOUNG: 100
NUE: 0
DENS: 0
FUNCT1:
- COMPONENT: 0
SYMBOLIC_FUNCTION_OF_SPACE_TIME: (1+{{ parameter_1 }}*y+{{ parameter_2 }}*z)*t
DESIGN SURF NEUMANN CONDITIONS:
- E: 2
NUMDOF: 6
ONOFF: [1, 0, 0, 0, 0, 0]
VAL: [10, 0, 0, 0, 0, 0]
FUNCT: [1, 0, 0, 0, 0, 0]
DESIGN SURF DIRICH CONDITIONS:
- E: 1
NUMDOF: 3
ONOFF: [1, 1, 1]
VAL: [0, 0, 0]
FUNCT: [0, 0, 0]
PROBLEM SIZE:
ELEMENTS: 2
NODES: 12
MATERIALS: 9999
DSURF-NODE TOPOLOGY:
- NODE 3 DSURFACE 1
- NODE 1 DSURFACE 1
- NODE 4 DSURFACE 1
- NODE 2 DSURFACE 1
- NODE 10 DSURFACE 2
- NODE 12 DSURFACE 2
- NODE 9 DSURFACE 2
- NODE 11 DSURFACE 2
NODE COORDS:
- NODE 1 COORD 0.0 0.0 0.0
- NODE 2 COORD 0.0 1.0 0.0
- NODE 3 COORD 0.0 0.0 1.0
- NODE 4 COORD 0.0 1.0 1.0
- NODE 5 COORD 1.0 0.0 0.0
- NODE 6 COORD 1.0 1.0 0.0
- NODE 7 COORD 1.0 0.0 1.0
- NODE 8 COORD 1.0 1.0 1.0
- NODE 9 COORD 2.0 0.0 0.0
- NODE 10 COORD 2.0 1.0 0.0
- NODE 11 COORD 2.0 0.0 1.0
- NODE 12 COORD 2.0 1.0 1.0
STRUCTURE ELEMENTS:
- 1 SOLID HEX8 1 5 6 2 3 7 8 4 MAT 1 KINEM nonlinear
- 2 SOLID HEX8 5 9 10 6 7 11 12 8 MAT 1 KINEM nonlinear
85 changes: 0 additions & 85 deletions tests/input_files/third_party/fourc/solid_runtime_hex8.dat

This file was deleted.

2 changes: 1 addition & 1 deletion tests/integration_tests/cluster/test_fourc_mc_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_fourc_mc_cluster(
fourc_example_expected_output (np.ndarray): Expected output for the MC samples
global_settings (GlobalSettings): object containing experiment name and tmp_path
"""
fourc_input_file_template = third_party_inputs / "fourc" / "solid_runtime_hex8.dat"
fourc_input_file_template = third_party_inputs / "fourc" / "solid_runtime_hex8.4C.yaml"

# Parameters
parameter_1 = UniformDistribution(lower_bound=0.0, upper_bound=1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_external_geometry_from_dat(
third_party_inputs, expected_node_coordinates, expected_surface_topology
):
"""Test if geometry is read in correctly from dat file."""
dat_input_template = third_party_inputs / "fourc" / "solid_runtime_hex8.dat"
dat_input_template = third_party_inputs / "fourc" / "solid_runtime_hex8.4C.yaml"

# Create pre-processing module form config
preprocessor_obj = FourcDatExternalGeometry(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/fourc/test_fourc_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_fourc_mc(
):
"""Test simple 4C run."""
# generate json input file from template
fourc_input_file_template = third_party_inputs / "fourc" / "solid_runtime_hex8.dat"
fourc_input_file_template = third_party_inputs / "fourc" / "solid_runtime_hex8.4C.yaml"
fourc_executable, _, _ = fourc_link_paths

# Parameters
Expand Down

0 comments on commit 9aa3d66

Please sign in to comment.