diff --git a/python/test/t_stiffened_panel.py b/python/test/t_stiffened_panel.py new file mode 100755 index 00000000000..bbb9d230ada --- /dev/null +++ b/python/test/t_stiffened_panel.py @@ -0,0 +1,34 @@ +#! /usr/bin/env python + +import openturns as ot +from openturns.testing import assert_almost_equal +from openturns.usecases import stiffened_panel as stiffened_panel + + +ot.TESTPREAMBLE() +ot.PlatformInfo.SetNumericalPrecision(20) + +print("Test the FloodModel data class.") +sp = stiffened_panel.StiffenedPanel() + +print(sp.inputDistribution) +# test parameter +assert sp.dim == 10 + +# test marginals means +assert_almost_equal(sp.E.getMean()[0], 1338.1299666394023, 1e-12) +assert_almost_equal(sp.nu.getMean()[0], 30.001003758482675, 1e-12) +assert_almost_equal(sp.h_c.getMean()[0], 50.0, 1e-12) +assert_almost_equal(sp.ell.getMean()[0], 55.0, 1e-12) +assert_almost_equal(sp.f_1.getMean()[0], 300.0, 1e-12) +assert_almost_equal(sp.f_2.getMean()[0], 5000.0, 1e-12) +assert_almost_equal(sp.t.getMean()[0], 55.5, 1e-12) +assert_almost_equal(sp.a.getMean()[0], 3.0, 1e-12) +assert_almost_equal(sp.b_0.getMean()[0], 3.0, 1e-12) +assert_almost_equal(sp.p.getMean()[0], 3.0, 1e-12) + +meanInput = sp.distribution.getMean() +print("meanInput = ", meanInput) +meanOutput = sp.model(meanInput) +print("meanOutput = ", meanOutput) +assert_almost_equal(meanOutput, [2.5313, -5.96869, 1.0362], 1.0e-4)