From 2bf245d2adc06d370d83f3951f7461efbeae0c5a Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sat, 16 Nov 2024 22:12:55 +0100 Subject: [PATCH] add tests for hyperelastic foam model --- tests/test_constitution.py | 33 +++++++++++++++++++++------------ tests/test_constitution_jax.py | 1 + 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/tests/test_constitution.py b/tests/test_constitution.py index 4e436101..72da8771 100644 --- a/tests/test_constitution.py +++ b/tests/test_constitution.py @@ -341,42 +341,51 @@ def neo_hooke(C, mu=1): for model, kwargs, incompressible in [ (neo_hooke, {"mu": 1}, True), - (fem.constitution.saint_venant_kirchhoff, {"mu": 1, "lmbda": 20.0}, False), - (fem.constitution.neo_hooke, {"mu": 1}, True), - (fem.constitution.mooney_rivlin, {"C10": 0.3, "C01": 0.8}, True), - (fem.constitution.yeoh, {"C10": 0.5, "C20": -0.1, "C30": 0.02}, True), + (fem.saint_venant_kirchhoff, {"mu": 1, "lmbda": 20.0}, False), + (fem.neo_hooke, {"mu": 1}, True), + (fem.mooney_rivlin, {"C10": 0.3, "C01": 0.8}, True), + (fem.yeoh, {"C10": 0.5, "C20": -0.1, "C30": 0.02}, True), ( - fem.constitution.third_order_deformation, + fem.third_order_deformation, {"C10": 0.5, "C01": 0.1, "C11": 0.01, "C20": -0.1, "C30": 0.02}, True, ), - (fem.constitution.ogden, {"mu": [1, 0.2], "alpha": [1.7, -1.5]}, True), - (fem.constitution.arruda_boyce, {"C1": 1.0, "limit": 3.2}, True), + (fem.ogden, {"mu": [1, 0.2], "alpha": [1.7, -1.5]}, True), + (fem.arruda_boyce, {"C1": 1.0, "limit": 3.2}, True), ( - fem.constitution.extended_tube, + fem.extended_tube, {"Gc": 0.1867, "Ge": 0.2169, "beta": 0.2, "delta": 0.09693}, True, ), ( - fem.constitution.van_der_waals, + fem.van_der_waals, {"mu": 1.0, "beta": 0.1, "a": 0.5, "limit": 5.0}, True, ), ( - fem.constitution.alexander, + fem.alexander, dict(C1=0.117, C2=0.137, C3=0.00690, gamma=0.735, k=0.00015), True, ), ( - fem.constitution.anssari_benam_bucchi, + fem.anssari_benam_bucchi, dict(mu=0.29, N=26.8), True, ), ( - fem.constitution.lopez_pamies, + fem.lopez_pamies, dict(mu=[0.2699, 0.00001771], alpha=[1.08, 4.40]), True, ), + ( + fem.storakers, + dict( + mu=[4.5 * (1.85 / 2), -4.5 * (-9.2 / 2)], + alpha=[1.85, -9.2], + beta=[0.92, 0.92], + ), + False, + ), ]: umat = fem.Hyperelastic(model, **kwargs) diff --git a/tests/test_constitution_jax.py b/tests/test_constitution_jax.py index 8cf6dc06..a904845c 100644 --- a/tests/test_constitution_jax.py +++ b/tests/test_constitution_jax.py @@ -67,6 +67,7 @@ def test_hyperelastic_jax(): md.yeoh, md.third_order_deformation, md.miehe_goektepe_lulei, + md.storakers, ]: umat = mat.Hyperelastic(W, **W.kwargs) solid = fem.SolidBody(umat=umat, field=field)