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

problem when load msh file #1035

Open bladesaber opened 2 months ago

bladesaber commented 2 months ago

Hello everyone:

  1. When I load an msh file created by the GMSH package through Fipy.Gmsh2D class, it throws an error below: Screenshot from 2024-05-06 17-41-15 The related file is provided here: mesh_files.zip

  2. Is it possible to use the physical group ID of the msh file in Fipy?Gmsh2D?

  3. How can I interpolate the value of some specific points?

Thanks for the whole work and looking forward to your response. Best regards.

bladesaber commented 2 months ago

And is it possible to directly change the vertex coordinate of a mesh and simulate it again?

guyer commented 2 months ago
  • When I load an msh file created by the GMSH package through Fipy.Gmsh2D class, it throws an error below:

FiPy is only able to read MSH file format 2. The .msh file you have here is version 4.1

You can load the .geo file, though:

mesh = fp.Gmsh2D("model.geo")
  • Is it possible to use the physical group ID of the msh file in Fipy?Gmsh2D?

Labeled cells are available as mesh.physicalCells and labeled faces as mesh.physicalFaces, e.g.,

cellvar = fp.CellVariable(mesh=mesh)
cellvar.setValue(1., where=mesh.physicalCells['surface1'])

inflow1 = fp.FaceVariable(mesh=mesh, rank=1, value=mesh.faceNormals * mesh.physicalFaces['inflow1'])

See the help for Gmsh2D for more information.

guyer commented 2 months ago

Please ask your other two questions separately, preferably as a Discussion.

guyer commented 2 months ago

FiPy is only able to read MSH file format 2. The .msh file you have here is version 4.1

FWIW, this doesn't seem to be documented anywhere. We need to fix that.

bladesaber commented 2 months ago

Thank you

guyer commented 2 months ago

Reopening until we address the documentation issue