Skip to content

Commit

Permalink
FEM: result task panel, add stress and strain vectors to possible use…
Browse files Browse the repository at this point in the history
…r defined results
  • Loading branch information
makkemal authored and yorikvanhavre committed Jan 7, 2017
1 parent 3003b7d commit 57a94af
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
32 changes: 31 additions & 1 deletion src/Mod/Fem/TaskPanelShowResult.ui
Expand Up @@ -270,8 +270,38 @@
</item>
<item>
<widget class="QLabel" name="user_def_text">
<property name="minimumSize">
<size>
<width>0</width>
<height>17</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>Available: Disp(x,y,z) Principal stresses (P1,P2,P3)</string>
<string>Available: Disp(x,y,z) Principal stresses(P1,P2,P3) Stress(sx,sy,sz) Strain (ex,ey,ez)</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="indent">
<number>-1</number>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
Expand Down
12 changes: 10 additions & 2 deletions src/Mod/Fem/_TaskPanelShowResult.py
Expand Up @@ -21,7 +21,7 @@
# ***************************************************************************

__title__ = "Result Control Task Panel"
__author__ = "Juergen Riegel"
__author__ = "Juergen Riegel, Michael Hindley"
__url__ = "http://www.freecadweb.org"

## @package TaskPanelShowResult
Expand Down Expand Up @@ -231,7 +231,15 @@ def calculate(self):
x = np.array(dispvectors[:, 0])
y = np.array(dispvectors[:, 1])
z = np.array(dispvectors[:, 2])
userdefined_eq = x + y + z + T + Von + P1 + P2 + P3 # Dummy equation to get around flake8, varibles not being used
stressvectors = np.array(self.result_object.StressVectors)
sx = np.array(stressvectors[:, 0])
sy = np.array(stressvectors[:, 1])
sz = np.array(stressvectors[:, 2])
strainvectors = np.array(self.result_object.StrainVectors)
ex = np.array(strainvectors[:, 0])
ey = np.array(strainvectors[:, 1])
ez = np.array(strainvectors[:, 2])
userdefined_eq = x + y + z + T + Von + P1 + P2 + P3 + sx + sy + sz + ex + ey + ez # Dummy equation to get around flake8, varibles not being used
userdefined_eq = self.form.user_def_eq.toPlainText() # Get equation to be used
UserDefinedFormula = eval(userdefined_eq).tolist()
self.result_object.UserDefined = UserDefinedFormula
Expand Down

0 comments on commit 57a94af

Please sign in to comment.