Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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/>.
27\*---------------------------------------------------------------------------*/
28
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34(
36)
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
91 const regionModelFunctionObjectList& cfol
92)
93:
94 PtrList<regionModelFunctionObject>(cfol),
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// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
const regionModelFunctionObject * set(const label i) const
Definition PtrList.H:171
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
const regionModelFunctionObject & operator[](const label i) const
Definition UPtrListI.H:289
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
regionModel & regionModel_
Reference to the region region model.
const regionModel & region() const
Return const access to the cloud region.
const dictionary & dict() const
Return the forces dictionary.
regionModelFunctionObjectList(regionModel &region)
Null constructor.
Region model function object base class.
static autoPtr< regionModelFunctionObject > New(const dictionary &dict, regionModel &region, const word &modelType)
Selector.
Base class for region models.
Definition regionModel.H:59
A class for handling words, derived from Foam::string.
Definition word.H:66
List< word > wordList
List of word.
Definition fileName.H:60
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299