From cf5eb3c5edf97d662f42c6b9117b88582575d7b5 Mon Sep 17 00:00:00 2001 From: HarryvL Date: Sun, 16 Jun 2019 18:26:09 +0200 Subject: [PATCH] FEM: result properties, add new lists to hold concrete results --- src/Mod/Fem/App/FemVTKTools.cpp | 7 +++ .../_ViewProviderFemResultMechanical.py | 25 +++++++++- .../Fem/femobjects/_FemResultMechanical.py | 50 +++++++++++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 250454bf1e..432bc37cbf 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -660,6 +660,9 @@ std::map _getFreeCADMechResultVectorProperties() { // App::PropertyVectorList will be a list of vectors in vtk std::map resFCVecProp; resFCVecProp["DisplacementVectors"] = "Displacement"; + resFCVecProp["PS1Vector"] = "PS1Vector"; + resFCVecProp["PS2Vector"] = "PS2Vector"; + resFCVecProp["PS3Vector"] = "PS3Vector"; return resFCVecProp; } @@ -691,6 +694,10 @@ std::map _getFreeCADMechResultScalarProperties() { resFCScalProp["PrincipalMin"] = "Minor Principal Stress"; // can be plotted in Paraview as THE MINOR PRINCIPAL STRESS MAGNITUDE resFCScalProp["StressValues"] = "von Mises Stress"; resFCScalProp["Temperature"] = "Temperature"; + resFCScalProp["MohrCoulomb"] = "MohrCoulomb"; + resFCScalProp["ReinforcementRatio_x"] = "ReinforcementRatio_x"; + resFCScalProp["ReinforcementRatio_y"] = "ReinforcementRatio_y"; + resFCScalProp["ReinforcementRatio_z"] = "ReinforcementRatio_z"; resFCScalProp["UserDefined"] = "UserDefinedMyName"; // this is empty or am I wrong ?! resFCScalProp["MassFlowRate"] = "Mass Flow Rate"; diff --git a/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py b/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py index 1d4f823d92..f108e29dc8 100644 --- a/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py +++ b/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py @@ -467,6 +467,28 @@ class _TaskPanelFemResultShow: exy = np.array(self.result_obj.NodeStrainXY) exz = np.array(self.result_obj.NodeStrainXZ) eyz = np.array(self.result_obj.NodeStrainYZ) + + # Display of Reinforcement Ratios and Mohr Coulomb Criterion + rx = np.array(self.result_obj.ReinforcementRatio_x) + ry = np.array(self.result_obj.ReinforcementRatio_y) + rz = np.array(self.result_obj.ReinforcementRatio_z) + mc = np.array(self.result_obj.MohrCoulomb) + + ps1vector = np.array(self.result_obj.PS1Vector) + s1x = np.array(ps1vector[:, 0]) + s1y = np.array(ps1vector[:, 1]) + s1z = np.array(ps1vector[:, 2]) + + ps2vector = np.array(self.result_obj.PS2Vector) + s2x = np.array(ps2vector[:, 0]) + s2y = np.array(ps2vector[:, 1]) + s2z = np.array(ps2vector[:, 2]) + + ps3vector = np.array(self.result_obj.PS1Vector) + s3x = np.array(ps3vector[:, 0]) + s3y = np.array(ps3vector[:, 1]) + s3z = np.array(ps3vector[:, 2]) + userdefined_eq = self.form.user_def_eq.toPlainText() # Get equation to be used UserDefinedFormula = eval(userdefined_eq).tolist() self.result_obj.UserDefined = UserDefinedFormula @@ -486,7 +508,8 @@ class _TaskPanelFemResultShow: del x, y, z, T, Von, Peeq, P1, P2, P3 del sxx, syy, szz, sxy, sxz, syz del exx, eyy, ezz, exy, exz, eyz - del MF, NP + del MF, NP, rx, ry, rz, mc + del s1x, s1y, s1z, s2x, s2y, s2z, s3x, s3y, s3z def select_displacement_type(self, disp_type): QApplication.setOverrideCursor(Qt.WaitCursor) diff --git a/src/Mod/Fem/femobjects/_FemResultMechanical.py b/src/Mod/Fem/femobjects/_FemResultMechanical.py index 721678122f..81da7d554b 100644 --- a/src/Mod/Fem/femobjects/_FemResultMechanical.py +++ b/src/Mod/Fem/femobjects/_FemResultMechanical.py @@ -80,6 +80,56 @@ class _FemResultMechanical(): "List of equivalent plastic strain values", True ) + obj.addProperty( + "App::PropertyFloatList", + "MohrCoulomb", + "NodeData", + "List of Mohr Coulomb stress values", + True + ) + obj.addProperty( + "App::PropertyFloatList", + "ReinforcementRatio_x", + "NodeData", + "Reinforcement ratio x-direction", + True + ) + obj.addProperty( + "App::PropertyFloatList", + "ReinforcementRatio_y", + "NodeData", + "Reinforcement ratio y-direction", + True + ) + obj.addProperty( + "App::PropertyFloatList", + "ReinforcementRatio_z", + "NodeData", + "Reinforcement ratio z-direction", + True + ) + obj.addProperty( + "App::PropertyVectorList", + "PS1Vector", + "NodeData", + "List of 1st Principal Stress Vectors", + True + ) + obj.addProperty( + "App::PropertyVectorList", + "PS2Vector", + "NodeData", + "List of 2nd Principal Stress Vectors", + True + ) + obj.addProperty( + "App::PropertyVectorList", + "PS3Vector", + "NodeData", + "List of 3rd Principal Stress Vectors", + True + ) + # readonly in propertyEditor of comboView obj.addProperty( "App::PropertyFloatList",