How to know the type for VTU file

Hello everyone,

So far I’ve used vtkDataReader class for vtk file in order to know if vtk file was Rectilineargrid,UnstructuredGrid or StructuredGrid by doing this test


vtkDataReader GlobalReader = vtkDataReader.New();
GlobalReader.SetFileName(VTKFilePath);
if (GlobalReader.IsFileRectilinearGrid() == 1)
{
//use vtkRectilinearGridReader
}
else if (GlobalReader.IsFileUnstructuredGrid() == 1)
{
//use vtkUnstructuredGridReader
}
else if (GlobalReader.IsFileStructuredGrid() == 1)
{
//use vtkStructuredGridReader
}

However vtkDataReader cannot be used for vtu file (unrecognized file type error raise)

Is there an equivalent of vtkDataReader for vtu file so I can know if I have to use vtkXMLUnstructuredGridReader, vtkXMLRectilinearGridReader or vtkXMLStructuredGridReader?

I really thank you in advance for your help

VTU stand for VTk Unstructured grid, no need to test anything.

thank you very much for your help.