FEM: unit test, again enable all stat types except 1DFlow, fix osx failure by only use 14 diggits
This commit is contained in:
committed by
Yorik van Havre
parent
3b97d96141
commit
aef1188aed
@@ -288,7 +288,7 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
self.assertTrue(fea.results_present, "Cannot read results from {}.frd frd file".format(fea.base_name))
|
||||
|
||||
fcc_print('Reading stats from result object for static analysis...')
|
||||
ret = compare_stats(fea, static_expected_values, ["U1", "U2", "U3", "Uabs", "Sabs"])
|
||||
ret = compare_stats(fea, static_expected_values)
|
||||
self.assertFalse(ret, "Invalid results read from .frd file")
|
||||
|
||||
fcc_print('Save FreeCAD file for static analysis to {}...'.format(static_save_fc_file))
|
||||
@@ -336,7 +336,7 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
self.assertTrue(fea.results_present, "Cannot read results from {}.frd frd file".format(fea.base_name))
|
||||
|
||||
fcc_print('Reading stats from result object for frequency analysis...')
|
||||
ret = compare_stats(fea, frequency_expected_values, ["U1", "U2", "U3", "Uabs", "Sabs"])
|
||||
ret = compare_stats(fea, frequency_expected_values)
|
||||
self.assertFalse(ret, "Invalid results read from .frd file")
|
||||
|
||||
fcc_print('Save FreeCAD file for frequency analysis to {}...'.format(frequency_save_fc_file))
|
||||
@@ -464,7 +464,7 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
self.assertTrue(fea.results_present, "Cannot read results from {}.frd frd file".format(fea.base_name))
|
||||
|
||||
fcc_print('Reading stats from result object for thermomech analysis...')
|
||||
ret = compare_stats(fea, thermomech_expected_values, ["U1", "U2", "U3", "Uabs", "Sabs"])
|
||||
ret = compare_stats(fea, thermomech_expected_values)
|
||||
self.assertFalse(ret, "Invalid results read from .frd file")
|
||||
|
||||
fcc_print('Save FreeCAD file for thermomech analysis to {}...'.format(thermomech_save_fc_file))
|
||||
@@ -791,7 +791,8 @@ def compare_stats(fea, stat_file=None, loc_stat_types=None):
|
||||
sf_content = force_unix_line_ends(sf_content)
|
||||
stats = []
|
||||
for s in loc_stat_types:
|
||||
stats.append("{}: {}\n".format(s, fea.get_stats(s)))
|
||||
statval = fea.get_stats(s)
|
||||
stats.append("{0}: ({1:.14g}, {2:.14g}, {3:.14g})\n".format(s, statval[0], statval[1], statval[2]))
|
||||
if sf_content != stats:
|
||||
fcc_print("Expected stats from {}".format(stat_file))
|
||||
fcc_print(sf_content)
|
||||
@@ -843,7 +844,8 @@ def create_test_results():
|
||||
fea.load_results()
|
||||
stats_static = [] # we only have one result object so we are fine
|
||||
for s in stat_types:
|
||||
stats_static.append("{}: {}\n".format(s, fea.get_stats(s)))
|
||||
statval = fea.get_stats(s)
|
||||
stats_static.append("{0}: ({1:.14g}, {2:.14g}, {3:.14g})\n".format(s, statval[0], statval[1], statval[2]))
|
||||
static_expected_values_file = static_analysis_dir + '/cube_static_expected_values'
|
||||
f = open(static_expected_values_file, 'w')
|
||||
for s in stats_static:
|
||||
@@ -868,7 +870,8 @@ def create_test_results():
|
||||
fea.load_results()
|
||||
stats_frequency = [] # since we set eigenmodeno. we only have one result object so we are fine
|
||||
for s in stat_types:
|
||||
stats_frequency.append("{}: {}\n".format(s, fea.get_stats(s)))
|
||||
statval = fea.get_stats(s)
|
||||
stats_frequency.append("{0}: ({1:.14g}, {2:.14g}, {3:.14g})\n".format(s, statval[0], statval[1], statval[2]))
|
||||
frequency_expected_values_file = frequency_analysis_dir + '/cube_frequency_expected_values'
|
||||
f = open(frequency_expected_values_file, 'w')
|
||||
for s in stats_frequency:
|
||||
@@ -890,7 +893,8 @@ def create_test_results():
|
||||
fea.load_results()
|
||||
stats_thermomech = [] # we only have one result object so we are fine
|
||||
for s in stat_types:
|
||||
stats_thermomech.append("{}: {}\n".format(s, fea.get_stats(s)))
|
||||
statval = fea.get_stats(s)
|
||||
stats_thermomech.append("{0}: ({1:.14g}, {2:.14g}, {3:.14g})\n".format(s, statval[0], statval[1], statval[2]))
|
||||
thermomech_expected_values_file = thermomech_analysis_dir + '/spine_thermomech_expected_values'
|
||||
f = open(thermomech_expected_values_file, 'w')
|
||||
for s in stats_thermomech:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
U1: (0.0, 0.0, 0.0)
|
||||
U2: (0.0, 0.0, 0.0)
|
||||
U3: (0.0, 0.0, 0.0)
|
||||
Uabs: (0.0, 0.0, 0.0)
|
||||
Sabs: (0.0, 0.0, 0.0)
|
||||
U1: (0, 0, 0)
|
||||
U2: (0, 0, 0)
|
||||
U3: (0, 0, 0)
|
||||
Uabs: (0, 0, 0)
|
||||
Sabs: (0, 0, 0)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
U1: (-260.885, 0.4598631285714256, 260.514)
|
||||
U2: (-31.5876, 28.36729143214285, 60.9314)
|
||||
U3: (0.0, 288.8827953571427, 603.385)
|
||||
Uabs: (0.0, 311.8864585156363, 655.5261463034179)
|
||||
Sabs: (4.479528967136944, 71.96862334887253, 217.1885263864614)
|
||||
MaxPrin: (-51.052324030743904, 39.88082216025957, 294.9265232927073)
|
||||
MidPrin: (-198.6180601552034, 0.3227032003773508, 202.66494122230748)
|
||||
MinPrin: (-295.6960070899379, -40.144573469342724, 46.83854286004427)
|
||||
MaxShear: (2.574213187510708, 40.01269781480114, 124.04399021633152)
|
||||
Peeq: (0.0, 0.0, 0.0)
|
||||
Temp: (0.0, 0.0, 0.0)
|
||||
MFlow: (0.0, 0.0, 0.0)
|
||||
NPress: (0.0, 0.0, 0.0)
|
||||
U1: (-260.885, 0.45986312857143, 260.514)
|
||||
U2: (-31.5876, 28.367291432143, 60.9314)
|
||||
U3: (0, 288.88279535714, 603.385)
|
||||
Uabs: (0, 311.88645851564, 655.52614630342)
|
||||
Sabs: (4.4795289671369, 71.968623348873, 217.18852638646)
|
||||
MaxPrin: (-51.052324030744, 39.88082216026, 294.92652329271)
|
||||
MidPrin: (-198.6180601552, 0.32270320037735, 202.66494122231)
|
||||
MinPrin: (-295.69600708994, -40.144573469343, 46.838542860044)
|
||||
MaxShear: (2.5742131875107, 40.012697814801, 124.04399021633)
|
||||
Peeq: (0, 0, 0)
|
||||
Temp: (0, 0, 0)
|
||||
MFlow: (0, 0, 0)
|
||||
NPress: (0, 0, 0)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
U1: (-0.0680669, -0.02259640982071429, 0.00296745)
|
||||
U2: (-0.0109484, 1.4716768996428517e-05, 0.0110702)
|
||||
U3: (-0.0643181, -0.03087668257142857, 0.0)
|
||||
Uabs: (0.0, 0.03946299049104409, 0.09373834604097141)
|
||||
Sabs: (385.37990181702247, 1006.7357751358935, 2203.5090958167284)
|
||||
MaxPrin: (-445.618534742656, 75.90111503580123, 908.6989814090499)
|
||||
MidPrin: (-2058.523459279862, -363.98683840372263, 790.1306258178694)
|
||||
MinPrin: (-2956.2880059774816, -1040.3029461492217, -172.23661850878244)
|
||||
MaxShear: (218.05700933616734, 558.1020305925113, 1255.334735617413)
|
||||
Peeq: (0.0, 0.0, 0.0)
|
||||
Temp: (0.0, 0.0, 0.0)
|
||||
MFlow: (0.0, 0.0, 0.0)
|
||||
NPress: (0.0, 0.0, 0.0)
|
||||
U1: (-0.0680669, -0.022596409820714, 0.00296745)
|
||||
U2: (-0.0109484, 1.4716768996429e-05, 0.0110702)
|
||||
U3: (-0.0643181, -0.030876682571429, 0)
|
||||
Uabs: (0, 0.039462990491044, 0.093738346040971)
|
||||
Sabs: (385.37990181702, 1006.7357751359, 2203.5090958167)
|
||||
MaxPrin: (-445.61853474266, 75.901115035801, 908.69898140905)
|
||||
MidPrin: (-2058.5234592799, -363.98683840372, 790.13062581787)
|
||||
MinPrin: (-2956.2880059775, -1040.3029461492, -172.23661850878)
|
||||
MaxShear: (218.05700933617, 558.10203059251, 1255.3347356174)
|
||||
Peeq: (0, 0, 0)
|
||||
Temp: (0, 0, 0)
|
||||
MFlow: (0, 0, 0)
|
||||
NPress: (0, 0, 0)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
U1: (-0.000942455, 0.0030585454755555556, 0.00729818)
|
||||
U2: (-0.00163382, 0.0006165889555555556, 0.00222318)
|
||||
U3: (-0.00185329, 0.0005439136222222222, 0.00220675)
|
||||
Uabs: (0.0, 0.003644782698151031, 0.007325712241135124)
|
||||
Sabs: (0.30712297252407333, 7.747458526266711, 35.86180372766652)
|
||||
MaxPrin: (-5.823866574600995, 1.3192417907488656, 10.92045561219017)
|
||||
MidPrin: (-37.767092580118884, -4.877642532204389, 10.90982645542747)
|
||||
MinPrin: (-39.36716084528015, -7.023583449500031, 6.4737666061604635)
|
||||
MaxShear: (0.16818219759987152, 4.171412620124449, 18.100360778483793)
|
||||
Peeq: (0.0, 0.0, 0.0)
|
||||
Temp: (293.447, 299.9189333333334, 310.93)
|
||||
MFlow: (0.0, 0.0, 0.0)
|
||||
NPress: (0.0, 0.0, 0.0)
|
||||
U1: (-0.000942455, 0.0030585454755556, 0.00729818)
|
||||
U2: (-0.00163382, 0.00061658895555556, 0.00222318)
|
||||
U3: (-0.00185329, 0.00054391362222222, 0.00220675)
|
||||
Uabs: (0, 0.003644782698151, 0.0073257122411351)
|
||||
Sabs: (0.30712297252407, 7.7474585262667, 35.861803727667)
|
||||
MaxPrin: (-5.823866574601, 1.3192417907489, 10.92045561219)
|
||||
MidPrin: (-37.767092580119, -4.8776425322044, 10.909826455427)
|
||||
MinPrin: (-39.36716084528, -7.0235834495, 6.4737666061605)
|
||||
MaxShear: (0.16818219759987, 4.1714126201244, 18.100360778484)
|
||||
Peeq: (0, 0, 0)
|
||||
Temp: (293.447, 299.91893333333, 310.93)
|
||||
MFlow: (0, 0, 0)
|
||||
NPress: (0, 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user