FEM: cslculix writer, fix if young's modulus is smaller than 500 kPa

This commit is contained in:
Bernd Hahnebach
2021-07-13 09:28:56 +02:00
parent e704f3267c
commit c73c6097bf

View File

@@ -88,7 +88,12 @@ def write_femelement_material(f, ccxwriter):
f.write("*MATERIAL, NAME=" + mat_name + "\n")
if mat_obj.Category == "Solid":
f.write("*ELASTIC\n")
f.write("{0:.0f}, {1:.3f}\n".format(YM_in_MPa, PR))
if YM_in_MPa >= 1000:
f.write("{0:.0f}, {1:.3f}\n".format(YM_in_MPa, PR))
else:
# may be not suited for structural engineerings but such soft materials exist ;-)
# https://forum.freecadweb.org/viewtopic.php?f=18&t=60066
f.write("{0:.3e}, {1:.3f}\n".format(YM_in_MPa, PR))
if is_density_needed() is True:
f.write("*DENSITY\n")