From 41650787b1a446f8bd8a6c37fe8df2860f1bb2e4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 29 Oct 2013 09:59:21 +0000 Subject: [PATCH] ENH: mesh tools: max write precision --- .../mesh/advanced/autoRefineMesh/autoRefineMesh.C | 8 ++++---- .../utilities/mesh/conversion/ansysToFoam/ansysToFoam.L | 4 ++-- .../utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C | 2 +- .../conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L | 4 ++-- .../mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L | 4 ++-- .../utilities/mesh/conversion/gambitToFoam/gambitToFoam.L | 4 ++-- .../utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C | 2 +- .../utilities/mesh/conversion/sammToFoam/sammToFoam.C | 2 +- .../utilities/mesh/conversion/star3ToFoam/star3ToFoam.C | 2 +- .../utilities/mesh/conversion/star4ToFoam/star4ToFoam.C | 2 +- .../utilities/mesh/generation/blockMesh/blockMeshApp.C | 2 +- .../utilities/mesh/manipulation/autoPatch/autoPatch.C | 5 ++++- .../utilities/mesh/manipulation/createPatch/createPatch.C | 2 +- .../utilities/mesh/manipulation/flattenMesh/flattenMesh.C | 2 +- .../utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C | 2 +- .../utilities/mesh/manipulation/rotateMesh/rotateMesh.C | 4 ++-- .../utilities/mesh/manipulation/stitchMesh/stitchMesh.C | 2 +- .../mesh/manipulation/transformPoints/transformPoints.C | 2 +- 18 files changed, 29 insertions(+), 26 deletions(-) diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index 2a958b3a3c..c6181aaa21 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -540,7 +540,7 @@ void subsetMesh Info<< "Writing refined mesh to time " << runTime.timeName() << nl << endl; - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); mesh.write(); refLevel.write(); } @@ -909,7 +909,7 @@ int main(int argc, char *argv[]) Info<< " Writing refined mesh to time " << runTime.timeName() << nl << endl; - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); mesh.write(); refLevel.write(); } @@ -980,7 +980,7 @@ int main(int argc, char *argv[]) << endl; // Write final mesh - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); mesh.write(); refLevel.write(); @@ -991,7 +991,7 @@ int main(int argc, char *argv[]) << endl; // Write final mesh. (will have been written already if writeMesh=true) - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); mesh.write(); refLevel.write(); } diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index fc02d83314..e0525a0b61 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -696,7 +696,7 @@ int main(int argc, char *argv[]) // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing polyMesh" << endl; pShapeMesh.write(); diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index e1e4cb5f68..26df789d57 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -747,7 +747,7 @@ int main(int argc, char *argv[]) ); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing polyMesh" << endl; pShapeMesh.write(); diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 54055e8406..1b44415f89 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1417,7 +1417,7 @@ int main(int argc, char *argv[]) mesh.setInstance(runTime.constant()); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< nl << "Writing mesh to " << mesh.objectPath() << endl; mesh.write(); diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index e99ddaccf6..f641763864 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1543,7 +1543,7 @@ int main(int argc, char *argv[]) // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); // Zones diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index dc4531fef6..edd5d7d271 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -862,7 +862,7 @@ int main(int argc, char *argv[]) ); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing polyMesh" << endl; pShapeMesh.write(); diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C index ef5d5fd0a0..c40b5dd16d 100644 --- a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C +++ b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C @@ -256,7 +256,7 @@ int main(int argc, char *argv[]) ); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing polyMesh" << endl; pShapeMesh.write(); diff --git a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C index 8aba0df523..55745b958c 100644 --- a/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C +++ b/applications/utilities/mesh/conversion/sammToFoam/sammToFoam.C @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) sammMesh makeMesh(args[1], runTime, scaleFactor); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing mesh" << endl; makeMesh.writeMesh(); diff --git a/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C b/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C index 6b57de9423..75b6e09edc 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/star3ToFoam.C @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) starMesh makeMesh(args[1], runTime, scaleFactor); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing mesh" << endl; makeMesh.writeMesh(); diff --git a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C index 45491d1bd8..f8e1657e79 100644 --- a/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C +++ b/applications/utilities/mesh/conversion/star4ToFoam/star4ToFoam.C @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) } // increase the precision of the points data - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); // remove extensions and/or trailing '.' const fileName prefix = fileName(args[1]).lessExt(); diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 95b8741e43..9e0fe6d83a 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) } // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< nl << "Writing polyMesh" << endl; mesh.removeFiles(); diff --git a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C index 6ee2ea56a2..359dcdd87f 100644 --- a/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C +++ b/applications/utilities/mesh/manipulation/autoPatch/autoPatch.C @@ -248,8 +248,11 @@ int main(int argc, char *argv[]) { mesh.setInstance(oldInstance); } - mesh.write(); + // Set the precision of the points data to 10 + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); + + mesh.write(); Info<< "End\n" << endl; diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index a2abec368c..6f283d4794 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -872,7 +872,7 @@ int main(int argc, char *argv[]) // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); if (!overwrite) { diff --git a/applications/utilities/mesh/manipulation/flattenMesh/flattenMesh.C b/applications/utilities/mesh/manipulation/flattenMesh/flattenMesh.C index 9be145648f..4d87cf6728 100644 --- a/applications/utilities/mesh/manipulation/flattenMesh/flattenMesh.C +++ b/applications/utilities/mesh/manipulation/flattenMesh/flattenMesh.C @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) twoDCorr.correctPoints(points); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing points into directory " << points.path() << nl << endl; points.write(); diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C index dc4c199a4a..0682682b02 100644 --- a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C +++ b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) ); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing mirrored mesh" << endl; mesh.mirrorMesh().write(); diff --git a/applications/utilities/mesh/manipulation/rotateMesh/rotateMesh.C b/applications/utilities/mesh/manipulation/rotateMesh/rotateMesh.C index 2046e2e700..77822cd06f 100644 --- a/applications/utilities/mesh/manipulation/rotateMesh/rotateMesh.C +++ b/applications/utilities/mesh/manipulation/rotateMesh/rotateMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) points = transform(T, points); // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing points into directory " << points.path() << nl << endl; points.write(); diff --git a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C index 90601e8730..a5ec424e45 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C +++ b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C @@ -472,7 +472,7 @@ int main(int argc, char *argv[]) } Info<< nl << "Writing polyMesh to time " << runTime.timeName() << endl; - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); // Bypass runTime write (since only writes at outputTime) if diff --git a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C index 26900011e9..e5714eeaa8 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C +++ b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C @@ -303,7 +303,7 @@ int main(int argc, char *argv[]) } // Set the precision of the points data to 10 - IOstream::defaultPrecision(10); + IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); Info<< "Writing points into directory " << points.path() << nl << endl; points.write();