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  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
34 (
35  regionModel& region
36 )
37 :
39  regionModel_(region),
40  dict_()
41 {}
42 
43 
45 (
46  regionModel& region,
47  const dictionary& dict,
48  const bool readFields
49 )
50 :
52  regionModel_(region),
53  dict_(dict)
54 {
55  if (readFields)
56  {
57  wordList modelNames(dict.toc());
58 
59  Info<< " Selecting region model functions" << endl;
60 
61  if (modelNames.size() > 0)
62  {
63  this->setSize(modelNames.size());
64 
65  forAll(modelNames, i)
66  {
67  const word& modelName = modelNames[i];
68 
69  this->set
70  (
71  i,
73  (
74  dict,
75  region,
76  modelName
77  )
78  );
79  }
80  }
81  else
82  {
83  Info<< " none" << endl;
84  }
85  }
86 }
87 
88 
90 (
92 )
93 :
95  regionModel_(cfol.regionModel_),
96  dict_(cfol.dict_)
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
101 
104 {}
105 
106 
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 
110 {
111  forAll(*this, i)
112  {
113  this->operator[](i).preEvolveRegion();
114  }
115 }
116 
117 
119 {
120  forAll(*this, i)
121  {
122  this->operator[](i).postEvolveRegion();
123  }
124 }
125 
126 
127 // ************************************************************************* //
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:65
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
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:34
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
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:123
Foam::regionModels::regionModelFunctionObjectList::~regionModelFunctionObjectList
virtual ~regionModelFunctionObjectList()
Destructor.
Definition: regionModelFunctionObjectList.C:103
Foam::regionModels::regionModelFunctionObjectList::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve hook.
Definition: regionModelFunctionObjectList.C:109
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:118
Foam::List< word >
Foam::regionModels::regionModelFunctionObjectList::regionModel_
regionModel & regionModel_
Reference to the region region model.
Definition: regionModelFunctionObjectList.H:65