PatchPostProcessing.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) 2019 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::PatchPostProcessing
29 
30 Group
31  grpLagrangianIntermediateFunctionObjects
32 
33 Description
34  Standard post-processing
35 
36 SourceFiles
37  PatchPostProcessing.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef PatchPostProcessing_H
42 #define PatchPostProcessing_H
43 
44 #include "CloudFunctionObject.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class PatchPostProcessing Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class CloudType>
57 :
58  public CloudFunctionObject<CloudType>
59 {
60  // Private data
61 
62  typedef typename CloudType::particleType parcelType;
63 
64  //- Maximum number of parcels to store - set as a scalar for I/O
65  scalar maxStoredParcels_;
66 
67  //- Field name filters
68  wordRes fields_;
69 
70  //- List of patch indices to post-process
71  labelList patchIDs_;
72 
73  //- List of time for each data record
75 
76  //- List of output data per patch
77  List<DynamicList<string>> patchData_;
78 
79  //- Field header
80  string header_;
81 
82 
83  // Private Member Functions
84 
85  //- Returns local patchi if patch is in patchIds_ list
86  label applyToPatch(const label globalPatchi) const;
87 
88 
89 protected:
90 
91  // Protected Member Functions
92 
93  //- Write post-processing info
94  void write();
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("patchPostProcessing");
101 
102 
103  // Constructors
104 
105  //- Construct from dictionary
107  (
108  const dictionary& dict,
109  CloudType& owner,
110  const word& modelName
111  );
112 
113  //- Construct copy
115 
116  //- Construct and return a clone
118  {
120  (
122  );
123  }
124 
125 
126  //- Destructor
127  virtual ~PatchPostProcessing() = default;
128 
129 
130  // Member Functions
131 
132  // Access
133 
134  //- Return maximum number of parcels to store per patch
135  inline label maxStoredParcels() const;
136 
137  //- Return const mapping from local to global patch ids
138  inline const labelList& patchIDs() const;
139 
140 
141  // Evaluation
142 
143  //- Post-patch hook
144  virtual void postPatch
145  (
146  const parcelType& p,
147  const polyPatch& pp,
148  bool& keepParticle
149  );
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #include "PatchPostProcessingI.H"
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
164  #include "PatchPostProcessing.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::PatchPostProcessing::patchIDs
const labelList & patchIDs() const
Return const mapping from local to global patch ids.
Definition: PatchPostProcessingI.H:36
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
CloudFunctionObject.H
Foam::PatchPostProcessing::clone
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: PatchPostProcessing.H:116
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:106
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::PatchPostProcessing
Standard post-processing.
Definition: PatchPostProcessing.H:55
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::Cloud::particleType
ParticleType particleType
Definition: Cloud.H:114
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PatchPostProcessing::~PatchPostProcessing
virtual ~PatchPostProcessing()=default
Destructor.
Foam::PatchPostProcessing::postPatch
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Definition: PatchPostProcessing.C:188
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::PatchPostProcessing::maxStoredParcels
label maxStoredParcels() const
Return maximum number of parcels to store per patch.
Definition: PatchPostProcessingI.H:29
PatchPostProcessing.C
Foam::List< label >
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:62
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::PatchPostProcessing::TypeName
TypeName("patchPostProcessing")
Runtime type information.
Foam::PatchPostProcessing::write
void write()
Write post-processing info.
Definition: PatchPostProcessing.C:50
Foam::PatchPostProcessing::PatchPostProcessing
PatchPostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: PatchPostProcessing.C:119
PatchPostProcessingI.H