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-2022 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 * * * * * * * * * * * //
29
30inline std::ofstream& Foam::vtk::fileWriter::os() noexcept
31{
32 return os_;
33}
34
35
37{
38 return *format_;
39}
40
41
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
49{
50 return (test != state_);
51}
52
53
54// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
55
57{
58 return contentType_;
59}
60
61
63{
64 return opts_;
65}
66
67
69{
70 return opts_.ext(contentType_);
71}
72
73
75{
76 return opts_.legacy();
77}
78
79
81{
82 return parallel_;
83}
84
85
87{
88 return stateNames[state_];
89}
90
91
93{
94 return outputFile_;
95}
96
97
99{
100 return nCellData_;
101}
102
103
105{
106 return nPointData_;
107}
108
109
110// ************************************************************************* //
A class for handling file names.
Definition: fileName.H:76
vtk::fileTag contentType() const noexcept
The content type.
bool isState(outputState test) const noexcept
True if output state corresponds to the test state.
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.
const fileName & output() const noexcept
The current output file name.
label nPointData() const noexcept
Return the number of PointData written for the Piece thus far.
label nCellData() const noexcept
Return the number of CellData written for the Piece thus far.
std::ofstream & os() noexcept
The backend ostream in use.
bool parallel() const noexcept
Parallel output requested?
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.
std::ofstream os_
The backend ostream in use (only opened on master process)
outputState
Internal tracking of the output state.
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:68
word ext() const
Return file name extension (part after last .)
Definition: word.C:126
fileTag
Some common XML tags for vtk files.
Definition: foamVtkCore.H:114
const direction noexcept
Definition: Scalar.H:223