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 // ************************************************************************* //
regionModelFunctionObjectList.H
setSize
points setSize(newPointi)
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::regionModels::regionModelFunctionObjectList::regionModelFunctionObjectList
regionModelFunctionObjectList(regionModel &owner)
Null constructor.
Definition: regionModelFunctionObjectList.C:31
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::readFields
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:104
Foam::regionModels::regionModel
Definition: regionModel.H:57
Foam::Info
messageStream Info
Foam::regionModels::regionModelFunctionObjectList
Definition: regionModelFunctionObjectList.H:54
Foam::PtrList< regionModelFunctionObject >
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::regionModels::regionModelFunctionObjectList::owner_
regionModel & owner_
Reference to the owner region model.
Definition: regionModelFunctionObjectList.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::regionModels::regionModelFunctionObjectList::~regionModelFunctionObjectList
virtual ~regionModelFunctionObjectList()
Destructor.
Definition: regionModelFunctionObjectList.C:100
Foam::regionModels::regionModelFunctionObjectList::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve hook.
Definition: regionModelFunctionObjectList.C:106
Foam::regionModels::regionModelFunctionObjectList::dict_
const dictionary dict_
Dictionary.
Definition: regionModelFunctionObjectList.H:66
Foam::regionModels::regionModelFunctionObjectList::postEvolveRegion
virtual void postEvolveRegion()
Post-evolve hook.
Definition: regionModelFunctionObjectList.C:115
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::List::size
void size(const label)
Override size to be inconsistent with allocated storage.