CDI reader crashes when loading grid with quad cells
The CDI reader crashes paraview when loading a netcdf with grid cells with 4 vertices per cell, because in vtkCDIReader::ConstructGridGeometry() there is one division by 3 instead of dividing by the number of vertices per cell in line 1730 of the CDIReader plugin
this->NumberLocalCells = floor(new_cells[0] / 3.0);
can be fixed by dividing by PointsPerCell
this->NumberLocalCells = new_cells[0] / this->PointsPerCell;
The floor()
can be omitted as this is integer division.
NetCDF file with a few grid cells that crashes paraview without the bugfix
I'll file a merge request after submitting this issue.