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 -------------------------------------------------------------------------------
10 License
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 
30 inline std::ofstream& Foam::vtk::fileWriter::os() noexcept
31 {
32  return os_;
33 }
34 
35 
37 {
38  return *format_;
39 }
40 
41 
43 {
44  return (test == state_);
45 }
46 
47 
48 inline 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 
74 inline bool Foam::vtk::fileWriter::legacy() const noexcept
75 {
76  return opts_.legacy();
77 }
78 
79 
80 inline bool Foam::vtk::fileWriter::parallel() const noexcept
81 {
82  return parallel_;
83 }
84 
85 
86 inline const Foam::word& Foam::vtk::fileWriter::state() const
87 {
88  return stateNames[state_];
89 }
90 
91 
93 {
94  return outputFile_;
95 }
96 
97 
98 inline Foam::label Foam::vtk::fileWriter::nCellData() const noexcept
99 {
100  return nCellData_;
101 }
102 
104 inline 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 // ************************************************************************* //
bool notState(outputState test) const noexcept
True if output state does not correspond to the test state.
bool parallel() const noexcept
Parallel output requested?
A class for handling file names.
Definition: fileName.H:72
label nCellData() const noexcept
The number of CellData written for the Piece thus far.
bool isCellData() const noexcept
True if output state corresponds to CELL_DATA.
Abstract class for a VTK output stream formatter.
vtk::formatter & format()
The VTK formatter in use. FatalError for off-processor.
vtk::outputOptions opts() const noexcept
The output options in use.
outputState
Internal tracking of the output state.
bool isState(outputState test) const noexcept
True if output state corresponds to the test state.
bool legacy() const noexcept
Commonly used query.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
word ext() const
Return file name extension (part after last .)
Definition: wordI.H:171
word ext() const
File extension for current format type.
A class for handling words, derived from Foam::string.
Definition: word.H:63
vtk::fileTag contentType() const noexcept
The content type.
const direction noexcept
Definition: Scalar.H:258
bool isPointData() const noexcept
True if output state corresponds to POINT_DATA.
fileTag
Some common XML tags for vtk files.
Definition: foamVtkCore.H:122
label nPointData() const noexcept
The number of PointData written for the Piece thus far.
const fileName & output() const noexcept
The current output file name.
std::ofstream & os() noexcept
The backend ostream in use.
std::ofstream os_
The backend ostream in use (only opened on master process)
const word & state() const
The output state in printable format.