regionModelFunctionObjectList.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) 2012-2018 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& region
33 )
34 :
36  regionModel_(region),
37  dict_(dictionary::null)
38 {}
39 
40 
42 (
43  regionModel& region,
44  const dictionary& dict,
45  const bool readFields
46 )
47 :
49  regionModel_(region),
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  region,
73  modelName
74  )
75  );
76  }
77  }
78  else
79  {
80  Info<< " none" << endl;
81  }
82  }
83 }
84 
85 
87 (
89 )
90 :
92  regionModel_(cfol.regionModel_),
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 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const T & operator[](const label) const
Return element const reference.
Definition: UPtrListI.H:96
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
wordList toc() const
Return the table of contents.
Definition: dictionary.C:1095
points setSize(newPointi)
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
A class for handling words, derived from string.
Definition: word.H:59
messageStream Info
Base class for region models.
Definition: regionModel.H:55
regionModel & regionModel_
Reference to the region region model.
regionModelFunctionObjectList(regionModel &region)
Null constructor.