Skip to content

Commit 5a45299

Browse files
add adjusted triaxial test to the test_element_lab
1 parent aab84cc commit 5a45299

2 files changed

Lines changed: 22 additions & 38 deletions

File tree

applications/GeoMechanicsApplication/tests/test_element_lab.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ class KratosGeoMechanicsLabElementTests(KratosUnittest.TestCase):
99
"""
1010
This class contains some element tests, such as triaxial and oedometer tests
1111
"""
12+
def test_triaxial(self):
13+
"""
14+
Regression test for the triaxial experiment.
15+
"""
16+
test_name = 'test_triaxial'
17+
file_path = test_helper.get_file_path(os.path.join('test_element_lab', test_name))
18+
simulation = test_helper.run_kratos(file_path)
19+
20+
# read the output files from the simulation for comparison
21+
reader = GiDOutputFileReader()
22+
result = reader.read_output_from(os.path.join(file_path, 'triaxial_test_output.post.res'))
23+
24+
displacement = reader.nodal_values_at_time("DISPLACEMENT", 1, result)
25+
print(displacement)
26+
self.assertEqual(displacement,[[0.0, -0.2, 0.0], [0.0527776, -0.2, 0.0], [0.0, -0.100033, 0.0], [0.0524025, -0.0996931, 0.0], [0.0, 0.0, 0.0], [0.105197, -0.2, 0.0], [0.105114, -0.100049, 0.0], [0.0524406, 0.0, 0.0], [0.104632, 0.0, 0.0]], "The displacement in one of the nodes is incorrect.")
27+
28+
stress = reader.element_integration_point_values_at_time("CAUCHY_STRESS_TENSOR", 1, result, [1], [0])
29+
self.assertEqual(stress, [[[-99.9808, -252.622, -99.9806, 0.193199, 0.0, 0.0]]], "The Cauchy stress calculation is not OK.")
30+
31+
strain = reader.element_integration_point_values_at_time("ENGINEERING_STRAIN_TENSOR", 1, result, [1], [0])
32+
self.assertEqual(strain, [[[0.104863, -0.19973, 0.104946, 0.000440186, 0.0, 0.0]]], "The engineering strain calculation is not OK.")
33+
1234
def test_triaxial_comp_6n(self):
1335
"""
1436
Drained compression triaxial test on Mohr-Coulomb model with axisymmetric 2D6N elements

applications/GeoMechanicsApplication/tests/test_triaxial.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)