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 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()
31 {
32  return os_;
33 }
34 
35 
37 {
38  return *format_;
39 }
40 
41 
43 {
44  return (test == state_);
45 }
46 
47 
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
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 
98 inline Foam::label Foam::vtk::fileWriter::nCellData() const
99 {
100  return nCellData_;
101 }
102 
103 
104 inline Foam::label Foam::vtk::fileWriter::nPointData() const
105 {
106  return nPointData_;
107 }
108 
109 
110 // ************************************************************************* //
Foam::vtk::outputOptions
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Definition: foamVtkOutputOptions.H:59
Foam::vtk::fileWriter::parallel
bool parallel() const
Parallel output requested?
Definition: foamVtkFileWriterI.H:80
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::vtk::fileWriter::legacy
bool legacy() const
Commonly used query.
Definition: foamVtkFileWriterI.H:74
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::vtk::fileWriter::opts
vtk::outputOptions opts() const
The output options in use.
Definition: foamVtkFileWriterI.H:62
Foam::vtk::fileWriter::contentType
vtk::fileTag contentType() const
The content type.
Definition: foamVtkFileWriterI.H:56
Foam::vtk::fileWriter::notState
bool notState(outputState test) const
True if the output state does not correspond to the test state.
Definition: foamVtkFileWriterI.H:48
Foam::vtk::fileWriter::os_
std::ofstream os_
The backend ostream in use (master process)
Definition: foamVtkFileWriter.H:113
Foam::word::ext
word ext() const
Return file name extension (part after last .)
Definition: word.C:126
Foam::vtk::fileWriter::os
std::ofstream & os()
The backend ostream in use.
Definition: foamVtkFileWriterI.H:30
Foam::vtk::fileWriter::nPointData
label nPointData() const
Return the number of PointData written for the Piece thus far.
Definition: foamVtkFileWriterI.H:104
Foam::vtk::fileWriter::output
const fileName & output() const
The current output file name.
Definition: foamVtkFileWriterI.H:92
Foam::vtk::fileWriter::nCellData
label nCellData() const
Return the number of CellData written for the Piece thus far.
Definition: foamVtkFileWriterI.H:98
Foam::vtk::fileTag
fileTag
Some common XML tags for vtk files.
Definition: foamVtkCore.H:113
Foam::vtk::fileWriter::state
const word & state() const
The output state in printable format.
Definition: foamVtkFileWriterI.H:86
Foam::vtk::fileWriter::format
vtk::formatter & format()
The VTK formatter in use.
Definition: foamVtkFileWriterI.H:36
Foam::vtk::fileWriter::outputState
outputState
Internal tracking of the output state.
Definition: foamVtkFileWriter.H:73
Foam::vtk::fileWriter::isState
bool isState(outputState test) const
True if the output state corresponds to the test state.
Definition: foamVtkFileWriterI.H:42
Foam::vtk::fileWriter::ext
word ext() const
File extension for current format type.
Definition: foamVtkFileWriterI.H:68
Foam::vtk::formatter
Abstract class for a VTK output stream formatter.
Definition: foamVtkFormatter.H:68