Access to nodal results on element by element basis

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
HarryvL
Veteran
Posts: 1338
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Access to nodal results on element by element basis

Post by HarryvL »

Hi, I want to do some post processing for which I need to cycle through the elements of the result mesh and for each element access the element nodal results and nodal coordinates. So not simply run through all nodes, but access them on an element by element basis. How can I best do that? Thanks. Harry
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Access to nodal results on element by element basis

Post by bernd »

load FEM 3D example

Code: Select all

mesh = App.ActiveDocument.Box_Mesh.FemMesh

for v in mesh.Volumes:
    nodes = mesh.getElementNodes(v)
    print('volume: {0} --> nodes: {1}'.format(v, nodes))
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Access to nodal results on element by element basis

Post by bernd »

including the displacement result for each element node ...

Code: Select all

mesh = App.ActiveDocument.Box_Mesh.FemMesh
results = App.ActiveDocument.CalculiX_static_results

for v in mesh.Volumes:
    nodes = mesh.getElementNodes(v)
    print('volume: {0} --> nodes: {1}'.format(v, nodes))
    for n in nodes:
        print('  node: {0} has displacement: {1}'.format(n, results.DisplacementLengths[results.NodeNumbers.index(n)]))
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Access to nodal results on element by element basis

Post by bernd »

ahh mesh should be the result mesh not the input mesh!
User avatar
HarryvL
Veteran
Posts: 1338
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Access to nodal results on element by element basis

Post by HarryvL »

Fantastic Bernd, thanks.

I have an idea of how to visualize stress trajectories in a solid. For this I need to integrate principal stress intensity and direction over the full mesh. That's where I needs this.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Access to nodal results on element by element basis

Post by bernd »

HarryvL wrote: Sun Jun 03, 2018 4:10 pm I have an idea of how to visualize stress trajectories in a solid. For this I need to integrate principal stress intensity and direction over the full mesh. That's where I needs this.
similar to this ? https://forum.freecadweb.org/viewtopic.php?t=24637
User avatar
HarryvL
Veteran
Posts: 1338
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Access to nodal results on element by element basis

Post by HarryvL »

What I have in mind is different in that it plots continuous lines, showing the flow of load from application to support ... more like this:

Trajectories_1.jpg
Trajectories_1.jpg (9.05 KiB) Viewed 1639 times
Trajectories_2.gif
Trajectories_2.gif (32.36 KiB) Viewed 1639 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Access to nodal results on element by element basis

Post by bernd »

cool ... :D
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Access to nodal results on element by element basis

Post by Jee-Bee »

Would this be a kind of vector views?
User avatar
HarryvL
Veteran
Posts: 1338
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: Access to nodal results on element by element basis

Post by HarryvL »

No it would be contour lines. The tangent to the line gives the direction of the principal stress and closeness of the lines gives the stress intensity. It's basically a "stress flow" plot.
Post Reply