Skip to content

Commit

Permalink
Merge pull request #139 from maxdinkel/fix-4C-tests
Browse files Browse the repository at this point in the history
fix: 4C input DAMPING parameter
  • Loading branch information
maxdinkel authored Feb 25, 2025
2 parents 9e87456 + c98d595 commit 06cf7c8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DIM 3
-----------------------------------------------------DISCRETISATION
NUMSTRUCDIS 1
--------------------------------------------------------PROBLEM TYPE
PROBLEMTYPE Structure
PROBLEMTYPE Structure
RESTART 0
SHAPEFCT Polynomial
-----------------------------------------------------------------IO
Expand All @@ -30,7 +30,7 @@ NLNSOL fullnewton
TIMESTEP 0.025
NUMSTEP 40
MAXTIME 1.0
DAMPING no
DAMPING None
M_DAMP 0.001
K_DAMP 0.001
PREDICT ConstDisVelAcc
Expand Down
2 changes: 1 addition & 1 deletion tests/input_files/third_party/fourc/solid_runtime_hex8.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hex8 discretization

tested date: 19.12.2024
-------------------------------------------------------------------PROBLEM TYPE
PROBLEMTYPE Structure
PROBLEMTYPE Structure
----------------------------------------------------------------------------IO
OUTPUT_BIN yes
STRUCT_DISP yes
Expand Down
14 changes: 6 additions & 8 deletions tests/integration_tests/fourc/test_fourc_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,22 @@ def test_fourc_mc(
global_settings=global_settings,
)

# Actual analysis
run_iterator(iterator, global_settings=global_settings)
try:
# Actual analysis
run_iterator(iterator, global_settings=global_settings)

# Load results
results = load_result(global_settings.result_file(".pickle"))
# Load results
results = load_result(global_settings.result_file(".pickle"))

try:
# assert statements
np.testing.assert_array_almost_equal(
results["raw_output_data"]["result"], fourc_example_expected_output, decimal=6
)
except (AssertionError, KeyError) as error:
except Exception as error:
experiment_dir = experiment_directory(global_settings.experiment_name)
job_dir = experiment_dir / "0"
_logger.info(list(job_dir.iterdir()))
output_dir = job_dir / "output"
_logger.info(list(output_dir.iterdir()))

_logger.info(read_file(output_dir / "test_fourc_mc_0.err"))
_logger.info(read_file(output_dir / "test_fourc_mc_0.log"))
raise error
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,22 @@ def test_write_random_material_to_dat(
global_settings=global_settings,
)

# Actual analysis
run_iterator(iterator, global_settings=global_settings)
try:
# Actual analysis
run_iterator(iterator, global_settings=global_settings)

# Load results
results = load_result(global_settings.result_file(".pickle"))
# Load results
results = load_result(global_settings.result_file(".pickle"))

try:
# Check if we got the expected results
np.testing.assert_array_almost_equal(results["mean"], expected_mean, decimal=8)
np.testing.assert_array_almost_equal(results["var"], expected_var, decimal=8)
except (AssertionError, KeyError) as error:
except Exception as error:
experiment_dir = experiment_directory(global_settings.experiment_name)
job_dir = experiment_dir / "0"
_logger.info(list(job_dir.iterdir()))
output_dir = job_dir / "output"
_logger.info(list(output_dir.iterdir()))

_logger.info(read_file(output_dir / "test_write_random_material_to_dat_0.err"))
_logger.info(read_file(output_dir / "test_write_random_material_to_dat_0.log"))
raise error

Expand Down

0 comments on commit 06cf7c8

Please sign in to comment.