From 15d7369de823f0789e1abaa5e4d26fe80d2cd751 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Tue, 18 Aug 2015 13:32:44 +0100 Subject: [PATCH] FEM: Force consistent DENSITY formatting Signed-off-by: Przemo Firszt --- src/Mod/Fem/ccxInpWriter.py | 4 ++-- src/Mod/Fem/inp_standard.inp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/ccxInpWriter.py b/src/Mod/Fem/ccxInpWriter.py index 2c08a5e93..e80f41b79 100644 --- a/src/Mod/Fem/ccxInpWriter.py +++ b/src/Mod/Fem/ccxInpWriter.py @@ -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') diff --git a/src/Mod/Fem/inp_standard.inp b/src/Mod/Fem/inp_standard.inp index 9341a866b..9b4ae8f6b 100644 --- a/src/Mod/Fem/inp_standard.inp +++ b/src/Mod/Fem/inp_standard.inp @@ -454,7 +454,7 @@ Eall 20000 , 0.360 *DENSITY -1e-09 , +1.000e-09, *SOLID SECTION, ELSET=MechanicalMaterial, MATERIAL=Test Material ***********************************************************