View Issue Details

IDProjectCategoryView StatusLast Update
0003149OpenFOAMPatchpublic2019-01-16 11:07
Reportertniemi Assigned Tohenry  
PrioritylowSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003149: Add support for VTK-files with METADATA
DescriptionThe recent versions of Paraview can add METADATA-tags to VTK files when saving eg. feature edges. These tags confuse the vtk-reader and prevent using the feature edges in snappy unless the tags are manually removed.

I have added a lightweight patch, which allows vtkUnstructuredReader to skip METADATA-blocks. According to (https://vtk.org/doc/nightly/html/IOLegacyInformationFormat.html), a METADATA-block is terminated by empty line, so the patch just reads lines until a next empty one is found.
TagsNo tags attached.

Activities

tniemi

2019-01-13 11:50

reporter  

patch.diff (774 bytes)   
diff --git a/src/fileFormats/vtk/vtkUnstructuredReader.C b/src/fileFormats/vtk/vtkUnstructuredReader.C
index 1f8d42e..110ddb3 100644
--- a/src/fileFormats/vtk/vtkUnstructuredReader.C
+++ b/src/fileFormats/vtk/vtkUnstructuredReader.C
@@ -907,6 +907,19 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
                 }
             }
         }
+        else if (tag == "METADATA")
+        {
+            // Read rest of the line
+            string line;
+            inFile.getLine(line);
+
+            // Skip until an empty line is found
+            inFile.getLine(line);
+            while (!line.empty())
+            {
+                inFile.getLine(line);
+            }
+        }
         else
         {
             FatalIOErrorInFunction(inFile)
patch.diff (774 bytes)   

henry

2019-01-16 10:05

manager   ~0010256

Thanks Timo,

Resolved in OpenFOAM-dev by commit 18cda8d02c00824ec9fc07490eef4907851dc580

Issue History

Date Modified Username Field Change
2019-01-13 11:50 tniemi New Issue
2019-01-13 11:50 tniemi File Added: patch.diff
2019-01-16 10:05 henry Assigned To => henry
2019-01-16 10:05 henry Status new => resolved
2019-01-16 10:05 henry Resolution open => fixed
2019-01-16 10:05 henry Fixed in Version => dev
2019-01-16 10:05 henry Note Added: 0010256