mesh region
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
mesh region
Taking advantage of your kindness, I have a last question. I've read in another topic that there is a command in freecad to add physical groups in the mesh with "make mesh region" to provide a mesh to use directly with calculix. As calculix does have a set of peculiar FEM cases available (eletromagnetic study, dynamic, etc) is that true? Is there a guide/tutorial everywhere to read to do that, as I can't find it on the wiki?
Last edited by ElMastro on Thu Jun 27, 2019 3:43 pm, edited 1 time in total.
Re: FEM doesn't work anymore
Maybe start here: https://forum.freecadweb.org/viewtopic. ... 18&t=26517 ?
"fight the good fight"
Re: mesh region
you need to create mesh groups not mesh regions. Export the mesh with groups to inp mesh file format.
Re: mesh region
I tried it, but seems different from what I want to do.Maybe start here: https://forum.freecadweb.org/viewtopic. ... 18&t=26517 ?
Let's say
[*] I create a cube
[*] In FEM, create analysis, mesh with gmsh
[*] Mesh Group, I create two groups
[*] Select everything, export to /tmp/Mesh.inp
Opening in Calculix it doesn't find the Mesh groups.
I doesn't understand where I'm wrong.
In python console, the output is
Code: Select all
Python 3.7.3 (default, Jun 24 2019, 04:54:02)
[GCC 9.1.0] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> App.newDocument("Senza nome")
>>> App.setActiveDocument("Senza_nome")
>>> App.ActiveDocument=App.getDocument("Senza_nome")
>>> Gui.ActiveDocument=Gui.getDocument("Senza_nome")
>>> Gui.activeDocument().activeView().viewDefaultOrientation()
>>> Gui.activateWorkbench("PartWorkbench")
>>> App.ActiveDocument.addObject("Part::Box","Box")
>>> App.ActiveDocument.ActiveObject.Label = "Cubo"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> Gui.activateWorkbench("FemWorkbench")
>>> import FemGui
>>> import ObjectsFem
>>> ObjectsFem.makeAnalysis(FreeCAD.ActiveDocument, 'Analysis')
>>> FemGui.setActiveAnalysis(FreeCAD.ActiveDocument.ActiveObject)
>>> ObjectsFem.makeSolverCalculixCcxTools(FreeCAD.ActiveDocument)
>>> FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)
>>> ObjectsFem.makeMeshGmsh(FreeCAD.ActiveDocument, 'FEMMeshGmsh')
>>> FreeCAD.ActiveDocument.ActiveObject.Part = FreeCAD.ActiveDocument.Box
>>> FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)
>>> FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
>>> ObjectsFem.makeMeshGroup(FreeCAD.ActiveDocument, FreeCAD.ActiveDocument.FEMMeshGmsh)
>>> FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
>>> ObjectsFem.makeMeshGroup(FreeCAD.ActiveDocument, FreeCAD.ActiveDocument.FEMMeshGmsh)
>>> FreeCADGui.ActiveDocument.setEdit(FreeCAD.ActiveDocument.ActiveObject.Name)
>>> __objs__=[]
>>> __objs__.append(FreeCAD.getDocument("Senza_nome").getObject("FEMMeshGmsh"))
>>> __objs__.append(FreeCAD.getDocument("Senza_nome").getObject("FEMMeshGroup001"))
>>> __objs__.append(FreeCAD.getDocument("Senza_nome").getObject("FEMMeshGroup"))
>>> import Fem
>>> Fem.export(__objs__,u"/tmp/Mesh.inp")
>>>
>>> del __objs__
>>>
Code: Select all
FreeCAD 0.19, Libs: 0.19R17105 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
connect failed: File o directory non esistente
Active analysis found: Analysis
TypeError: Can't call meta function because I have no idea how to handle Base::Quantity
TypeError: Can't call meta function because I have no idea how to handle Base::Quantity
Active analysis found: Analysis
We are going to start Gmsh FEM mesh run!
Part to mesh: Name --> Box, Label --> Cubo, ShapeType --> Solid
CharacteristicLengthMax: 1e+22
CharacteristicLengthMin: 0.0
ElementOrder: 2
ElementDimension: 3
/tmp/Box_Geometry.brep
/tmp/Box_Mesh_TmpGmsh.unv
/tmp/shape2mesh.geo
/usr/bin/gmsh
Group meshing for analysis.
The Part should have a pretty new FEM mesh!
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Single click on a Solid, Face, Edge, Vertex will add it to the list!
selection: Solid Box Face6
Single click on a Solid, Face, Edge, Vertex will add it to the list!
selection: Solid Box Face5
Re: mesh region
would you attach the FreeCAD file and the inp file. On the inp file you may need to attach a .txt for upload.
Re: mesh region
Hope it is ok like this, or I'll attach it as *.txt
Re: mesh region
Check your “Edit -> Preferences -> Import-Export -> Abaqus INP” where “Export group data” should be checked.ElMastro wrote: ↑Thu Jun 27, 2019 3:51 pm I tried it, but seems different from what I want to do.
Let's say
[*] I create a cube
[*] In FEM, create analysis, mesh with gmsh
[*] Mesh Group, I create two groups
[*] Select everything, export to /tmp/Mesh.inp
Opening in Calculix it doesn't find the Mesh groups.
When I created objects in your order, I did not get mesh groups. Inp file contained at the file end
But no group data were there.** Group data
But if I updated mesh, then export works and nsets and elsets are there. So mesh groups seems to be "empty" until mesh is generated (apply button in Mesh object) with FEMMeshGroup defined by a user.
BTW:
When I had in preferences “Which mesh elements to export = Highest” I got volume mesh only (no face nor edge elements) as expected, but for mesh groups I got also
Code: Select all
** GroupID: 3 --> GroupName: FEMMeshGroup001_Faces --> GroupElementType: Face
*ELSET, ELSET=FEMMeshGroup001_Faces
5
6
7
Which seems to crate elset from face elements which does not exist in the exported inp file. Similarly, if I create mesh group from geometry edge, it will export non-existing edge elements. That would probably give an error in ccx.
Re: mesh region
fandaL, I can fully confirm.
With the method described by you, in the *.inp the groups (withe their names) are added, however loading it with calculix a MsgBox appears telling
With the method described by you, in the *.inp the groups (withe their names) are added, however loading it with calculix a MsgBox appears telling
and after it refuses of loading all groups.Access violation.
Press OK to ignore and risk data corruption.
Press Cancel to kill the program.
Re: mesh region
What programm do you use to load the file? AFIK calculix can not load a file, it only can run a file. Furthermore calculix does not have a gui with message boxes AFIK.