FEM: use a more precise object name "vonMises" instead "StressValues"
This commit is contained in:
@@ -694,7 +694,7 @@ std::map<std::string, std::string> _getFreeCADMechResultScalarProperties() {
|
||||
// resFCScalProp["PrincipalMax"] = "Major Principal Stress"; // can be plotted in Paraview as THE MAJOR PRINCIPAL STRESS MAGNITUDE
|
||||
// resFCScalProp["PrincipalMed"] = "Intermediate Principal Stress"; // can be plotted in Paraview as THE INTERMEDIATE PRINCIPAL STRESS MAGNITUDE
|
||||
// resFCScalProp["PrincipalMin"] = "Minor Principal Stress"; // can be plotted in Paraview as THE MINOR PRINCIPAL STRESS MAGNITUDE
|
||||
resFCScalProp["StressValues"] = "von Mises Stress";
|
||||
resFCScalProp["vonMises"] = "von Mises Stress";
|
||||
resFCScalProp["Temperature"] = "Temperature";
|
||||
resFCScalProp["MohrCoulomb"] = "MohrCoulomb";
|
||||
resFCScalProp["ReinforcementRatio_x"] = "ReinforcementRatio_x";
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="user_def_head_13">
|
||||
<property name="text">
|
||||
<string>von Mises stress: Von</string>
|
||||
<string>von Mises stress: vM</string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByMouse</set>
|
||||
|
||||
@@ -379,8 +379,8 @@ class _TaskPanelFemResultShow:
|
||||
self.none_selected(True)
|
||||
|
||||
def vm_stress_selected(self, state):
|
||||
if len(self.result_obj.StressValues) > 0:
|
||||
self.result_selected("Sabs", self.result_obj.StressValues, "MPa")
|
||||
if len(self.result_obj.vonMises) > 0:
|
||||
self.result_selected("Sabs", self.result_obj.vonMises, "MPa")
|
||||
else:
|
||||
self.result_widget.rb_none.setChecked(True)
|
||||
self.none_selected(True)
|
||||
@@ -445,7 +445,7 @@ class _TaskPanelFemResultShow:
|
||||
P1 = np.array(self.result_obj.PrincipalMax)
|
||||
P2 = np.array(self.result_obj.PrincipalMed)
|
||||
P3 = np.array(self.result_obj.PrincipalMin)
|
||||
Von = np.array(self.result_obj.StressValues)
|
||||
vM = np.array(self.result_obj.vonMises)
|
||||
Peeq = np.array(self.result_obj.Peeq)
|
||||
T = np.array(self.result_obj.Temperature)
|
||||
MF = np.array(self.result_obj.MassFlowRate)
|
||||
@@ -526,7 +526,7 @@ class _TaskPanelFemResultShow:
|
||||
self.update_colors_stats(UserDefinedFormula, "", minm, avg, maxm)
|
||||
|
||||
# Dummy use of the variables to get around flake8 error
|
||||
del x, y, z, T, Von, Peeq, P1, P2, P3
|
||||
del x, y, z, T, vM, Peeq, P1, P2, P3
|
||||
del sxx, syy, szz, sxy, sxz, syz
|
||||
del exx, eyy, ezz, exy, exz, eyz
|
||||
del MF, NP, rx, ry, rz, mc
|
||||
@@ -620,7 +620,7 @@ class _TaskPanelFemResultShow:
|
||||
DisplacementLengths --> rb_abs_displacement
|
||||
DisplacementVectors --> rb_x_displacement, rb_y_displacement, rb_z_displacement
|
||||
Temperature --> rb_temperature
|
||||
StressValues --> rb_vm_stress
|
||||
vonMises --> rb_vm_stress
|
||||
PrincipalMax --> rb_maxprin
|
||||
PrincipalMin --> rb_minprin
|
||||
MaxShear --> rb_max_shear_stress
|
||||
@@ -635,7 +635,7 @@ class _TaskPanelFemResultShow:
|
||||
self.result_widget.rb_z_displacement.setEnabled(0)
|
||||
if len(self.result_obj.Temperature) == 0:
|
||||
self.result_widget.rb_temperature.setEnabled(0)
|
||||
if len(self.result_obj.StressValues) == 0:
|
||||
if len(self.result_obj.vonMises) == 0:
|
||||
self.result_widget.rb_vm_stress.setEnabled(0)
|
||||
if len(self.result_obj.PrincipalMax) == 0:
|
||||
self.result_widget.rb_maxprin.setEnabled(0)
|
||||
|
||||
@@ -151,7 +151,7 @@ def importFrd(
|
||||
|
||||
# fill DisplacementLengths
|
||||
res_obj = restools.add_disp_apps(res_obj)
|
||||
# fill StressValues
|
||||
# fill vonMises
|
||||
res_obj = restools.add_von_mises(res_obj)
|
||||
if res_obj.getParentGroup():
|
||||
has_reinforced_mat = False
|
||||
|
||||
@@ -139,7 +139,7 @@ class _FemResultMechanical():
|
||||
)
|
||||
obj.addProperty(
|
||||
"App::PropertyFloatList",
|
||||
"StressValues",
|
||||
"vonMises",
|
||||
"NodeData",
|
||||
"",
|
||||
True
|
||||
|
||||
@@ -124,7 +124,7 @@ def show_result(resultobj, result_type="Sabs", limit=None):
|
||||
return
|
||||
if resultobj:
|
||||
if result_type == "Sabs":
|
||||
values = resultobj.StressValues
|
||||
values = resultobj.vonMises
|
||||
elif result_type == "Uabs":
|
||||
values = resultobj.DisplacementLengths
|
||||
# TODO: the result object does have more result types to show, implement them
|
||||
@@ -282,10 +282,10 @@ def fill_femresult_stats(res_obj):
|
||||
a_min = min(res_obj.DisplacementLengths)
|
||||
a_avg = sum(res_obj.DisplacementLengths) / no_of_values
|
||||
a_max = max(res_obj.DisplacementLengths)
|
||||
if res_obj.StressValues:
|
||||
s_min = min(res_obj.StressValues)
|
||||
s_avg = sum(res_obj.StressValues) / no_of_values
|
||||
s_max = max(res_obj.StressValues)
|
||||
if res_obj.vonMises:
|
||||
s_min = min(res_obj.vonMises)
|
||||
s_avg = sum(res_obj.vonMises) / no_of_values
|
||||
s_max = max(res_obj.vonMises)
|
||||
if res_obj.PrincipalMax:
|
||||
p1_min = min(res_obj.PrincipalMax)
|
||||
p1_avg = sum(res_obj.PrincipalMax) / no_of_values
|
||||
@@ -382,8 +382,8 @@ def add_von_mises(res_obj):
|
||||
)
|
||||
for Sxx, Syy, Szz, Sxy, Sxz, Syz in iterator:
|
||||
mstress.append(calculate_von_mises((Sxx, Syy, Szz, Sxy, Sxz, Syz)))
|
||||
res_obj.StressValues = mstress
|
||||
FreeCAD.Console.PrintLog("Added StressValues (von Mises).\n")
|
||||
res_obj.vonMises = mstress
|
||||
FreeCAD.Console.PrintLog("Added von Mises stress.\n")
|
||||
return res_obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user