Commit 41650787 authored by mattijs's avatar mattijs
Browse files

ENH: mesh tools: max write precision

parent 95c06af8
......@@ -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();
}
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment