CloudFunctionObjectList.H
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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 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 Class
28  Foam::CloudFunctionObjectList
29 
30 Description
31  List of cloud function objects
32 
33 SourceFiles
34  CloudFunctionObjectListI.H
35  CloudFunctionObjectList.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef CloudFunctionObjectList_H
40 #define CloudFunctionObjectList_H
41 
42 #include "PtrList.H"
43 #include "CloudFunctionObject.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class CloudFunctionObjectList Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
56 :
57  public PtrList<CloudFunctionObject<CloudType>>
58 {
59 private:
60 
61  //- Convenience typedef for parcel type
62  typedef typename CloudType::parcelType parcelType;
63 
64 
65 protected:
66 
67  // Protected Data
68 
69  //- Reference to the owner cloud
70  const CloudType& owner_;
71 
72  //- Dictionary
73  const dictionary dict_;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Null constructor
82 
83  //- Construct from mesh
85  (
87  const dictionary& dict,
88  const bool readFields
89  );
90 
91  //- Construct copy
93 
94 
95  //- Destructor
96  virtual ~CloudFunctionObjectList() = default;
97 
98 
99  // Member Functions
100 
101  // Access
102 
103  //- Return const access to the cloud owner
104  inline const CloudType& owner() const;
105 
106  //- Return reference to the cloud owner
107  inline CloudType& owner();
108 
109  //- Return the forces dictionary
110  inline const dictionary& dict() const;
111 
112 
113  // Evaluation
114 
115  //- Pre-evolve hook
116  virtual void preEvolve
117  (
118  const typename parcelType::trackingData& td
119  );
120 
121  //- Post-evolve hook
122  virtual void postEvolve
123  (
124  const typename parcelType::trackingData& td
125  );
126 
127  //- Post-move hook
128  virtual void postMove
129  (
130  parcelType& p,
131  const scalar dt,
132  const point& position0,
133  bool& keepParticle
134  );
135 
136  //- Post-patch hook
137  virtual void postPatch
138  (
139  const parcelType& p,
140  const polyPatch& pp,
141  bool& keepParticle
142  );
143 
144  //- Post-face hook
145  virtual void postFace
146  (
147  const parcelType& p,
148  bool& keepParticle
149  );
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
160 
161 #ifdef NoRepository
162  #include "CloudFunctionObjectList.C"
163 #endif
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Foam::CloudFunctionObjectList::postEvolve
virtual void postEvolve(const typename parcelType::trackingData &td)
Post-evolve hook.
Definition: CloudFunctionObjectList.C:122
p
volScalarField & p
Definition: createFieldRefs.H:8
CloudFunctionObjectList.C
Foam::CloudFunctionObjectList::postPatch
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Definition: CloudFunctionObjectList.C:156
Foam::CloudFunctionObjectList::owner_
const CloudType & owner_
Reference to the owner cloud.
Definition: CloudFunctionObjectList.H:69
CloudFunctionObject.H
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::CloudFunctionObjectList::~CloudFunctionObjectList
virtual ~CloudFunctionObjectList()=default
Destructor.
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::CloudFunctionObjectList::postFace
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
Definition: CloudFunctionObjectList.C:176
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::CloudFunctionObjectList
List of cloud function objects.
Definition: CloudFunctionObjectList.H:54
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
CloudFunctionObjectListI.H
Foam::CloudFunctionObjectList::owner
const CloudType & owner() const
Return const access to the cloud owner.
Definition: CloudFunctionObjectListI.H:29
Foam::Vector< scalar >
Foam::CloudFunctionObjectList::dict_
const dictionary dict_
Dictionary.
Definition: CloudFunctionObjectList.H:72
PtrList.H
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::CloudFunctionObjectList::CloudFunctionObjectList
CloudFunctionObjectList(CloudType &owner)
Null constructor.
Definition: CloudFunctionObjectList.C:36
Foam::CloudFunctionObjectList::postMove
virtual void postMove(parcelType &p, const scalar dt, const point &position0, bool &keepParticle)
Post-move hook.
Definition: CloudFunctionObjectList.C:135
Foam::CloudFunctionObjectList::preEvolve
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
Definition: CloudFunctionObjectList.C:109
Foam::CloudFunctionObjectList::dict
const dictionary & dict() const
Return the forces dictionary.
Definition: CloudFunctionObjectListI.H:44