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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2017 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 
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 (
34  regionModel& region
35 )
36 :
38  regionModel_(region),
39  dict_(dictionary::null)
40 {}
41 
42 
44 (
45  regionModel& region,
46  const dictionary& dict,
47  const bool readFields
48 )
49 :
51  regionModel_(region),
52  dict_(dict)
53 {
54  if (readFields)
55  {
56  wordList modelNames(dict.toc());
57 
58  Info<< " Selecting region model functions" << endl;
59 
60  if (modelNames.size() > 0)
61  {
62  this->setSize(modelNames.size());
63 
64  forAll(modelNames, i)
65  {
66  const word& modelName = modelNames[i];
67 
68  this->set
69  (
70  i,
72  (
73  dict,
74  region,
75  modelName
76  )
77  );
78  }
79  }
80  else
81  {
82  Info<< " none" << endl;
83  }
84  }
85 }
86 
87 
89 (
91 )
92 :
94  regionModel_(cfol.regionModel_),
95  dict_(cfol.dict_)
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
100 
103 {}
104 
105 
106 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
107 
109 {
110  forAll(*this, i)
111  {
112  this->operator[](i).preEvolveRegion();
113  }
114 }
115 
116 
118 {
119  forAll(*this, i)
120  {
121  this->operator[](i).postEvolveRegion();
122  }
123 }
124 
125 
126 // ************************************************************************* //
regionModelFunctionObjectList.H
setSize
points setSize(newPointi)
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Definition: BitOps.C:37
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::regionModels::regionModel
Base class for region models.
Definition: regionModel.H:60
Foam::regionModels::regionModelFunctionObjectList::regionModelFunctionObjectList
regionModelFunctionObjectList(regionModel &region)
Null constructor.
Definition: regionModelFunctionObjectList.C:33
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::regionModels::regionModelFunctionObjectList
List of cloud function objects.
Definition: regionModelFunctionObjectList.H:56
Foam::PtrList< regionModelFunctionObject >
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::regionModels::regionModelFunctionObjectList::~regionModelFunctionObjectList
virtual ~regionModelFunctionObjectList()
Destructor.
Definition: regionModelFunctionObjectList.C:102
Foam::regionModels::regionModelFunctionObjectList::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve hook.
Definition: regionModelFunctionObjectList.C:108
Foam::regionModels::regionModelFunctionObjectList::dict_
const dictionary dict_
Dictionary.
Definition: regionModelFunctionObjectList.H:68
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::regionModels::regionModelFunctionObjectList::postEvolveRegion
virtual void postEvolveRegion()
Post-evolve hook.
Definition: regionModelFunctionObjectList.C:117
Foam::List< word >
Foam::regionModels::regionModelFunctionObjectList::regionModel_
regionModel & regionModel_
Reference to the region region model.
Definition: regionModelFunctionObjectList.H:65