mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: vtkSurfaceWriter: user-specifiable precision.
Partly solves #65. Ensight writer is fixed but all the other ones probably need doing as well.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -31,6 +31,7 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
makeSurfaceWriterType(vtkSurfaceWriter);
|
||||
addToRunTimeSelectionTable(surfaceWriter, vtkSurfaceWriter, wordDict);
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +203,22 @@ namespace Foam
|
||||
|
||||
Foam::vtkSurfaceWriter::vtkSurfaceWriter()
|
||||
:
|
||||
surfaceWriter()
|
||||
surfaceWriter(),
|
||||
writePrecision_(IOstream::defaultPrecision())
|
||||
{}
|
||||
|
||||
|
||||
Foam::vtkSurfaceWriter::vtkSurfaceWriter(const dictionary& dict)
|
||||
:
|
||||
surfaceWriter(),
|
||||
writePrecision_
|
||||
(
|
||||
dict.lookupOrDefault
|
||||
(
|
||||
"writePrecision",
|
||||
IOstream::defaultPrecision()
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -229,6 +245,7 @@ Foam::fileName Foam::vtkSurfaceWriter::write
|
||||
}
|
||||
|
||||
OFstream os(outputDir/surfaceName + ".vtk");
|
||||
os.precision(writePrecision_);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,6 +50,11 @@ class vtkSurfaceWriter
|
||||
:
|
||||
public surfaceWriter
|
||||
{
|
||||
// Private data
|
||||
|
||||
const unsigned int writePrecision_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
static void writeGeometry(Ostream&, const pointField&, const faceList&);
|
||||
@ -84,6 +89,9 @@ public:
|
||||
//- Construct null
|
||||
vtkSurfaceWriter();
|
||||
|
||||
//- Construct with some output options
|
||||
vtkSurfaceWriter(const dictionary& options);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~vtkSurfaceWriter();
|
||||
|
||||
@ -63,6 +63,7 @@ Foam::fileName Foam::vtkSurfaceWriter::writeTemplate
|
||||
}
|
||||
|
||||
OFstream os(outputDir/fieldName + '_' + surfaceName + ".vtk");
|
||||
os.precision(writePrecision_);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user