Getting the location of a specific element or node

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
sodelo
Posts: 73
Joined: Tue Jan 24, 2017 9:20 am

Getting the location of a specific element or node

Post by sodelo »

Hi,

For relatively complex simulation (eg non linear with contact), a convergence issues is related to a particular element or node.
Is there a way to highlight (showing where it is located) a node or element by its label?

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

Re: Getting the location of a specific element or node

Post by bernd »

not with gui.

- start FreeCAD, load FEM3Dexample from StartWB
- run code

Code: Select all

mesh_obj = App.ActiveDocument.Box_Mesh
mesh_obj.FemMesh.Volumes
aVolume = mesh_obj.FemMesh.getElementNodes(149)
Gui.ActiveDocument.Box_Mesh.HighlightedNodes = list(aVolume)

Code: Select all


# reset
Gui.ActiveDocument.Box_Mesh.HighlightedNodes = [0]
Watch status line if you move with your mouse over faces, edges, nodes of a FEM mesh
sodelo
Posts: 73
Joined: Tue Jan 24, 2017 9:20 am

Re: Getting the location of a specific element or node

Post by sodelo »

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

Re: Getting the location of a specific element or node

Post by bernd »

Export the mesh to unv and open the mesh in GMSH GUI is what I do if FreeCAD is at his End in this regard ...
fandaL
Posts: 440
Joined: Thu Jul 24, 2014 8:29 am

Re: Getting the location of a specific element or node

Post by fandaL »

It's crazy that I didn't mention sooner that in FreeCAD writes on the bottom what is preselected by mouse.

Some time ago I wrote short macro for labeling element and node numbers - it creates label objects so it is unusable for big meshes. Now I put it together with some other pieces of code and experimented with gui.
https://github.com/fandaL/FreeCAD_macro ... mLabels.py
You can try it, but do not use if for whole mesh if it has more nodes (elements).
macro_FemLabels.png
macro_FemLabels.png (56.15 KiB) Viewed 1214 times
Post Reply