vtkUnstructuredToFoam add read patches/regions capability
Functionality to add/problem to solve
Adding the possibility to read the boundaries of a vtk mesh imported using vtkUnstructuredToFoam
Target audience
everyone who needs to import meshes to FOAM. the legacy vtk format is quite old, true, nevertheless, it is still used by several libraries and programs, and it is a quite simple format.
Proposal
vtk format has a classification of the elements types such as it is shown in the following .vtk example and it is consisted of the following information:
POINTS #(list of all the vertexes internal and external of the mesh)
x0,y0,z0
x1,y1,z1
....
CELLS #(list of "cells" that can be nodes, edges, faces, volumetric cells)
nPoints0 p0 p1 p2
nPoints1 p1 p2 p3
....
CELL_TYPES #(indicates the type of element of the previous list such as if a 4 1 2 3 4 (a 'cell' in CELLS with 4 elements using the points 1, 2, 3 and 4) can be classified as a quadrangle face or a pyramid)
type0
type1
....
CELL_DATA #(is used to classify the CELLS in different groups, boundaries, regions etc)
scalar0
scalar1
.....
right now, OF when using vtkUnstructuredToFoam, it does not 'read' the information of CELL_DATA, it imports the mesh but all the faces goes to a defaultPatch. The feature request would be to use the CELL_DATA to reconstruct the patches from this information, even if the name of the boundary is simply the str(scalar)... to make 'usable' this format.
What does success look like, and how can we measure that?
importing the vtk mesh I post it in this issue and getting the boundaries
Links / references
here is information about the vtk format: https://www.princeton.edu/~efeibush/viscourse/vtk.pdf
here is an old importer of vtk to FOAM: https://github.com/edwardsp/VTKToFoam/blob/master/VTKToFoam.py
and here is a mesh example: test.vtk
Funding
no funding sadly.