[FEM] Add tools for more yield points in simple hardening materials

String List instead of String should allow for arbitrarily many entries,
theoretically.

Note the defaults previously in `YieldPoint1` an `YieldPoint2` were arbitrary.
Now the list is kept empty by default.

Fixes issue #4720.
This commit is contained in:
Ajinkya Dahale
2021-09-11 13:25:35 -04:00
committed by Bernd Hahnebach
parent 7a1f16774d
commit 16a82d1eb7
3 changed files with 8 additions and 28 deletions

View File

@@ -149,8 +149,7 @@ def setup(doc=None, solvertype="ccxtools"):
# nonlinear material
name_nlm = "Material_nonlin"
nonlinear_mat = ObjectsFem.makeMaterialMechanicalNonlinear(doc, material_obj, name_nlm)
nonlinear_mat.YieldPoint1 = '240.0, 0.0'
nonlinear_mat.YieldPoint2 = '270.0, 0.025'
nonlinear_mat.YieldPoints = ['240.0, 0.0', '270.0, 0.025']
analysis.addObject(nonlinear_mat)
# check solver attributes, Nonlinearity needs to be set to nonlinear

View File

@@ -60,25 +60,10 @@ class MaterialMechanicalNonlinear(base_fempythonobject.BaseFemPythonObject):
obj.MaterialModelNonlinearity = choices_nonlinear_material_models[0]
obj.addProperty(
"App::PropertyString",
"YieldPoint1",
"App::PropertyStringList",
"YieldPoints",
"Fem",
"Set stress and strain for yield point one, separated by a comma."
"Set stress and strain for yield points as a list of strings, "
"each point \"stress, plastic strain\""
)
obj.YieldPoint1 = "235.0, 0.0"
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 = ""
obj.YieldPoints = []

View File

@@ -113,10 +113,6 @@ def write_femelement_material(f, ccxwriter):
if nl_mat_obj.LinearBaseMaterial == mat_obj:
if nl_mat_obj.MaterialModelNonlinearity == "simple hardening":
f.write("*PLASTIC\n")
if nl_mat_obj.YieldPoint1:
f.write("{}\n".format(nl_mat_obj.YieldPoint1))
if nl_mat_obj.YieldPoint2:
f.write("{}\n".format(nl_mat_obj.YieldPoint2))
if nl_mat_obj.YieldPoint3:
f.write("{}\n".format(nl_mat_obj.YieldPoint3))
for yield_point in nl_mat_obj.YieldPoints:
f.write("{}\n".format(yield_point))
f.write("\n")