coordSetWriterI.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) 2022 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 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
29 
30 inline bool Foam::coordSetWriter::is_open() const noexcept
31 {
32  return !outputPath_.empty();
33 }
34 
35 
36 inline Foam::label Foam::coordSetWriter::nFields() const noexcept
37 {
38  return nFields_;
39 }
40 
41 
42 inline Foam::label Foam::coordSetWriter::nFields(const label n) noexcept
43 {
44  label old(nFields_);
45  nFields_ = n;
46  return old;
47 }
48 
49 
50 inline bool Foam::coordSetWriter::useTracks() const noexcept
51 {
52  return useTracks_;
53 }
54 
55 
56 inline bool Foam::coordSetWriter::useTracks(const bool on) noexcept
57 {
58  bool old(useTracks_);
59  useTracks_ = on;
60  return old;
61 }
62 
63 
65 {
66  return useTimeDir_;
67 }
68 
69 
70 inline bool Foam::coordSetWriter::useTimeDir(const bool on) noexcept
71 {
72  bool old(useTimeDir_);
73  useTimeDir_ = on;
74  return old;
75 }
76 
77 
78 inline bool Foam::coordSetWriter::verbose() const noexcept
79 {
80  return verbose_;
81 }
82 
83 
84 inline bool Foam::coordSetWriter::verbose(bool on) noexcept
85 {
86  bool old(verbose_);
87  verbose_ = on;
88  return old;
89 }
90 
91 
92 inline bool Foam::coordSetWriter::hasTime() const
93 {
94  return currTime_.name().size();
95 }
96 
97 
98 inline const Foam::word& Foam::coordSetWriter::timeName() const
99 {
100  return currTime_.name();
101 }
102 
103 
104 inline Foam::scalar Foam::coordSetWriter::timeValue() const
105 {
106  return currTime_.name().empty() ? 0 : currTime_.value();
107 }
108 
109 
110 // ************************************************************************* //
bool useTracks() const noexcept
Prefer tracks to points during single set writing.
bool hasTime() const
True if there is a known time.
fileName outputPath_
The full output directory and file (coords) name.
A class for handling words, derived from Foam::string.
Definition: word.H:63
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
bool is_open() const noexcept
Test if outputPath has been set.
scalar timeValue() const
The current time value/name.
label nFields() const noexcept
The number of expected output fields.
const direction noexcept
Definition: Scalar.H:258
const word & timeName() const
The current time value/name.
label n
bool verbose() const noexcept
Get output verbosity.