Creating a group of nodes for a volume

About the development of the FEM module/workbench.
sodelo
Posts: 71
Joined: Tue Jan 24, 2017 9:20 am

Creating a group of nodes for a volume

Postby sodelo » Mon Mar 20, 2017 7:01 pm

Is there a simple way to define a Boundary conditions for a group of nodes related to a volume?
I tried different ways without success (Fem Mesh Group or Node Sets). In the end, I do not find the node set in the Input file.

Thanks,

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

Re: Creating a group of nodes for a volume

Postby bernd » Mon Mar 20, 2017 7:18 pm

The material object has it. All other objects only uses faces, edges or vertices. See attached multi body analysis. The inp file has two volume element sets:

*ELSET,ELSET=SolidMaterialSolid
...
*ELSET,ELSET=SolidMaterial001Solid
...

multibody.fcstd
(352.54 KiB) Downloaded 3 times

screen.jpg
screen.jpg (461.45 KiB) Viewed 133 times
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Creating a group of nodes for a volume

Postby bernd » Mon Mar 20, 2017 7:24 pm

sodelo wrote:Is there a simple way to define a Boundary conditions for a group of nodes related to a volume?
I tried different ways without success (Fem Mesh Group or Node Sets). In the end, I do not find the node set in the Input file.
The problem is, the inp exporter does not support mesh groups. the mesh group object is mainly used by people working with FEM meshes exported to med and unv. These both exporter does support groups. We really need to get the inp writer support groups and mixed meshes. Ahh see viewtopic.php?p=162988#p162988

The node sets (defined with the node set tool) are not used by any other tool, as far as I know.
sodelo
Posts: 71
Joined: Tue Jan 24, 2017 9:20 am

Re: Creating a group of nodes for a volume

Postby sodelo » Mon Mar 20, 2017 7:42 pm

Thanks for the information.
So there is no simple workaround since I need a node set and not an element set.
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Creating a group of nodes for a volume

Postby bernd » Mon Mar 20, 2017 7:54 pm

sodelo wrote:Thanks for the information.
So there is no simple workaround since I need a node set and not an element set.
Not with the gui, but you can get the nodes by python quite easy ...

- open the file I posted earlier
- run the code ...

Code: Select all

mysolid = App.ActiveDocument.CompoundFilter.Shape.Solids[0]
mymesh = App.ActiveDocument.CompoundFilter_Mesh.FemMesh
yournodes = mymesh.getNodesBySolid(mysolid)

yournodes will be a list of the nodes you need ...
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Creating a group of nodes for a volume

Postby bernd » Mon Mar 20, 2017 8:02 pm

to write them to file use:

Code: Select all

filename = '/tmp/yournodes.inp'
f = open(filename, "wb")
f.write("*NSET,NSET=yournodeset\n")
for n in yournodes:
    f.write(str(n) + ",\n")

f.close()
ulrich1a
Posts: 1377
Joined: Sun Jul 07, 2013 12:08 pm

Re: Creating a group of nodes for a volume

Postby ulrich1a » Mon Mar 20, 2017 8:14 pm

sodelo wrote:So there is no simple workaround since I need a node set and not an element set.
I have used cgx for this purpose. Open the inp-file inside of cgx, for example the Box_mesh.inp which you get from the FreeCAD FEM-samples:

Code: Select all

cgx -c Box_mesh.inp

The command

Code: Select all

prnt se
lists all sets. An element set can be upgraded to also contain its nodes with the command

Code: Select all

comp Eall do
This adds all nodes to the element set Eall. Now the nodes (and the elements) can be written to a file, which can be included into the inp-file:

Code: Select all

send Eall abq names
This gives a file Eall.nam, which contains a node set and an element set. Include this file into your inp-file.

Ulrich
sodelo
Posts: 71
Joined: Tue Jan 24, 2017 9:20 am

Re: Creating a group of nodes for a volume

Postby sodelo » Tue Mar 21, 2017 6:58 am

Thanks to both of you for your help.
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Creating a group of nodes for a volume

Postby bernd » Tue Mar 21, 2017 7:21 am

since there are so many constraints we gone not support, we may add an generic constraint object, similar to the mesh region object, but directly dedicated to the analysis.

bernd