FEM: Force consistent DENSITY formatting

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt 2015-08-18 13:32:44 +01:00
parent 5e3dc0c2c9
commit 15d7369de8
2 changed files with 3 additions and 3 deletions

View File

@ -128,9 +128,9 @@ class inp_writer:
f.write('{}, \n'.format(YM_in_MPa))
f.write('{0:.3f}\n'.format(PR))
density = FreeCAD.Units.Quantity(mat_obj.Material['Density'])
density_in_kg_per_mm3 = density.getValueAs('t/mm^3')
density_in_tone_per_mm3 = float(density.getValueAs('t/mm^3'))
f.write('*DENSITY \n')
f.write('{}, \n'.format(density_in_kg_per_mm3))
f.write('{0:.3e}, \n'.format(density_in_tone_per_mm3))
# write element properties
if len(self.material_objects) == 1:
f.write('*SOLID SECTION, ELSET=' + mat_obj_name + ', MATERIAL=' + mat_name + '\n')

View File

@ -454,7 +454,7 @@ Eall
20000 ,
0.360
*DENSITY
1e-09 ,
1.000e-09,
*SOLID SECTION, ELSET=MechanicalMaterial, MATERIAL=Test Material
***********************************************************