Using FEM wb API facilities to pass a GEO file to Gmsh.

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by keithsloan52 »

My understanding is that FEM workbench passes GEO files to Gmsh.
Using an API is it possible to pass a general GEO file to Gmsh and have Gmsh process the contents of the GEO file?
If yes what are the options for the data returned?
Where can I find more info?

Thanks
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by johnwang »

No API needed.

Just send the gmsh command string.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by keithsloan52 »

johnwang wrote: Tue Nov 30, 2021 11:30 pm No API needed.

Just send the gmsh command string.
But I want to run a whole series of commands.

For example take some of the tutorials https://gitlab.onelab.info/gmsh/gmsh/tr ... r/tutorial
I want to take some examples and modify and be able to get the geo file invoked from a PROGAM or are you saying
there is a gmsh command to run a geo file. In which case how can I send such a command from my application
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by keithsloan52 »

Gmsh tutorial 13 is a Geo file for Remeshing an STL file https://gmsh.info/doc/texinfo/gmsh.html#t13
// -----------------------------------------------------------------------------
//
// Gmsh GEO tutorial 13
//
// Remeshing an STL file without an underlying CAD model
//
Could one use this to take an STL file and reMesh ( Volume I assume ) for FEM anaylsis, rather than just try to Gmsh a Mesh imported from an STL file. i.e. Would taking an STL file, preserve boundaries and then Re-meshing, potentially get better results?

If one has a suitable geo file, can one invoke this from FreeCAD rather than have to fire up Gmsh Gui?
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by johnwang »

Gmsh can run without gui.
Open a terminal, run:
Gmsh - help
To see what gmsh takes in and output what.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: Using FEM wb API facilities to pass a GEO file to Gmsh.

Post by keithsloan52 »

johnwang wrote: Sat Dec 04, 2021 10:56 am Gmsh can run without gui.
Open a terminal, run:
Gmsh - help
To see what gmsh takes in and output what.
Yes yes I know that, but what I am after is a way to call it from a FreeCAD program/workbench.
I know the FEM workbench invokes it by passing files etc, so how can I do likewise and the get it to read in geo file and action the commands
Post Reply