[Partially solved] Selected element identification in .inp file

About the development of the FEM module/workbench.

Moderator: bernd

EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

[Partially solved] Selected element identification in .inp file

Post by EkaitzEsteban »

Hello,

I am trying to select a simple element (type C3D10) from Gmsh mesh for changing the material solely to the selected element.

Using the mouse, in the Selection View I can click and check the following elements (e.g.)

SimpleBox.FEMMeshGmsh.Elem0F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F2 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem39F4 (FEMMeshGmsh)

Then using the following python API:

Code: Select all

sel=Gui.Selection.getSelectionEx()
I can check inside sel variable, my selections. (e.g.)

Code: Select all

sel[0].SubElementNames[0]
The output is the name of the selected element as expected,

Code: Select all

Elem0F1
My problem starts here :? . How can I identify this element named, Elem0F1, in the .inp file? Because my first element in the .inp file is 37 and not Elem0F1...

best regards,

Ekaitz.

EDIT: Typing the following in python API, I can print my elements

Code: Select all

sel[0].Object.FemMesh.Volumes
(37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L)
As expected, the first element of my .inp is 37L

However, I still do not know which element is identified with the selected ones.
Last edited by EkaitzEsteban on Fri Oct 05, 2018 6:07 am, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Help] Selected element identification in .inp file

Post by bernd »

would you post a simple example file ...

BTW: what do you need them for?
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Help] Selected element identification in .inp file

Post by Jee-Bee »

EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: [Help] Selected element identification in .inp file

Post by EkaitzEsteban »

bernd wrote: Mon Sep 24, 2018 12:26 pm would you post a simple example file ...

BTW: what do you need them for?
I am exploring and editing manually the .inp file for performing different frequency analyses.

I can attach a simple example file.
Attachments
SimpleBox.FCStd
(9.31 KiB) Downloaded 48 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Help] Selected element identification in .inp file

Post by bernd »

EkaitzEsteban wrote: Mon Sep 24, 2018 10:53 am SimpleBox.FEMMeshGmsh.Elem0F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F2 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem39F4 (FEMMeshGmsh)
- Elem0F1 means Face 1 of element 0
- Elem42F1 means Face 1 of element 42
- Elem42F2 means Face 2 of element 42
- Elem39F4 means Face 4 of element 39

this is generated from Status line code from the index of the selection.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Help] Selected element identification in .inp file

Post by bernd »

FYI:
FreeCAD supports multiple materials too. You may make you model in FreeCAD directly.
EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: [Help] Selected element identification in .inp file

Post by EkaitzEsteban »

bernd wrote: Mon Sep 24, 2018 2:46 pm
EkaitzEsteban wrote: Mon Sep 24, 2018 10:53 am SimpleBox.FEMMeshGmsh.Elem0F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F1 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem42F2 (FEMMeshGmsh)
SimpleBox.FEMMeshGmsh.Elem39F4 (FEMMeshGmsh)
- Elem0F1 means Face 1 of element 0
- Elem42F1 means Face 1 of element 42
- Elem42F2 means Face 2 of element 42
- Elem39F4 means Face 4 of element 39

this is generated from Status line code from the index of the selection.
Thank you Bernd for the info. However, this simplebox have only 24 elements and it starts counting from 37 until 60 as seen here:

Code: Select all

sel[0].Object.FemMesh.Volumes
(37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L)
EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: [Help] Selected element identification in .inp file

Post by EkaitzEsteban »

bernd wrote: Mon Sep 24, 2018 2:48 pm FYI:
FreeCAD supports multiple materials too. You may make you model in FreeCAD directly.
Yes I know, but the final objetive of the project is to manage different custom .inp files from a macro without modifying the structure of the mesh.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [Help] Selected element identification in .inp file

Post by bernd »

24 volume elements, but a volume FEM mesh has edges and faces too. They are just not used for a volume analysis.
EkaitzEsteban
Posts: 108
Joined: Wed Sep 12, 2018 1:31 pm

Re: [Help] Selected element identification in .inp file

Post by EkaitzEsteban »

bernd wrote: Mon Sep 24, 2018 4:25 pm 24 volume elements, but a volume FEM mesh has edges and faces too. They are just not used for a volume analysis.
Thank you for your annotation.

best regards,
Ekaitz.
Post Reply