ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / lagrangian / intermediate / submodels / CloudFunctionObjects / CloudFunctionObjectList / CloudFunctionObjectList.C
blob556c72908cb2ef46b5b2c03b0bd9bd0abd4bc78f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "CloudFunctionObjectList.H"
27 #include "entry.H"
29 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
31 template<class CloudType>
32 Foam::CloudFunctionObjectList<CloudType>::CloudFunctionObjectList
34     CloudType& owner
37     PtrList<CloudFunctionObject<CloudType> >(),
38     owner_(owner),
39     dict_(dictionary::null)
43 template<class CloudType>
44 Foam::CloudFunctionObjectList<CloudType>::CloudFunctionObjectList
46     CloudType& owner,
47     const dictionary& dict,
48     const bool readFields
51     PtrList<CloudFunctionObject<CloudType> >(),
52     owner_(owner),
53     dict_(dict)
55     if (readFields)
56     {
57         wordList modelNames(dict.toc());
59         Info<< "Constructing cloud functions" << endl;
61         if (modelNames.size() > 0)
62         {
63             this->setSize(modelNames.size());
65             forAll(modelNames, i)
66             {
67                 const word& modelName = modelNames[i];
69                 this->set
70                 (
71                     i,
72                     CloudFunctionObject<CloudType>::New
73                     (
74                         dict,
75                         owner,
76                         modelName
77                     )
78                 );
79             }
80         }
81         else
82         {
83             Info<< "    none" << endl;
84         }
85     }
89 template<class CloudType>
90 Foam::CloudFunctionObjectList<CloudType>::CloudFunctionObjectList
92     const CloudFunctionObjectList& cfol
95     PtrList<CloudFunctionObject<CloudType> >(cfol),
96     owner_(cfol.owner_),
97     dict_(cfol.dict_)
101 // * * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * //
103 template<class CloudType>
104 Foam::CloudFunctionObjectList<CloudType>::~CloudFunctionObjectList()
108 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
110 template<class CloudType>
111 void Foam::CloudFunctionObjectList<CloudType>::preEvolve()
113     forAll(*this, i)
114     {
115         this->operator[](i).preEvolve();
116     }
120 template<class CloudType>
121 void Foam::CloudFunctionObjectList<CloudType>::postEvolve()
123     forAll(*this, i)
124     {
125         this->operator[](i).postEvolve();
126     }
130 template<class CloudType>
131 void Foam::CloudFunctionObjectList<CloudType>::postMove
133     const typename CloudType::parcelType& p,
134     const label cellI,
135     const scalar dt
138     forAll(*this, i)
139     {
140         this->operator[](i).postMove(p, cellI, dt);
141     }
145 template<class CloudType>
146 void Foam::CloudFunctionObjectList<CloudType>::postPatch
148     const typename CloudType::parcelType& p,
149     const label patchI,
150     const label patchFaceI
153     forAll(*this, i)
154     {
155         this->operator[](i).postPatch(p, patchI, patchFaceI);
156     }
160 template<class CloudType>
161 void Foam::CloudFunctionObjectList<CloudType>::postFace
163     const typename CloudType::parcelType& p,
164     const label faceI
167     forAll(*this, i)
168     {
169         this->operator[](i).postFace(p, faceI);
170     }
174 // ************************************************************************* //