diff --git a/FileIO/ImportFileTypes.h b/FileIO/ImportFileTypes.h index 449092e3a08cfdefbe5c07d28628b4333f2a6d7f..9b4551ee02413d3e141ce2043e1f2824bf2a551d 100644 --- a/FileIO/ImportFileTypes.h +++ b/FileIO/ImportFileTypes.h @@ -62,7 +62,7 @@ public: else if (t==ImportFileType::NETCDF) return "NetCDF files (*.nc)"; else if (t==ImportFileType::OGS) - return "Geosys files (*.gsp *.gli *.gml *.msh *.stn);;Project files (*.gsp);;GeoSys FEM Conditions (*.cnd *.bc *.ic *.st);;GLI files (*.gli);;MSH files (*.msh);;STN files (*.stn);;All files (* *.*)"; + return "OpenGeosys files (*.gsp *.gml *.vtu *.stn);;GeoSys legacy files (*.gli *.msh);;GeoSys FEM Conditions (*.cnd *.bc *.ic *.st);;All files (* *.*)"; else if (t==ImportFileType::PETREL) return "Petrel files (*)"; else if (t==ImportFileType::RASTER) diff --git a/FileIO/XmlIO/VTKInterface.cpp b/FileIO/XmlIO/VTKInterface.cpp index 710a6db67e4fb92811af15a092efa00ec0f1b87d..d706be51d0fa0488a33ab32b4e4003d9fc5fc5ec 100644 --- a/FileIO/XmlIO/VTKInterface.cpp +++ b/FileIO/XmlIO/VTKInterface.cpp @@ -82,7 +82,9 @@ MeshLib::Mesh* VTKInterface::readVTUFile(const std::string &file_name) std::vector<unsigned> cell_types(nElems); const rapidxml::xml_node<>* mat_id_node (piece_node->first_node("CellData")->first_node("DataArray")); - if (mat_id_node && (std::string(mat_id_node->first_attribute("Name")->value()).compare("MaterialIDs") == 0)) + if (mat_id_node && + ((std::string(mat_id_node->first_attribute("Name")->value()).compare("MaterialIDs") == 0) || + (std::string(mat_id_node->first_attribute("Name")->value()).compare("MatGroup") == 0))) { if (std::string(mat_id_node->first_attribute("format")->value()).compare("ascii") == 0) { @@ -96,7 +98,9 @@ MeshLib::Mesh* VTKInterface::readVTUFile(const std::string &file_name) const rapidxml::xml_node<>* points_node (piece_node->first_node("Points")->first_node("DataArray")); - if (points_node && (std::string(points_node->first_attribute("Name")->value()).compare("Points") == 0)) + // This _may_ have an attribute "Name" with the value "Points" but you cannot count on it. + // However, there shouldn't be any other DataArray nodes so most likely not checking the name isn't a problem. + if (points_node) { if (std::string(points_node->first_attribute("format")->value()).compare("ascii") == 0) {