surfaceWriterI.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) 2019-2022 OpenCFD Ltd.
9  Copyright (C) 2026 Keysight Technologies
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
31 inline bool Foam::surfaceWriter::is_open() const noexcept
32 {
33  return !outputPath_.empty();
34 }
35 
36 
37 inline Foam::label Foam::surfaceWriter::nFields() const noexcept
38 {
39  return nFields_;
40 }
41 
42 
43 inline Foam::label Foam::surfaceWriter::nFields(const label n) noexcept
44 {
45  label old(nFields_);
46  nFields_ = n;
47  return old;
48 }
49 
50 
52 {
53  return isPointData_;
54 }
55 
56 
57 inline bool Foam::surfaceWriter::isPointData(bool on) noexcept
58 {
59  bool old(isPointData_);
60  isPointData_ = on;
61  return old;
62 }
63 
64 
66 {
67  return vertexOutput_;
68 }
69 
70 
72 {
73  bool old(vertexOutput_);
74  vertexOutput_ = on;
75  return old;
76 }
77 
78 
79 inline bool Foam::surfaceWriter::useTimeDir() const noexcept
80 {
81  return useTimeDir_;
82 }
83 
84 
85 inline bool Foam::surfaceWriter::useTimeDir(const bool on) noexcept
86 {
87  bool old(useTimeDir_);
88  useTimeDir_ = on;
89  return old;
90 }
91 
92 
93 inline bool Foam::surfaceWriter::verbose() const noexcept
94 {
95  return verbose_;
96 }
97 
98 
99 inline bool Foam::surfaceWriter::verbose(const bool on) noexcept
100 {
101  bool old(verbose_);
102  verbose_ = on;
103  return old;
104 }
105 
107 inline Foam::scalar Foam::surfaceWriter::mergeDim() const noexcept
108 {
109  return mergeDim_;
110 }
111 
112 
113 inline Foam::scalar Foam::surfaceWriter::mergeDim(const scalar dist) noexcept
114 {
115  scalar old(mergeDim_);
116  mergeDim_ = dist;
117  return old;
118 }
119 
121 inline Foam::scalar Foam::surfaceWriter::scale() const noexcept
122 {
123  return geometryScale_;
124 }
125 
126 
127 inline Foam::scalar Foam::surfaceWriter::scale(const scalar factor) noexcept
128 {
129  // This is probably not yet needed -> adjustedSurf_.clear();
130  scalar old(geometryScale_);
131  geometryScale_ = factor;
132  return old;
133 }
134 
135 
138 {
139  return geometryTransform_;
140 }
141 
143 inline bool Foam::surfaceWriter::hasTime() const
144 {
145  return currTime_.name().size();
146 }
147 
149 inline const Foam::word& Foam::surfaceWriter::timeName() const
150 {
151  return currTime_.name();
152 }
153 
154 
155 inline Foam::scalar Foam::surfaceWriter::timeValue() const
156 {
157  return currTime_.name().empty() ? 0 : currTime_.value();
158 }
159 
160 
161 // ************************************************************************* //
bool hasTime() const
True if there is a known time.
bool is_open() const noexcept
Test if outputPath has been set.
bool vertexOutput() const noexcept
Output as 1D vertex/point elements instead of faces.
scalar timeValue() const
The current time value/name.
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
A Cartesian coordinate system.
Definition: cartesianCS.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:63
scalar mergeDim() const noexcept
The current value of the point merge dimension (metre)
bool verbose() const noexcept
Get output verbosity.
const direction noexcept
Definition: scalarImpl.H:265
label nFields() const noexcept
The number of expected output fields.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
fileName outputPath_
The full output directory and file (surface) name.
const coordSystem::cartesian & transform() const noexcept
The current (cartesian) coordinate system transformation.
label n
scalar scale() const noexcept
The current value of the geometry scaling.