[Help] Get element values?

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

[Help] Get element values?

Post by dubstar-04 »

Can someone point me to where I can look to get the element values for stress and displacement?

I would like to look at automating the production of analysis reports with the element values and some other data.

I can see that in mechanicalanalysis.py Fem::FemResultValue and Fem::FemResultVector are used.

Thanks,

Dan
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Help] Get element values?

Post by bernd »

Mhh I mostly use cgx if I would like to know something detailed. What you could try is look at the Result Document Objects ... Results are read by FreeCAD from the CalculiX result file (*.frd) file and saved in the Documentobjects Displacement and MisesStress. All values are stored in these two objects.

Code: Select all

>>> App.ActiveDocument.Displacement.PropertiesList
['DataType', 'ElementNumbers', 'Label', 'Mesh', 'Unit', 'Values']
>>> App.ActiveDocument.MisesStress.PropertiesList
['DataType', 'ElementNumbers', 'Label', 'Mesh', 'Unit', 'Values']
>>> 
To access a Property use:

Code: Select all

App.ActiveDocument.Displacement.ElementNumbers
App.ActiveDocument.Displacement.Values
You can highlight a nodes by

Code: Select all

Gui.ActiveDocument.Box_Mesh.HighlightedNodes = [NodeIDs]
and if a empty list is used no node is highligted

Code: Select all

Gui.ActiveDocument.Box_Mesh.HighlightedNodes = []
BTW: currently only the MisesStresses are stored inside FreeCAD
Post Reply