FEM: results, remove stressvectors and strainvectors from result obj, adapt code elsewhere

This commit is contained in:
Bernd Hahnebach
2019-03-15 21:06:40 +01:00
committed by Yorik van Havre
parent 53d2b30dcf
commit fc3d2a9f1e
3 changed files with 1 additions and 25 deletions

View File

@@ -663,9 +663,7 @@ std::map<std::string, std::vector<std::string>> _getFreeCADMechResultProperties(
// App::PropertyVectorList will be a list of vectors in vtk
std::map<std::string, std::vector<std::string>> resFCProperties;
resFCProperties["vectors"] = {
"DisplacementVectors",
"StressVectors",
"StrainVectors"
"DisplacementVectors"
};
// App::PropertyFloatList will be a list of scalars in vtk
resFCProperties["scalars"] = {

View File

@@ -288,26 +288,6 @@ def fill_femresult_mechanical(res_obj, result_set):
res_obj.NodeStrainXZ = Exz
res_obj.NodeStrainYZ = Eyz
# fill res_obj.StressVectors if they exist
if 'stress' in result_set:
stress = result_set['stress']
stressv1 = {}
for i, stval in enumerate(stress.values()): # i .. stresstuple .. (Sxx, Syy, Szz, Sxy, Syz, Szx)
stressv1[i] = (FreeCAD.Vector(stval[0], stval[1], stval[2])) # Sxx, Syy, Szz
res_obj.StressVectors = list(map((lambda x: x * scale), stressv1.values()))
stress_keys = list(stress.keys())
if (res_obj.NodeNumbers != 0 and res_obj.NodeNumbers != stress_keys):
print("Inconsistent FEM results: element number for Stress doesn't equal element number for Displacement {} != {}"
.format(res_obj.NodeNumbers, len(res_obj.StressValues)))
# fill res_obj.StrainVectors if they exist
if 'strain' in result_set:
strain = result_set['strain']
strainv = {}
for i, values_E in enumerate(strain.values()): # values_E .. straintuple .. (Exx, Eyy, Ezz, Exy, Eyz, Ezx)
strainv[i] = (FreeCAD.Vector(values_E[0], values_E[1], values_E[2]))
res_obj.StrainVectors = list(map((lambda x: x * scale), strainv.values()))
# fill Equivalent Plastic strain if they exist
if 'peeq' in result_set:
Peeq = result_set['peeq']

View File

@@ -48,8 +48,6 @@ class _FemResultMechanical():
# set read only or hide a property: https://forum.freecadweb.org/viewtopic.php?f=18&t=13460&start=10#p108072
# do not show up in propertyEditor of comboView
obj.addProperty("App::PropertyVectorList", "DisplacementVectors", "NodeData", "List of displacement vectors", True)
obj.addProperty("App::PropertyVectorList", "StressVectors", "NodeData", "List of stress vectors", True)
obj.addProperty("App::PropertyVectorList", "StrainVectors", "NodeData", "List of strain vectors", True)
obj.addProperty("App::PropertyFloatList", "Peeq", "NodeData", "List of equivalent plastic strain values", True)
# readonly in propertyEditor of comboView
obj.addProperty("App::PropertyFloatList", "DisplacementLengths", "NodeData", "List of displacement lengths", True)