initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / IntegrationScheme / IntegrationScheme / IntegrationScheme.H
blobb8b3859a0f255289f8c7365d62965a6281a40f35
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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
26 Class
27     Foam::IntegrationScheme
29 Description
30     Top level model for Integration schemes
32 SourceFiles
33     IntegrationScheme.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef IntegrationScheme_H
38 #define IntegrationScheme_H
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "dictionary.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                      Class IntegrationScheme Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class Type>
54 class IntegrationScheme
56     // Private data
58         //- Name of the Integration variable
59         const word& phiName_;
61         //- Reference to the dictionary
62         const dictionary& dict_;
65     // Private Member Functions
67         //- Disallow default bitwise copy construct
68         IntegrationScheme(const IntegrationScheme&);
70         //- Disallow default bitwise assignment
71         void operator=(const IntegrationScheme&);
74 public:
76     //- Runtime type information
77     TypeName("IntegrationScheme");
80     //- Declare runtime constructor selection table
82          declareRunTimeSelectionTable
83          (
84              autoPtr,
85              IntegrationScheme,
86              dictionary,
87              (
88                  const word& phiName,
89                  const dictionary& dict
90              ),
91              (phiName, dict)
92          );
95     // Constructors
97         //- Construct from components
98         IntegrationScheme
99         (
100             const word& phiName,
101             const dictionary& dict
102         );
105     // Selectors
107         //- Return a reference to the selected radiation model
108         static autoPtr<IntegrationScheme> New
109         (
110             const word& phiName,
111             const dictionary& dict
112         );
115     //- Destructor
117         virtual ~IntegrationScheme();
120     // Member Functions
122         //- Perform the Integration
123         virtual Type integrate
124         (
125             const Type phi,
126             const scalar dt,
127             const Type alpha,
128             const scalar beta
129         ) const = 0;
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 } // End namespace Foam
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 #define makeIntegrationScheme(Type)                                           \
140                                                                               \
141     defineNamedTemplateTypeNameAndDebug(IntegrationScheme<Type>, 0);          \
142                                                                               \
143     defineTemplateRunTimeSelectionTable                                       \
144     (                                                                         \
145         IntegrationScheme<Type>,                                               \
146         dictionary                                                            \
147     );
150 #define makeIntegrationSchemeType(SS, Type)                                   \
151                                                                               \
152     defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                         \
153                                                                               \
154     IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type> >          \
155         add##SS##Type##ConstructorToTable_;
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 #ifdef NoRepository
161 #   include "IntegrationScheme.C"
162 #endif
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
168 // ************************************************************************* //