FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 2008-2010 OpenCFD Ltd.
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 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class PatchPostProcessing Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class CloudType>
51 :
52  public PostProcessingModel<CloudType>
53 {
54  // Private data
55 
56  typedef typename CloudType::parcelType parcelType;
57 
58  //- Reference to the mesh
59  const polyMesh& mesh_;
60 
61  //- Maximum number of parcels to store
62  label maxStoredParcels_;
63 
64  //- List of patch names
65  wordList patchNames_;
66 
67  //- List of output data per patch
68  List<DynamicList<string> > patchData_;
69 
70  //- Mapping from local to global patch ids
71  labelList patchIds_;
72 
73 
74  // Private member functions
75 
76  //- Returns local patchI if patch is in patchIds_ list
77  label applyToPatch(const label globalPatchI) const;
78 
79 
80 protected:
81 
82  // Protected member functions
83 
84  //- Write post-processing info
85  void write();
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("PatchPostProcessing");
92 
93 
94  // Constructors
95 
96  //- Construct from dictionary
97  PatchPostProcessing(const dictionary& dict, CloudType& owner);
98 
99 
100  //- Destructor
101  virtual ~PatchPostProcessing();
102 
103 
104  // Member Functions
105 
106  // Access
107 
108  //- Return const access to the mesh
109  inline const polyMesh& mesh() const;
110 
111  //- Return maximum number of parcels to store per patch
112  inline label maxStoredParcels() const;
113 
114  //- Return const access to the list of patch names
115  inline const wordList& patchNames() const;
116 
117  //- Return const mapping from local to global patch ids
118  inline const labelList& patchIds() const;
119 
120 
121  // Evaluation
122 
123  //- Flag to indicate whether model activates post-processing model
124  virtual bool active() const;
125 
126  //- Gather post-processing info on patch
127  virtual void postPatch
128  (
129  const parcelType& p,
130  const label patchI
131  );
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #include "PatchPostProcessingI.H"
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
146 # include "PatchPostProcessing.C"
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************ vim: set sw=4 sts=4 et: ************************ //