Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
regislebrun committed Apr 2, 2024
1 parent a666306 commit a7010a1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions python/test/t_stiffened_panel.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a7010a1

Please sign in to comment.