From 9de3a4280e57a162d38f1c136467327013701592 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Tue, 19 Jan 2016 16:28:23 +0000
Subject: [PATCH] foamToVTK: Default to ASCII format when WM_LABEL_SIZE=64
 Based on patch provided by Alexey Matveichev Resolves bug-report
 http://www.openfoam.org/mantisbt/view.php?id=1975

---
 .../dataConversion/foamToVTK/foamToVTK.C      | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
index b11a5c9c685..a9b1390bb82 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -324,18 +324,19 @@ int main(int argc, char *argv[])
     const bool doWriteInternal = !args.optionFound("noInternal");
     const bool doFaceZones     = !args.optionFound("noFaceZones");
     const bool doLinks         = !args.optionFound("noLinks");
-    const bool binary          = !args.optionFound("ascii");
+    bool binary                = !args.optionFound("ascii");
     const bool useTimeName     = args.optionFound("useTimeName");
 
-    // decomposition of polyhedral cells into tets/pyramids cells
+    // Decomposition of polyhedral cells into tets/pyramids cells
     vtkTopo::decomposePoly     = !args.optionFound("poly");
 
     if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4))
     {
-        FatalErrorInFunction
-            << "floatScalar and/or label are not 4 bytes in size" << nl
-            << "Hence cannot use binary VTK format. Please use -ascii"
-            << exit(FatalError);
+        WarningInFunction
+            << "Using ASCII rather than binary VTK format because "
+               "floatScalar and/or label are not 4 bytes in size."
+            << nl << endl;
+        binary = false;
     }
 
     const bool nearCellValue = args.optionFound("nearCellValue");
@@ -429,7 +430,7 @@ int main(int argc, char *argv[])
     mkDir(fvPath);
 
 
-    // mesh wrapper; does subsetting and decomposition
+    // Mesh wrapper; does subsetting and decomposition
     vtkMesh vMesh(mesh, cellSetName);
 
 
@@ -680,9 +681,7 @@ int main(int argc, char *argv[])
 
         if (doWriteInternal)
         {
-            //
             // Create file and write header
-            //
             fileName vtkFileName
             (
                 fvPath/vtkName
-- 
GitLab