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-------------------------------------------------------------------------------
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::surfaceWriter::is_open() const noexcept
31{
32 return !outputPath_.empty();
33}
34
35
36inline Foam::label Foam::surfaceWriter::nFields() const noexcept
37{
38 return nFields_;
39}
40
41
42inline Foam::label Foam::surfaceWriter::nFields(const label n) noexcept
43{
44 label old(nFields_);
45 nFields_ = n;
46 return old;
47}
48
49
51{
52 return isPointData_;
53}
54
55
56inline bool Foam::surfaceWriter::isPointData(const bool on) noexcept
57{
58 bool old(isPointData_);
59 isPointData_ = on;
60 return old;
61}
62
63
65{
66 return useTimeDir_;
67}
68
69
70inline bool Foam::surfaceWriter::useTimeDir(const bool on) noexcept
71{
72 bool old(useTimeDir_);
73 useTimeDir_ = on;
74 return old;
75}
76
77
79{
80 return verbose_;
81}
82
83
84inline bool Foam::surfaceWriter::verbose(const bool on) noexcept
85{
86 bool old(verbose_);
87 verbose_ = on;
88 return old;
89}
90
91
92inline Foam::scalar Foam::surfaceWriter::mergeDim() const noexcept
93{
94 return mergeDim_;
95}
96
97
98inline Foam::scalar Foam::surfaceWriter::mergeDim(const scalar dist) noexcept
99{
100 scalar old(mergeDim_);
101 mergeDim_ = dist;
102 return old;
103}
104
105
106inline Foam::scalar Foam::surfaceWriter::scale() const noexcept
107{
108 return geometryScale_;
109}
110
111
112inline Foam::scalar Foam::surfaceWriter::scale(const scalar factor) noexcept
113{
114 // This is probably not yet needed -> adjustedSurf_.clear();
115 scalar old(geometryScale_);
116 geometryScale_ = factor;
117 return old;
118}
119
120
123{
124 return geometryTransform_;
125}
126
127
129{
130 return currTime_.name().size();
131}
132
133
135{
136 return currTime_.name();
137}
138
139
140inline Foam::scalar Foam::surfaceWriter::timeValue() const
141{
142 return currTime_.name().empty() ? 0 : currTime_.value();
143}
144
145
146// ************************************************************************* //
label n
A Cartesian coordinate system.
Definition: cartesianCS.H:72
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
scalar scale() const noexcept
The current value of the geometry scaling.
bool is_open() const noexcept
Test if outputPath has been set.
bool verbose() const noexcept
Get output verbosity.
scalar timeValue() const
The current time value/name.
scalar mergeDim() const noexcept
The current value of the point merge dimension (metre)
bool hasTime() const
True if there is a known time.
fileName outputPath_
The full output directory and file (surface) name.
const coordSystem::cartesian & transform() const noexcept
The current (cartesian) coordinate system transformation.
label nFields() const noexcept
The number of expected output fields.
A class for handling words, derived from Foam::string.
Definition: word.H:68
const direction noexcept
Definition: Scalar.H:223