WriteError: Specify entity information to deal with more than one cell type Preparing mesh and boundary files for Fenicsįalling back to gmsh format version 2.2, I could generate the mesh and boundary files like in the original post: outfile_mesh = f" > 611 "Specify entity information to deal with more than one cell type" usr/local/lib/python3.6/dist-packages/meshio/gmsh/_gmsh41.py in _write_nodes(fh, points, cells, point_data, float_fmt, binary) > 358 _write_nodes(fh, mesh.points, mesh.cells, mesh.point_data, float_fmt, binary)ģ59 _write_elements(fh, cells, tag_data, binary) usr/local/lib/python3.6/dist-packages/meshio/gmsh/_gmsh41.py in write(filename, mesh, float_fmt, binary)ģ57 _write_entities(fh, cells, tag_data, mesh.cell_sets, mesh.point_data, binary) > 102 writer.write(filename, mesh, binary=binary, float_fmt=float_fmt) usr/local/lib/python3.6/dist-packages/meshio/gmsh/main.py in write(filename, mesh, fmt_version, binary, float_fmt) > 146 return writer(filename, mesh, **kwargs) usr/local/lib/python3.6/dist-packages/meshio/_helpers.py in write(filename, mesh, file_format, **kwargs) > 160 write(path_or_buf, self, file_format, **kwargs) usr/local/lib/python3.6/dist-packages/meshio/_mesh.py in write(self, path_or_buf, file_format, **kwargs) > 15 mesh.write("test.msh", file_format="gmsh") WriteError Traceback (most recent call last)ġ3 # with writing nodes in the format version 4.1 here, that I cannot The second problem was writing the generated mesh to a gmsh format version 4.1, which resulted in an error message I could not quite track back: > mesh.write("test.msh", file_format="gmsh") # That's gmsh41 In gmsh’s API they were there as the first four one-dimensional items (although without the tutorial file there would have been no way I could have guessed that). So, here’s the first oddity I would not get my head around: There seems to be no easy way to access the boundaries of the rectangle generated with the OpenCASCADE kernel. Mesh.write("test.msh", file_format="gmsh22") # with writing nodes in the format version 4.1 here, that I cannot figure out # We'll use gmsh format version 2.2 here, as there's a problem # OpenCascade in pygmsh seems not to support extraction of lines from a rectangle (. Generate the mesh using pygmsh import pygmsh I got it to work eventually, so here are the code blocks. Using pygmsh with physical labels and Fenics is a bit unclear to me. Well, I seem to not get it, but at least I did not manage to show that. So, I thought, let’s do the article on Meshio>=4.0.0 and Fenics and show how interchangeable the gmsh itself, gmsh Python API, and pygmsh are. Package versions this was tested with ():
0 Comments
Leave a Reply. |