threadedCollatedOFstream.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017-2018 OpenFOAM Foundation
9 Copyright (C) 2020-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30#include "decomposedBlockData.H"
31#include "OFstreamCollator.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
36(
38 const fileName& pathName,
39 IOstreamOption streamOpt,
40 const bool useThread
41)
42:
43 OStringStream(streamOpt),
44 writer_(writer),
45 pathName_(pathName),
46 compression_(streamOpt.compression()),
47 useThread_(useThread),
48 headerEntries_()
49{}
50
51
52// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
53
55{
56 writer_.write
57 (
59 pathName_,
60 str(),
61 IOstreamOption(IOstream::BINARY, version(), compression_),
62 false, // append=false
63 useThread_,
64 headerEntries_
65 );
66}
67
68
69// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
70
72{
73 headerEntries_ = dict;
74}
75
76
77// ************************************************************************* //
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
The IOstreamOption is a simple container for options an IOstream can normally have.
Threaded file writer.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:231
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Master-only drop-in replacement for OFstream.
void setHeaderEntries(const dictionary &dict)
Define the header entries for the data block(s)
dictionary dict
static const char *const typeName
The type name used in ensight case files.