1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::PostProcessingModel
29 Templated post-processing model class
33 NewPostProcessingModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef PostProcessingModel_H
38 #define PostProcessingModel_H
40 #include "IOdictionary.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class PostProcessingModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class PostProcessingModel
58 //- The cloud dictionary
59 const dictionary& dict_;
61 //- Reference to the owner cloud class
64 //- The coefficients dictionary
65 const dictionary coeffDict_;
70 // Protected member functions
72 //- Write post-processing info
73 virtual void write() = 0;
78 //- Runtime type information
79 TypeName("PostProcessingModel");
81 //- Declare runtime constructor selection table
82 declareRunTimeSelectionTable
88 const dictionary& dict,
97 //- Construct null from owner
98 PostProcessingModel(CloudType& owner);
100 //- Construct from dictionary
103 const dictionary& dict,
110 virtual ~PostProcessingModel();
114 static autoPtr<PostProcessingModel<CloudType> > New
116 const dictionary& dict,
125 //- Return the owner cloud dictionary
126 inline const dictionary& dict() const;
128 //- Return const access the owner cloud object
129 inline const CloudType& owner() const;
131 //- Return non-const access the owner cloud object for manipulation
132 inline CloudType& owner();
134 //- Return the coefficients dictionary
135 inline const dictionary& coeffDict() const;
140 //- Main post-processing function
143 //- Flag to indicate whether model activates post-processing model
144 virtual bool active() const = 0;
146 //- Gather post-processing info on patch
147 virtual void postPatch
149 const typename CloudType::parcelType& p,
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 #define makePostProcessingModel(CloudType) \
163 defineNamedTemplateTypeNameAndDebug(PostProcessingModel<CloudType>, 0); \
165 defineTemplateRunTimeSelectionTable \
167 PostProcessingModel<CloudType>, \
172 #define makePostProcessingModelType(SS, CloudType, ParcelType) \
174 defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
176 PostProcessingModel<CloudType<ParcelType> >:: \
177 adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
178 add##SS##CloudType##ParcelType##ConstructorToTable_;
181 #define makePostProcessingModelThermoType(SS, CloudType, ParcelType, ThermoType)\
183 defineNamedTemplateTypeNameAndDebug \
185 SS<CloudType<ParcelType<ThermoType> > >, \
189 PostProcessingModel<CloudType<ParcelType<ThermoType> > >:: \
190 adddictionaryConstructorToTable \
191 <SS<CloudType<ParcelType<ThermoType> > > > \
192 add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #include "PostProcessingModelI.H"
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "PostProcessingModel.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //