[FEM] create NSET/ELSET from GUI?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

[FEM] create NSET/ELSET from GUI?

Postby reox » Mon Nov 13, 2017 6:09 pm

I like to have certain faces/edges of a body as an NSET or ELSET in my input deck file.
Is it possible to create such sets from the GUI?

edit: just found the Node set tool: https://www.youtube.com/watch?v=UtCmciD ... e=youtu.be
But the selected nodes are not in my .inp file? Also I do not understand how I am able to select a face with the tool... Selecting a volume with the poly tools work though.

Here are the steps I do:
* Create a mesh with gmsh, as netgen does not work...
* Go to Node Set
* Select "Surface"
* Select "pick" (I also tried to tick "add", same effect)
* select a node
* console says things like:

Code: Select all

Picked Element:0 Face:1
Picked Element:1425 Face:2
Picked Element:1052 Face:1
* The number of nodes is still 0
* also selecting the object in python console gives set([])

I think there is also a bug: If you say "Surface" in the node set tool but then close the tool, you are stuck with the selection filter until you restart FreeCAD.

Code: Select all

OS: Debian GNU/Linux testing (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12570 (Git)
Build type: None
Branch: master
Hash: b01c503c2cb37b2ed4fb848b0f495f599a7b179f
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Austria (de_AT)
UR_
Posts: 1019
Joined: Tue Jan 03, 2017 8:42 pm

Re: [FEM] create NSET/ELSET from GUI?

Postby UR_ » Mon Nov 13, 2017 11:04 pm

reox wrote:
Mon Nov 13, 2017 6:09 pm
I like to have certain faces/edges of a body as an NSET or ELSET in my input deck file.
I know just one workaround for exporting a NSET, but it's not quick nevertheless dirty :lol:

For example using 3D beam analysis from FreeCAD's startpage.
Constraint displacement generates NSET

Toolbar constraint displacement.png
Toolbar constraint displacement.png (23.54 KiB) Viewed 629 times
selected face.png
selected face.png (8.23 KiB) Viewed 629 times
relax face.png
relax face.png (19.68 KiB) Viewed 629 times

And you will get a .inp-file sequence starting with line 348:

Code: Select all

***********************************************************
** Node sets for prescribed displacement constraint
** written by write_node_sets_constraints_displacement function
** FemConstraintDisplacement
*NSET,NSET=FemConstraintDisplacement
64,
1,
2,
3,
4,
102,
49,
88,
100,
188,
189,
190,
191,
***********************************************************
Better rename NSET to avoid some confusion :lol:


Please delete this sequence, starting with line 399:

Code: Select all

***********************************************************
** Displacement constraint applied
** written by write_constraints_displacement function
** FemConstraintDisplacement
*BOUNDARY
***********************************************************
As promised, not quick but dirty. Hope bernd has a more sophisticated, python based workflow ;)
reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: [FEM] create NSET/ELSET from GUI?

Postby reox » Tue Nov 14, 2017 9:32 am

yes, that was the same thing I thought about before I saw the Node Set tool. But it looks like the Node Set tool needs some extra love and care...

It is also interesting, that a fixed constraint creates a NSET but a CLOAD puts all nodes into the section directly. For a better overview in the file, I would have created a NSET as well...
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 10:43 am

If you need the nset or esets in the inp file the mesh group tool would be the way to go. With this tool you could create mesh groups.

The problem is the inp writer from FreeCAD does not support groups. You could export to unv and use some other software to convert the unv with groups into an inp. Support for groups is on my ToDo but the inp writter is in C++ and my C++ is rather poor.

If you really need it and know Python you may could make this as an extra tool or macro. First write the mesh to the file (one line of Python) and second write the mesh groups by python (code could be copied from constraint writer).

The node set tool is an very old tool which was started before I came to the project but never was finished.

bernd
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 11:36 am

reox wrote:
Tue Nov 14, 2017 9:32 am
It is also interesting, that a fixed constraint creates a NSET but a CLOAD puts all nodes into the section directly. For a better overview in the file, I would have created a NSET as well...
Check the input file of the 3D example. The node loads are different. This because if you apply a face load to a lot of elements faces of the mesh the node loads inside each element are different due to the element notification. Thus for CLOAD the nset is not used.

bernd
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 2:54 pm

The CLOAD vs. DLOAD topic ... https://forum.freecadweb.org/viewtopic.php?f=18&t=10692 I di I did not expect to find it that fast ... Just read posts on the first two pages and you will understand why nset is not used at CLOAD.

Cheers Bernd
reox
Posts: 666
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: [FEM] create NSET/ELSET from GUI?

Postby reox » Tue Nov 14, 2017 2:59 pm

bernd wrote:
Tue Nov 14, 2017 2:54 pm
The CLOAD vs. DLOAD topic ... https://forum.freecadweb.org/viewtopic.php?f=18&t=10692 I di I did not expect to find it that fast ... Just read posts on the first two pages and you will understand why nset is not used at CLOAD.

Cheers Bernd
ah, yes you are right.

for the other things: I'll take a look at the mesh groups and the macro approach. thanks!
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 3:09 pm

reox wrote:
Tue Nov 14, 2017 2:59 pm
for the other things: I'll take a look at the mesh groups and the macro approach. thanks!
If you have any questions just post. Best is to post any question dedicated to FEM in FEM part of the forum.

bernd
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 3:13 pm

write a FEM mesh to inp file by python:
https://github.com/FreeCAD/FreeCAD/blob ... Ccx.py#L80

How to write the groups as sets into the inp file. Best to study the fixed constraint code
https://github.com/FreeCAD/FreeCAD/blob ... Ccx.py#L93 and the method called by this ...
User avatar
bernd
Posts: 8488
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: [FEM] create NSET/ELSET from GUI?

Postby bernd » Tue Nov 14, 2017 4:46 pm

bernd wrote:
Tue Nov 14, 2017 3:13 pm
write a FEM mesh to inp file by python:
https://github.com/FreeCAD/FreeCAD/blob ... Ccx.py#L80

How to write the groups as sets into the inp file. Best to study the fixed constraint code
https://github.com/FreeCAD/FreeCAD/blob ... Ccx.py#L93 and the method called by this ...
Damn the second one is totally wrong because if you use the mesh group tool the mesh groups are inside the mesh in FreeCAD already. Means you do not need to get them again. You just need to get the group data out of the mesh in FreeCAD FEM and write it to the inp file.