GridapGmsh "GmshDiscreteModel" load error

Hello all,

I encountered some problems when I would like to follow the Gridap tutorials to create a json file.

I have generated a msh file from Gmsh by clicking save_mesh button in it. And I exactly copy the right path and name of the msh file. But here is a LoadError: Msh file not found. This is what I would to mesh:

However, I am not certain whether the msh file is correct since it looks empty without any mesh if I open it from Gmsh directly.

Here is my code:

using Gridap
using Gridap.Io 
using GridapGmsh

model = GmshDiscreteModel("‪C:/Users/15271/Downloads/gmsh-4.8.4-Windows64/gmsh-4.8.4-Windows64/test3.msh")

fn = "model.json"


And if I use

model = DiscreteModelFromFile("‪C:/Users/15271/Downloads/gmsh-4.8.4-Windows64/gmsh-4.8.4-Windows64/test3.msh")

There is: LoadError: This function is not yet implemented

Could any one give some suggestions?
Thank you very much!

Hi @Cyber!

DiscreteModelFromFile only supports json for now, not msh files. Use GmshDiscreteModel instead.

In summary, you have two options:




this one


is not yet implemented, but introducing it should be a matter of a couple of minutes. Just add

function Gridap.DiscreteModelFromFile(filename::AbstractString,::Val{:msh})
  model = GmshDiscreteModel(filename)

here GridapGmsh.jl/GmshDiscreteModels.jl at 4ce1b20399be6f0baaea137f130fe046482b485e · gridap/GridapGmsh.jl · GitHub
and a test here GridapGmsh.jl/GmshDiscreteModelsTests.jl at 4ce1b20399be6f0baaea137f130fe046482b485e · gridap/GridapGmsh.jl · GitHub
and open a PR.

1 Like

Ah! Cool! Thank you kindly! Going to check it out!