Skip to content
Snippets Groups Projects
Commit 5f0e151b authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Disable FPE for reading vtu files

Reading the VTU files can trigger floating point exceptions. Because
we are not debugging VTK (or other libraries) at this point, the
floating point exceptions are temporarily disabled and are restored
at the end of the scope.
parent f4d70c95
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <boost/algorithm/string/erase.hpp> #include <boost/algorithm/string/erase.hpp>
#include "BaseLib/DisableFPE.h"
#include "BaseLib/Logging.h" #include "BaseLib/Logging.h"
#ifdef USE_PETSC #ifdef USE_PETSC
...@@ -62,7 +63,14 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const& file_name) ...@@ -62,7 +63,14 @@ MeshLib::Mesh* VtuInterface::readVTUFile(std::string const& file_name)
vtkSmartPointer<vtkXMLUnstructuredGridReader> reader = vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
vtkSmartPointer<vtkXMLUnstructuredGridReader>::New(); vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
reader->SetFileName(file_name.c_str()); reader->SetFileName(file_name.c_str());
reader->Update(); {
// Reading the VTU files can trigger floating point exceptions. Because
// we are not debugging VTK (or other libraries) at this point, the
// floating point exceptions are temporarily disabled and are restored
// at the end of the scope.
[[maybe_unused]] DisableFPE disable_fpe;
reader->Update();
}
vtkUnstructuredGrid* vtkGrid = reader->GetOutput(); vtkUnstructuredGrid* vtkGrid = reader->GetOutput();
if (vtkGrid->GetNumberOfPoints() == 0) if (vtkGrid->GetNumberOfPoints() == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment