Open s1291 opened 4 years ago
Does the --prune-z-0
flag help?
The output file looks better, though I haven't attempted to open it in Ansys.
@gdmcbain Thank you for the suggestion I forgot about it. Unfortunately that didn't work too. I got the following error from Ansys Fluent:
Cell ID 0 out of declared range (1<=id<=4).
Cell ID 5 out of declared range (1<=id<=4).
Reading Cells: failed while reading section 12.
Clearing partially read grid.
Error: Read_Grid_Section: Aborted due to critical error.
Error Object: #f
@MuellerSeb is the master of RECTILINEAR_GRID
s.
Sorry, I have totally missed this Issue. Quite busy ATM. Maybe I can have a look at this later.
Having a second look at this, I don't think, this is a problem at the VTK side, since in VTK all grids are described by 3D points. The problem is on the ansys side, where there needs to be a check if the mesh is a flat 2D one, so it could be converted to a real 2D mesh. But even that is hard, since it is not determined by the cell types (which could be easily checked), since a mesh could contain only 2D cell-types but is representing a curved surface in space.
Oh I see, that apparently meshio stores 2D meshes explicitly with only 2D points. So I could truncate the points list in 2D and it should work.
Then the next question is: what about 1D meshes? This wouldn't be catched by the line above. Are they also handled separately by some routines? @nschloe
@s1291 as a workaround, you could truncate the points-dimension by hand:
import meshio
mesh = meshio.read("rect2d.vtk")
mesh.points = mesh.points[:, :2]
meshio.write("rect2d.msh", mesh, file_format="ansys-ascii")
I got a very similar error as @s1291 when using the following script to export a msh22 file to ansys.
import meshio
mesh = meshio.read("corner_2.msh")
mesh.points = mesh.points[:, :2]
meshio.write("corner_2_fluent.msh", mesh, file_format="ansys", binary=False)
The error I got from ansys fluent is
Buffering for file scan...
3801 nodes.
Cell ID 0 out of declared range (1<=id<=2).
Cell ID 3599 out of declared range (1<=id<=2).
The msh22 mesh is attached here: corner_2.zip
I am trying to convert this basic 2D vtk mesh to ansys using meshio 3.2.14. the file
rect2d.vtk
:Because if the vtk mesh is 2D, meshio pads a zero third component to the mesh. To convert it to ansys format:
the result is a 3d mesh.
2d
checked), I get the following error:3d
option in Ansys Fluent, I get the following error:The output file (
.msh
file) attached here: