Loading...
Searching...
No Matches
foamVtkFileWriterI.H
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) 2018-2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
30inline std::ofstream& Foam::vtk::fileWriter::os() noexcept
31{
32 return os_;
33}
34
39}
40
42inline bool Foam::vtk::fileWriter::isState(outputState test) const noexcept
43{
44 return (test == state_);
45}
46
47
48inline bool Foam::vtk::fileWriter::notState(outputState test) const noexcept
50 return (test != state_);
51}
52
53
54// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59}
60
65}
66
69{
70 return opts_.ext(contentType_);
71}
72
75{
76 return opts_.legacy();
77}
78
81{
82 return parallel_;
83}
84
86inline const Foam::word& Foam::vtk::fileWriter::state() const
87{
88 return stateNames[state_];
89}
90
93{
94 return outputFile_;
95}
96
98inline Foam::label Foam::vtk::fileWriter::nCellData() const noexcept
99{
100 return nCellData_;
101}
102
104inline Foam::label Foam::vtk::fileWriter::nPointData() const noexcept
105{
106 return nPointData_;
107}
108
111{
112 return (outputState::CELL_DATA == state_);
113}
114
115
117{
118 return (outputState::POINT_DATA == state_);
119}
120
121
122// ************************************************************************* //
A class for handling file names.
Definition fileName.H:75
bool isCellData() const noexcept
True if output state corresponds to CELL_DATA.
static const Enum< outputState > stateNames
Names for the output state (for messages, not for file output).
vtk::fileTag contentType() const noexcept
The content type.
bool isState(outputState test) const noexcept
True if output state corresponds to the test state.
fileName outputFile_
The output file name.
vtk::outputOptions opts() const noexcept
The output options in use.
const word & state() const
The output state in printable format.
bool legacy() const noexcept
Commonly used query.
bool isPointData() const noexcept
True if output state corresponds to POINT_DATA.
const fileName & output() const noexcept
The current output file name.
label nPointData() const noexcept
The number of PointData written for the Piece thus far.
label nCellData() const noexcept
The number of CellData written for the Piece thus far.
autoPtr< vtk::formatter > format_
The VTK formatter in use (only valid on master process).
std::ofstream & os() noexcept
The backend ostream in use.
bool parallel_
Parallel writing (via master).
bool parallel() const noexcept
Parallel output requested?
label nCellData_
The number of CellData written for the Piece thus far.
outputState state_
The output state.
bool notState(outputState test) const noexcept
True if output state does not correspond to the test state.
word ext() const
File extension for current format type.
label nPointData_
The number of PointData written for the Piece thus far.
vtk::outputOptions opts_
Requested output options.
std::ofstream os_
The backend ostream in use (only opened on master process).
outputState
Internal tracking of the output state.
vtk::fileTag contentType_
The content type (PolyData, UnstructuredGrid ...).
vtk::formatter & format()
The VTK formatter in use. FatalError for off-processor.
Abstract class for a VTK output stream formatter.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
A class for handling words, derived from Foam::string.
Definition word.H:66
fileTag
Some common XML tags for vtk files.
const direction noexcept
Definition scalarImpl.H:265