specieElement.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) 2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
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 Class
28  Foam::specieElement
29 
30 Description
31 
32 SourceFiles
33  specieElementI.H
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef specieElement_H
38 #define specieElement_H
39 
40 #include "word.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward Declarations
48 class specieElement;
49 Ostream& operator<<(Ostream&, const specieElement&);
50 
51 
52 /*---------------------------------------------------------------------------*\
53  Class specieElement Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class specieElement
57 {
58  // Private Data
59 
60  //- Name of the element
61  word name_;
62 
63  //- Number of atoms of this element in the specie
64  label nAtoms_;
65 
66 
67 public:
68 
69  // Constructors
70 
71  //- Default construct
72  inline specieElement();
73 
74  //- Construct from components
75  inline specieElement(const word& name, const label nAtoms);
76 
77  //- Construct from Istream
78  inline explicit specieElement(Istream& is);
79 
80 
81  // Member Functions
82 
83  //- Return the name of the element
84  inline const word& name() const;
85 
86  //- Return non-const access to the name of the element
87  inline word& name();
88 
89  //- Return the number of atoms of this element in the specie
90  inline label nAtoms() const;
91 
92  //- Return non-const access to the number of atoms of this element
93  // in the specie
94  inline label& nAtoms();
95 
96 
97  // Member Operators
98 
99  //- Equality comparison
100  inline bool operator==(const specieElement&) const;
101 
102  //- Inequality comparison
103  inline bool operator!=(const specieElement&) const;
104 
105 
106  // IOstream Operators
107 
108  inline friend Ostream& operator<<(Ostream&, const specieElement&);
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #include "specieElementI.H"
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::specieElement::name
const word & name() const
Return the name of the element.
Definition: specieElementI.H:56
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::specieElement::specieElement
specieElement()
Default construct.
Definition: specieElementI.H:33
Foam::specieElement::nAtoms
label nAtoms() const
Return the number of atoms of this element in the specie.
Definition: specieElementI.H:68
Foam::specieElement::operator==
bool operator==(const specieElement &) const
Equality comparison.
Definition: specieElementI.H:82
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::specieElement::operator<<
friend Ostream & operator<<(Ostream &, const specieElement &)
specieElementI.H
Foam::specieElement
Definition: specieElement.H:55
Foam::specieElement::operator!=
bool operator!=(const specieElement &) const
Inequality comparison.
Definition: specieElementI.H:92
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
word.H