Skip to content

Commit

Permalink
FEM: result properties, add new lists to hold concrete results
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryvL authored and berndhahnebach committed Jun 16, 2019
1 parent 264d5e9 commit db493ee
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Mod/Fem/App/FemVTKTools.cpp
Expand Up @@ -660,6 +660,9 @@ std::map<std::string, std::string> _getFreeCADMechResultVectorProperties() {
// App::PropertyVectorList will be a list of vectors in vtk
std::map<std::string, std::string> resFCVecProp;
resFCVecProp["DisplacementVectors"] = "Displacement";
resFCVecProp["PS1Vector"] = "PS1Vector";
resFCVecProp["PS2Vector"] = "PS2Vector";
resFCVecProp["PS3Vector"] = "PS3Vector";

return resFCVecProp;
}
Expand Down Expand Up @@ -691,6 +694,10 @@ std::map<std::string, std::string> _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";
Expand Down
25 changes: 24 additions & 1 deletion src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py
Expand Up @@ -467,6 +467,28 @@ def calculate(self):
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
Expand All @@ -486,7 +508,8 @@ def calculate(self):
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)
Expand Down
50 changes: 50 additions & 0 deletions src/Mod/Fem/femobjects/_FemResultMechanical.py
Expand Up @@ -80,6 +80,56 @@ def __init__(self, obj):
"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",
Expand Down

0 comments on commit db493ee

Please sign in to comment.