BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / thermophysical / mixtureAdiabaticFlameT / substance.H
blob0eff4a71cc374fe648055d4ac8a500fb966d0c53
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::substance
28 Description
30 SourceFiles
31     substanceI.H
32     substance.C
33     substanceIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef substance_H
38 #define substance_H
40 #include "scalar.H"
41 #include "word.H"
42 #include "Istream.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class substance Declaration
51 \*---------------------------------------------------------------------------*/
53 class substance
55     // Private data
57         word name_;
58         scalar volFrac_;
61 public:
63     // Constructors
65         //- Construct null
66         substance()
67         {}
70     // Member Functions
72         // Access
74             const word& name() const
75             {
76                 return name_;
77             }
79             scalar volFrac() const
80             {
81                 return volFrac_;
82             }
84             bool operator==(const substance& s) const
85             {
86                 return name_ == s.name_ && volFrac_ == s.volFrac_;
87             }
89             bool operator!=(const substance& s) const
90             {
91                 return !operator==(s);
92             }
95     // IOstream Operators
97         friend Istream& operator>>(Istream& is, substance& s)
98         {
99             is >> s.name_ >> s.volFrac_;
100             return is;
101         }
103         friend Ostream& operator<<(Ostream& os, const substance& s)
104         {
105             os << s.name_ << token::SPACE << s.volFrac_;
106             return os;
107         }
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 } // End namespace Foam
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 #endif
119 // ************************************************************************* //