Function2UnitSets.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) 2020-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::Function2
26 
27 Description
28  Struct containing three unitSets for use in converting both the two
29  arguments and the value of a Function2.
30 
31 SourceFiles
32  Function2UnitSets.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef Function2UnitSets_H
37 #define Function2UnitSets_H
38 
39 #include "unitSet.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace Function2s
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class Function2s::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 y-axis values
60  unitSet y;
61 
62  //- Unit conversion for result values
63  unitSet value;
64 
65 
66  // Constructors
67 
68  //- Construct from initialiser list
69  unitSets(std::initializer_list<unitSet>);
70 
71  //- Construct from stream
72  unitSets(Istream& is);
73 
74 
75  // Member Functions
76 
77  //- Update from stream
78  void read(Istream& is);
79 };
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 } // End namespace Function2s
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 // Global Functions
88 
89 //- Generate an error in an context where unit conversions are not supported
91 (
92  const word& typeName,
93  const Function2s::unitSets& units,
94  const dictionary& dict
95 );
96 
97 //- Write a units entry
98 void writeEntry(Ostream& os, const Function2s::unitSets& units);
99 
100 
101 // IOStream Operators
102 
103 //- Read from stream
105 
106 //- Write to stream
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
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
unitSet value
Unit conversion for result values.
unitSet y
Unit conversion for y-axis 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.