From 3f16f0ae6273cce7f7f02cdfbf92bc790bf4f632 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Sat, 1 Jul 2017 13:17:07 +0200 Subject: [PATCH] FEM: nonlinear material, add a third yield point and only write yield points if they are not empty --- src/Mod/Fem/FemInputWriterCcx.py | 8 ++++++-- src/Mod/Fem/PyObjects/_FemMaterialMechanicalNonlinear.py | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Mod/Fem/FemInputWriterCcx.py b/src/Mod/Fem/FemInputWriterCcx.py index afc5bcb411..6f66a7bf0d 100644 --- a/src/Mod/Fem/FemInputWriterCcx.py +++ b/src/Mod/Fem/FemInputWriterCcx.py @@ -603,8 +603,12 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): if nl_mat_obj.LinearBaseMaterial == mat_obj: if nl_mat_obj.MaterialModelNonlinearity == "simple hardening": f.write('*PLASTIC\n') - f.write(nl_mat_obj.YieldPoint1 + '\n') - f.write(nl_mat_obj.YieldPoint2 + '\n') + if nl_mat_obj.YieldPoint1: + f.write(nl_mat_obj.YieldPoint1 + '\n') + if nl_mat_obj.YieldPoint2: + f.write(nl_mat_obj.YieldPoint2 + '\n') + if nl_mat_obj.YieldPoint3: + f.write(nl_mat_obj.YieldPoint3 + '\n') f.write('\n') def write_constraints_initialtemperature(self, f): diff --git a/src/Mod/Fem/PyObjects/_FemMaterialMechanicalNonlinear.py b/src/Mod/Fem/PyObjects/_FemMaterialMechanicalNonlinear.py index 9d73865216..15d720726f 100644 --- a/src/Mod/Fem/PyObjects/_FemMaterialMechanicalNonlinear.py +++ b/src/Mod/Fem/PyObjects/_FemMaterialMechanicalNonlinear.py @@ -44,8 +44,11 @@ class _FemMaterialMechanicalNonlinear: obj.addProperty("App::PropertyString", "YieldPoint1", "Fem", "Set stress and strain for yield point one, separated by a comma.") obj.YieldPoint1 = "235.0, 0.0" - obj.addProperty("App::PropertyString", "YieldPoint2", "Fem", "Set stress and strain for yield point one, separated by a comma.") + obj.addProperty("App::PropertyString", "YieldPoint2", "Fem", "Set stress and strain for yield point two, separated by a comma.") obj.YieldPoint2 = "241.0, 0.025" + obj.addProperty("App::PropertyString", "YieldPoint3", "Fem", "Set stress and strain for yield point three, separated by a comma.") + obj.YieldPoint3 = "" + def execute(self, obj): return