Function1UnitSets.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::Function1s::unitSets
26 
27 Description
28  Struct containing two unitSets for use in converting both the argument
29  and the value of a Function1.
30 
31 SourceFiles
32  Function1UnitSets.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef Function1UnitSets_H
37 #define Function1UnitSets_H
38 
39 #include "unitSet.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace Function1s
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class Function1s::unitSets Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 struct unitSets
53 {
54  // Public Data
55 
56  //- Unit conversion for x-axis values
57  unitSet x;
58 
59  //- Unit conversion for result values
60  unitSet value;
61 
62 
63  // Constructors
64 
65  //- Construct from initialiser list
66  unitSets(std::initializer_list<unitSet>);
67 
68  //- Construct from stream
69  unitSets(Istream& is);
70 
71 
72  // Member Functions
73 
74  //- Update from stream
75  void read(Istream& is);
76 };
77 
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 } // End namespace Function1s
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 // Global Functions
86 
87 //- Generate an error in an context where unit conversions are not supported
89 (
90  const word& typeName,
91  const Function1s::unitSets& units,
92  const dictionary& dict
93 );
94 
95 //- Write a units entry
96 void writeEntry(Ostream& os, const Function1s::unitSets& units);
97 
98 
99 // IOStream Operators
100 
101 //- Read from stream
103 
104 //- Write to stream
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
Definition: unitSet.H:68
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
Istream & operator>>(Istream &, pointEdgeDist &)
Definition: pointEdgeDist.C:41
void assertNoConvertUnits(const word &typeName, const Function1s::unitSets &units, const dictionary &dict)
Generate an error in an context where unit conversions are not supported.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict
Struct containing two unitSets for use in converting both the argument and the value of a Function1.
unitSet value
Unit conversion for result values.
unitSet x
Unit conversion for x-axis values.
unitSets(std::initializer_list< unitSet >)
Construct from initialiser list.
void read(Istream &is)
Update from stream.