usnistgov / fipy

FiPy is a Finite Volume PDE solver written in Python
http://pages.nist.gov/fipy/en/latest
Other
489 stars 148 forks source link

Is it possible to save the mesh from 'Gmsh3D("something.geo")'? #1003

Closed CalebDmArcher closed 5 months ago

CalebDmArcher commented 5 months ago

Hi,

I am using Gmsh to generate the mesh and use

...
mesh = Gmsh3D("cube.geo")
phi = CellVariable(name="solution variable", mesh=mesh, value=T_ambient)
...

to set up the solution variable.

As my mesh gets finer and finer, it starts to take longer time to generate the mesh so I feel like it is unnecessary to regenerate the mesh. I noticed that Gmsh3D might be a Fipy function. Is it possible to save the results of it somewhere so I can directly use it next time?

guyer commented 5 months ago

When you call Gmsh3D("cube.geo"), the first thing it does is invoke the shell command

gmsh cube.geo -3 -nopopup -format msh2 -smooth 8 -o cube.msh

so, you can do that manually, and then call

mesh = Gmsh3D("cube.msh")