phasePropertiesList.C
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-2020 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 \*---------------------------------------------------------------------------*/
25 
26 #include "phasePropertiesList.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 :
32  props_(),
33  phaseTypeNames_(),
34  stateLabels_()
35 {}
36 
37 
39 (
40  Istream& is,
41  const wordList& gasNames,
42  const wordList& liquidNames,
43  const wordList& solidNames
44 )
45 :
46  props_(is),
47  phaseTypeNames_(),
48  stateLabels_()
49 {
50  forAll(props_, i)
51  {
52  props_[i].reorder(gasNames, liquidNames, solidNames);
53  }
54 
55  phaseTypeNames_.setSize(props_.size());
56  stateLabels_.setSize(props_.size());
57  forAll(props_, i)
58  {
59  phaseTypeNames_[i] = props_[i].phaseTypeName();
60  stateLabels_[i] = props_[i].stateLabel();
61  }
62 }
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
75 {
76  return props_;
77 }
78 
79 
81 {
82  return phaseTypeNames_;
83 }
84 
85 
87 {
88  return stateLabels_;
89 }
90 
91 
93 {
94  return props_.size();
95 }
96 
97 
100 {
101  return props_[phaseI];
102 }
103 
104 
105 // ************************************************************************* //
label size() const
Return the size (number of phases)
const phaseProperties & operator[](const label) const
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Helper class to manage multi-specie phase properties.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const wordList & phaseTypes() const
Return the list of word representation of phase types.
const wordList & stateLabels() const
Return the list of state labels.
phasePropertiesList()
Construct null.
void setSize(const label)
Reset size of List.
Definition: List.C:281
const List< phaseProperties > & props() const
Return the list of phase properties.