phasePropertiesList.C
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) 2011-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "phasePropertiesList.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 :
34  props_(),
35  phaseTypeNames_(),
36  stateLabels_()
37 {}
38 
39 
41 (
42  Istream& is,
43  const wordList& gasNames,
44  const wordList& liquidNames,
45  const wordList& solidNames
46 )
47 :
48  props_(is),
49  phaseTypeNames_(),
50  stateLabels_()
51 {
52  forAll(props_, i)
53  {
54  props_[i].reorder(gasNames, liquidNames, solidNames);
55  }
56 
57  phaseTypeNames_.setSize(props_.size());
58  stateLabels_.setSize(props_.size());
59  forAll(props_, i)
60  {
61  phaseTypeNames_[i] = props_[i].phaseTypeName();
62  stateLabels_[i] = props_[i].stateLabel();
63  }
64 }
65 
66 
67 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68 
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
77 {
78  return props_;
79 }
80 
81 
83 {
84  return phaseTypeNames_;
85 }
86 
87 
89 {
90  return stateLabels_;
91 }
92 
93 
95 {
96  return props_.size();
97 }
98 
99 
101 Foam::phasePropertiesList::operator[](const label phaseI) const
102 {
103  return props_[phaseI];
104 }
105 
106 
107 // ************************************************************************* //
phasePropertiesList.H
Foam::phasePropertiesList::stateLabels
const wordList & stateLabels() const
Return the list of state labels.
Definition: phasePropertiesList.C:88
Foam::phasePropertiesList::~phasePropertiesList
~phasePropertiesList()
Destructor.
Definition: phasePropertiesList.C:69
Foam::phaseProperties
Helper class to manage multi-specie phase properties.
Definition: phaseProperties.H:60
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::phasePropertiesList::props
const List< phaseProperties > & props() const
Return the list of phase properties.
Definition: phasePropertiesList.C:76
Foam::phasePropertiesList::operator[]
const phaseProperties & operator[](const label) const
Definition: phasePropertiesList.C:101
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::phasePropertiesList::phaseTypes
const wordList & phaseTypes() const
Return the list of word representation of phase types.
Definition: phasePropertiesList.C:82
Foam::phasePropertiesList::size
label size() const
Return the size (number of phases)
Definition: phasePropertiesList.C:94
Foam::List< word >
solidNames
const wordList solidNames(rp["solid"])
Foam::phasePropertiesList::phasePropertiesList
phasePropertiesList()
Construct null.
Definition: phasePropertiesList.C:32