FreeFOAM The Cross-Platform CFD Toolkit
d2dt2Scheme.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) 1991-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::fv::d2dt2Scheme
26 
27 Description
28  Abstract base class for d2dt2 schemes.
29 
30 SourceFiles
31  d2dt2Scheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef d2dt2Scheme_H
36 #define d2dt2Scheme_H
37 
38 #include <OpenFOAM/tmp.H>
42 #include <OpenFOAM/typeInfo.H>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 template<class Type>
51 class fvMatrix;
52 
53 class fvMesh;
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class d2dt2Scheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
66 :
67  public refCount
68 {
69 
70 protected:
71 
72  // Protected data
73 
74  const fvMesh& mesh_;
75 
76 
77  // Private Member Functions
78 
79  //- Disallow copy construct
80  d2dt2Scheme(const d2dt2Scheme&);
81 
82  //- Disallow default bitwise assignment
83  void operator=(const d2dt2Scheme&);
84 
85 
86 public:
87 
88  //- Runtime type information
89  virtual const word& type() const = 0;
90 
91 
92  // Declare run-time constructor selection tables
93 
95  (
96  tmp,
98  Istream,
99  (const fvMesh& mesh, Istream& schemeData),
100  (mesh, schemeData)
101  );
102 
103 
104  // Constructors
105 
106  //- Construct from mesh
107  d2dt2Scheme(const fvMesh& mesh)
108  :
109  mesh_(mesh)
110  {}
111 
112  //- Construct from mesh and Istream
113  d2dt2Scheme(const fvMesh& mesh, Istream&)
114  :
115  mesh_(mesh)
116  {}
117 
118 
119  // Selectors
120 
121  //- Return a pointer to a new d2dt2Scheme created on freestore
122  static tmp<d2dt2Scheme<Type> > New
123  (
124  const fvMesh& mesh,
125  Istream& schemeData
126  );
127 
128 
129  // Destructor
130 
131  virtual ~d2dt2Scheme();
132 
133 
134  // Member Functions
135 
136  //- Return mesh reference
137  const fvMesh& mesh() const
138  {
139  return mesh_;
140  }
141 
143  (
145  ) = 0;
146 
148  (
149  const volScalarField&,
151  ) = 0;
152 
153  virtual tmp<fvMatrix<Type> > fvmD2dt2
154  (
156  ) = 0;
157 
158  virtual tmp<fvMatrix<Type> > fvmD2dt2
159  (
160  const dimensionedScalar&,
162  ) = 0;
163 
164  virtual tmp<fvMatrix<Type> > fvmD2dt2
165  (
166  const volScalarField&,
168  ) = 0;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace fv
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 // Add the patch constructor functions to the hash tables
183 
184 #define makeFvD2dt2TypeScheme(SS, Type) \
185  \
186 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
187  \
188 d2dt2Scheme<Type>::addIstreamConstructorToTable<SS<Type> > \
189  add##SS##Type##IstreamConstructorToTable_;
190 
191 
192 #define makeFvD2dt2Scheme(SS) \
193  \
194 makeFvD2dt2TypeScheme(SS, scalar) \
195 makeFvD2dt2TypeScheme(SS, vector) \
196 makeFvD2dt2TypeScheme(SS, sphericalTensor) \
197 makeFvD2dt2TypeScheme(SS, symmTensor) \
198 makeFvD2dt2TypeScheme(SS, tensor)
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #ifdef NoRepository
204 # include <finiteVolume/d2dt2Scheme.C>
205 #endif
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************ vim: set sw=4 sts=4 et: ************************ //