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-------------------------------------------------------------------------------
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/>.
26
27Class
28 Foam::PatchPostProcessing
29
30Group
31 grpLagrangianIntermediateFunctionObjects
32
33Description
34 Standard post-processing
35
36SourceFiles
37 PatchPostProcessing.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef PatchPostProcessing_H
42#define PatchPostProcessing_H
43
44#include "CloudFunctionObject.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class PatchPostProcessing Declaration
53\*---------------------------------------------------------------------------*/
54
55template<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
89protected:
90
91 // Protected Member Functions
92
93 //- Write post-processing info
94 void write();
95
96
97public:
98
99 //- Runtime type information
100 TypeName("patchPostProcessing");
101
102
103 // Constructors
104
105 //- Construct from dictionary
107 (
108 const dictionary& dict,
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// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
ParticleType particleType
Definition: Cloud.H:114
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Standard post-processing.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
label maxStoredParcels() const
Return maximum number of parcels to store per patch.
const labelList & patchIDs() const
Return const mapping from local to global patch ids.
virtual ~PatchPostProcessing()=default
Destructor.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
void write()
Write post-processing info.
TypeName("patchPostProcessing")
Runtime type information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73