regionModelFunctionObjectList.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) 2012 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 
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
31 (
32  regionModel& owner
33 )
34 :
36  owner_(owner),
37  dict_(dictionary::null)
38 {}
39 
40 
42 (
43  regionModel& owner,
44  const dictionary& dict,
45  const bool readFields
46 )
47 :
49  owner_(owner),
50  dict_(dict)
51 {
52  if (readFields)
53  {
54  wordList modelNames(dict.toc());
55 
56  Info<< " Selecting region model functions" << endl;
57 
58  if (modelNames.size() > 0)
59  {
60  this->setSize(modelNames.size());
61 
62  forAll(modelNames, i)
63  {
64  const word& modelName = modelNames[i];
65 
66  this->set
67  (
68  i,
70  (
71  dict,
72  owner,
73  modelName
74  )
75  );
76  }
77  }
78  else
79  {
80  Info<< " none" << endl;
81  }
82  }
83 }
84 
85 
87 (
89 )
90 :
92  owner_(cfol.owner_),
93  dict_(cfol.dict_)
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
98 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 {
108  forAll(*this, i)
109  {
110  this->operator[](i).preEvolveRegion();
111  }
112 }
113 
114 
116 {
117  forAll(*this, i)
118  {
119  this->operator[](i).postEvolveRegion();
120  }
121 }
122 
123 
124 // ************************************************************************* //
regionModel & owner_
Reference to the owner region model.
A class for handling words, derived from string.
Definition: word.H:59
messageStream Info
regionModelFunctionObjectList(regionModel &owner)
Null constructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
wordList toc() const
Return the table of contents.
Definition: dictionary.C:707
#define forAll(list, i)
Definition: UList.H:421
points setSize(newPointi)
const regionModelFunctionObject & operator[](const label) const
Return element const reference.