PatchPostProcessing.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::PatchPostProcessing
26 
27 Description
28  Standard post-processing
29 
30 SourceFiles
31  PatchPostProcessing.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef PatchPostProcessing_H
36 #define PatchPostProcessing_H
37 
38 #include "CloudFunctionObject.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class PatchPostProcessing Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class CloudType>
51 :
52  public CloudFunctionObject<CloudType>
53 {
54  // Private Data
55 
56  typedef typename CloudType::particleType parcelType;
57 
58  //- Maximum number of parcels to store - set as a scalar for I/O
59  scalar maxStoredParcels_;
60 
61  //- List of patch indices to post-process
62  labelList patchIDs_;
63 
64  //- List of time for each data record
66 
67  //- List of output data per patch
68  List<DynamicList<string>> patchData_;
69 
70 
71  // Private Member Functions
72 
73  //- Returns local patchi if patch is in patchIds_ list
74  label applyToPatch(const label globalPatchi) const;
75 
76 
77 protected:
78 
79  // Protected Member Functions
80 
81  //- Write post-processing info
82  void write();
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("patchPostProcessing");
89 
90 
91  // Constructors
92 
93  //- Construct from dictionary
95  (
96  const dictionary& dict,
98  const word& modelName
99  );
100 
101  //- Construct copy
103 
104  //- Construct and return a clone
106  {
108  (
110  );
111  }
112 
113 
114  //- Destructor
115  virtual ~PatchPostProcessing();
116 
117 
118  // Member Functions
119 
120  // Access
121 
122  //- Return maximum number of parcels to store per patch
123  inline label maxStoredParcels() const;
124 
125  //- Return const mapping from local to global patch ids
126  inline const labelList& patchIDs() const;
127 
128 
129  // Evaluation
130 
131  //- Post-patch hook
132  virtual void postPatch
133  (
134  const parcelType& p,
135  const polyPatch& pp,
136  bool& keepParticle
137  );
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #include "PatchPostProcessingI.H"
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
152  #include "PatchPostProcessing.C"
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:105
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void write()
Write post-processing info.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual ~PatchPostProcessing()
Destructor.
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
TypeName("patchPostProcessing")
Runtime type information.
const CloudType & owner() const
Return const access to the owner cloud.
label maxStoredParcels() const
Return maximum number of parcels to store per patch.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
A class for handling words, derived from string.
Definition: word.H:59
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Standard post-processing.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated cloud function object base class.
const labelList & patchIDs() const
Return const mapping from local to global patch ids.
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Namespace for OpenFOAM.