foamVtkSeriesWriterI.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-2019 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// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29
30inline bool Foam::vtk::seriesWriter::empty() const noexcept
31{
32 return entries_.empty();
33}
34
35
36inline Foam::label Foam::vtk::seriesWriter::size() const noexcept
37{
38 return entries_.size();
39}
40
41
43{
44 entries_.clear();
45 existing_.clear();
46}
47
48
50{
51 // Strip out path before saving
52 return appendCheck(fileNameInstant(inst.value(), inst.name().name()));
53}
54
55
57{
58 // Strip out path before saving
59 inst.name().removePath();
60
61 return appendCheck(inst);
62}
63
64
66(
67 scalar timeValue,
68 const fileName& file
69)
70{
71 // Strip out path before saving
72 return appendCheck(fileNameInstant(timeValue, file.name()));
73}
74
75
77(
78 scalar timeValue,
79 fileName&& file
80)
81{
82 // Strip out path before saving
83 file.removePath();
84
85 return appendCheck(fileNameInstant(timeValue, std::move(file)));
86}
87
88
90{
91 seriesWriter::print(os, entries_);
92}
93
94
95inline void Foam::vtk::seriesWriter::write(const fileName& seriesName) const
96{
97 seriesWriter::write(seriesName, entries_);
98}
99
100
101// ************************************************************************* //
A tuple of scalar value and key. The value often corresponds to a time value, thus the naming of the ...
Definition: Instant.H:52
scalar value() const noexcept
The value (const access)
Definition: Instant.H:118
const T & name() const noexcept
The name/key (const access)
Definition: Instant.H:130
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A class for handling file names.
Definition: fileName.H:76
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Definition: fileNameI.H:199
virtual bool write()
Write the output fields.
scalar print()
Print to screen.
bool append() const noexcept
True if output format uses an append mode.
bool empty() const noexcept
True if there are no data sets.
label size() const noexcept
The number of data sets.
void clear()
Clear entries.
OBJstream os(runTime.globalPath()/outputName)
Instant< fileName > fileNameInstant
A tuple of value and fileName.
const direction noexcept
Definition: Scalar.H:223