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 | Copyright (C) 2011-2015 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 // ************************************************************************* //
phasePropertiesList.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::phasePropertiesList::stateLabels
const wordList & stateLabels() const
Return the list of state labels.
Definition: phasePropertiesList.C:86
Foam::phasePropertiesList::~phasePropertiesList
~phasePropertiesList()
Destructor.
Definition: phasePropertiesList.C:67
Foam::phaseProperties
Helper class to manage multi-specie phase properties.
Definition: phaseProperties.H:52
Foam::phasePropertiesList::props
const List< phaseProperties > & props() const
Return the list of phase properties.
Definition: phasePropertiesList.C:74
Foam::phasePropertiesList::operator[]
const phaseProperties & operator[](const label) const
Definition: phasePropertiesList.C:99
Foam::label
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
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::phasePropertiesList::phaseTypes
const wordList & phaseTypes() const
Return the list of word representation of phase types.
Definition: phasePropertiesList.C:80
Foam::phasePropertiesList::size
label size() const
Return the size (number of phases)
Definition: phasePropertiesList.C:92
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::phasePropertiesList::phasePropertiesList
phasePropertiesList()
Construct null.
Definition: phasePropertiesList.C:30