initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / PostProcessingModel / PostProcessingModel / PostProcessingModel.H
blob311169aa3aa472f0659b86c1e4ed7ab9cc80e433
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::PostProcessingModel
28 Description
29     Templated post-processing model class
31 SourceFiles
32     PostProcessingModel.C
33     NewPostProcessingModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef PostProcessingModel_H
38 #define PostProcessingModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                     Class PostProcessingModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class PostProcessingModel
56     // Private data
58         //- The cloud dictionary
59         const dictionary& dict_;
61         //- Reference to the owner cloud class
62         CloudType& owner_;
64         //- The coefficients dictionary
65         const dictionary coeffDict_;
68 protected:
70     // Protected member functions
72         //- Write post-processing info
73         virtual void write() = 0;
76 public:
78     //- Runtime type information
79     TypeName("PostProcessingModel");
81     //- Declare runtime constructor selection table
82     declareRunTimeSelectionTable
83     (
84         autoPtr,
85         PostProcessingModel,
86         dictionary,
87         (
88             const dictionary& dict,
89             CloudType& owner
90         ),
91         (dict, owner)
92     );
95     // Constructors
97         //- Construct null from owner
98         PostProcessingModel(CloudType& owner);
100         //- Construct from dictionary
101         PostProcessingModel
102         (
103             const dictionary& dict,
104             CloudType& owner,
105             const word& type
106         );
109     //- Destructor
110     virtual ~PostProcessingModel();
113     //- Selector
114     static autoPtr<PostProcessingModel<CloudType> > New
115     (
116         const dictionary& dict,
117         CloudType& owner
118     );
121     // Member Functions
123         // Access
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;
138         // Evaluation
140             //- Main post-processing function
141             virtual void post();
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
148             (
149                 const typename CloudType::parcelType& p,
150                 const label patchI
151             ) = 0;
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 #define makePostProcessingModel(CloudType)                                    \
162                                                                               \
163     defineNamedTemplateTypeNameAndDebug(PostProcessingModel<CloudType>, 0);   \
164                                                                               \
165     defineTemplateRunTimeSelectionTable                                       \
166     (                                                                         \
167         PostProcessingModel<CloudType>,                                       \
168         dictionary                                                            \
169     );
172 #define makePostProcessingModelType(SS, CloudType, ParcelType)                \
173                                                                               \
174     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
175                                                                               \
176     PostProcessingModel<CloudType<ParcelType> >::                             \
177         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
178             add##SS##CloudType##ParcelType##ConstructorToTable_;
181 #define makePostProcessingModelThermoType(SS, CloudType, ParcelType, ThermoType)\
182                                                                               \
183     defineNamedTemplateTypeNameAndDebug                                       \
184     (                                                                         \
185         SS<CloudType<ParcelType<ThermoType> > >,                              \
186         0                                                                     \
187     );                                                                        \
188                                                                               \
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #ifdef NoRepository
202 #   include "PostProcessingModel.C"
203 #endif
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //