Skip to content

Fix reader for empty views in msh v2 files

Michel Rasquin requested to merge fixEmptyViews into master

An issue with our ParaView plugin has been encountered when

  • multiple views characterized by the same name but with different interpolation schemes are present in the msh solution files,
  • some of these views have zero data (referred as empty views hereafter)
  • the msh v2 format uses one file per partition.

This situation occurs for instance when variable order is used in our simulation with Argo. In this case, all our msh files will always include a view for all order present in the whole domain, resulting in empty views in almost all distributed files since very few partitions include all order at the same time.

The fix proposed in this merge request consists in encapsulating the msh file reader PView::readMSH implemented in PViewIO.cpp with a simple "if(numEnt >0) { ... }".

Without this fix, the issue is located in the series of if statements in the function PView::getViewByName(), which checks the matching between the name of the views but not the matching between interpolation schemes (keep in mind our views have the same name although they are associated with a different pieces of the mesh with different interpolation schemes). A test on the interpolation scheme could also be added in PView::getViewByName() for safety but the reader PView::readMED() also uses PView::getViewByName() without constructing any interpolation scheme so I do not want to make this function more complex than it should. Indeed, if only non-empty views with the same name enter the routine PView::getViewByName() called from PViewIO.cpp, then the test (!list[i]->getData()->hasTimeStep(timeStep)) will be sufficient since PViewDataGModel::hasTimeStep(int step) also checks whether _steps[step] already include data or not (see PViewDataGModel.cpp#831: "if(step >= 0 && step < getNumTimeSteps() && _steps[step]->getNumData())"). Existing views with the same name are therefore preserved as long as they are not empty. Without the proposed fix, empty views however can get a wrong interpolation scheme.

Thank you

Michel

Merge request reports