Creating a group of nodes for a volume

About the development of the FEM module/workbench.

Moderator: bernd

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

Creating a group of nodes for a volume

Post by sodelo »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Creating a group of nodes for a volume

Post by bernd »

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 93 times
screen.jpg
screen.jpg (461.45 KiB) Viewed 2498 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Creating a group of nodes for a volume

Post by bernd »

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: 73
Joined: Tue Jan 24, 2017 9:20 am

Re: Creating a group of nodes for a volume

Post by sodelo »

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

Re: Creating a group of nodes for a volume

Post by bernd »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Creating a group of nodes for a volume

Post by bernd »

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
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Creating a group of nodes for a volume

Post by ulrich1a »

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: 73
Joined: Tue Jan 24, 2017 9:20 am

Re: Creating a group of nodes for a volume

Post by sodelo »

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

Re: Creating a group of nodes for a volume

Post by bernd »

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
Post Reply