Download tests/test_t2_graybox_closure.py from HaomingLuo/AgentFEM-Material-Loading-Memory: direct link, hf CLI and curl.
- Browser
- Download file 857 Bytes
-
https://huggingface.co/datasets/HaomingLuo/AgentFEM-Material-Loading-Memory/resolve/main/tests/test_t2_graybox_closure.py
- Command line
-
hf download hf://datasets/HaomingLuo/AgentFEM-Material-Loading-Memory/tests/test_t2_graybox_closure.py
-
curl -L -o test_t2_graybox_closure.py https://huggingface.co/datasets/HaomingLuo/AgentFEM-Material-Loading-Memory/resolve/main/tests/test_t2_graybox_closure.py
857 Bytes
| import numpy as np | |
| from src.generate_t2_graybox_closure import closure_design, material, solve | |
| def test_reference_is_intentionally_richer_than_closure_state(): | |
| law = material() | |
| assert law.backstress_count == 3 | |
| assert law.isotropic_hardening is not None | |
| assert len(law.isotropic_hardening.equivalent_plastic_strain) == 7 | |
| def test_closure_cohort_preserves_total_reference_backstress(): | |
| row = closure_design(4)[0] | |
| nine_points = 9 | |
| result = solve(row, points=nine_points) | |
| assert result["strain"].shape == (nine_points, 6) | |
| assert result["truth_memories_pa"].shape == (nine_points, 3, 6) | |
| assert result["memories_pa"].shape == (nine_points, 2, 6) | |
| np.testing.assert_allclose( | |
| result["memories_pa"].sum(axis=1), | |
| result["truth_memories_pa"].sum(axis=1), | |
| rtol=1.0e-12, | |
| atol=1.0e-5, | |
| ) | |