laplacianScheme.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) 2011-2015 OpenFOAM Foundation
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::laplacianScheme
26 
27 Description
28  Abstract base class for laplacian schemes.
29 
30 SourceFiles
31  laplacianScheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef laplacianScheme_H
36 #define laplacianScheme_H
37 
38 #include "tmp.H"
39 #include "volFieldsFwd.H"
40 #include "surfaceFieldsFwd.H"
41 #include "linear.H"
42 #include "correctedSnGrad.H"
43 #include "typeInfo.H"
44 #include "runTimeSelectionTables.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 template<class Type>
52 class fvMatrix;
53 
54 class fvMesh;
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace fv
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class laplacianScheme Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Type, class GType>
66 class laplacianScheme
67 :
68  public refCount
69 {
70 
71 protected:
72 
73  // Protected data
74 
75  const fvMesh& mesh_;
78 
79 
80  // Private Member Functions
81 
82  //- Disallow copy construct
84 
85  //- Disallow default bitwise assignment
86  void operator=(const laplacianScheme&);
87 
88 
89 public:
90 
91  //- Runtime type information
92  virtual const word& type() const = 0;
93 
94 
95  // Declare run-time constructor selection tables
96 
98  (
99  tmp,
101  Istream,
102  (const fvMesh& mesh, Istream& schemeData),
103  (mesh, schemeData)
104  );
105 
106 
107  // Constructors
108 
109  //- Construct from mesh
110  laplacianScheme(const fvMesh& mesh)
111  :
112  mesh_(mesh),
113  tinterpGammaScheme_(new linear<GType>(mesh)),
115  {}
116 
117  //- Construct from mesh and Istream
118  laplacianScheme(const fvMesh& mesh, Istream& is)
119  :
120  mesh_(mesh),
121  tinterpGammaScheme_(NULL),
122  tsnGradScheme_(NULL)
123  {
125  (
127  );
128 
130  (
132  );
133  }
134 
135  //- Construct from mesh, interpolation and snGradScheme schemes
137  (
138  const fvMesh& mesh,
140  const tmp<snGradScheme<Type> >& sngs
141  )
142  :
143  mesh_(mesh),
144  tinterpGammaScheme_(igs),
145  tsnGradScheme_(sngs)
146  {}
147 
148 
149  // Selectors
150 
151  //- Return a pointer to a new laplacianScheme created on freestore
153  (
154  const fvMesh& mesh,
155  Istream& schemeData
156  );
157 
158 
159  //- Destructor
160  virtual ~laplacianScheme();
161 
162 
163  // Member Functions
164 
165  //- Return mesh reference
166  const fvMesh& mesh() const
167  {
168  return mesh_;
169  }
170 
172  (
175  ) = 0;
176 
178  (
181  );
182 
184  (
186  ) = 0;
187 
189  (
192  ) = 0;
193 
195  (
198  );
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace fv
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 // Add the patch constructor functions to the hash tables
213 
214 #define makeFvLaplacianTypeScheme(SS, GType, Type) \
215  typedef Foam::fv::SS<Foam::Type, Foam::GType> SS##Type##GType; \
216  defineNamedTemplateTypeNameAndDebug(SS##Type##GType, 0); \
217  \
218  namespace Foam \
219  { \
220  namespace fv \
221  { \
222  typedef SS<Type, GType> SS##Type##GType; \
223  \
224  laplacianScheme<Type, GType>:: \
225  addIstreamConstructorToTable<SS<Type, GType> > \
226  add##SS##Type##GType##IstreamConstructorToTable_; \
227  } \
228  }
229 
230 
231 #define makeFvLaplacianScheme(SS) \
232  \
233 makeFvLaplacianTypeScheme(SS, scalar, scalar) \
234 makeFvLaplacianTypeScheme(SS, symmTensor, scalar) \
235 makeFvLaplacianTypeScheme(SS, tensor, scalar) \
236 makeFvLaplacianTypeScheme(SS, scalar, vector) \
237 makeFvLaplacianTypeScheme(SS, symmTensor, vector) \
238 makeFvLaplacianTypeScheme(SS, tensor, vector) \
239 makeFvLaplacianTypeScheme(SS, scalar, sphericalTensor) \
240 makeFvLaplacianTypeScheme(SS, symmTensor, sphericalTensor) \
241 makeFvLaplacianTypeScheme(SS, tensor, sphericalTensor) \
242 makeFvLaplacianTypeScheme(SS, scalar, symmTensor) \
243 makeFvLaplacianTypeScheme(SS, symmTensor, symmTensor) \
244 makeFvLaplacianTypeScheme(SS, tensor, symmTensor) \
245 makeFvLaplacianTypeScheme(SS, scalar, tensor) \
246 makeFvLaplacianTypeScheme(SS, symmTensor, tensor) \
247 makeFvLaplacianTypeScheme(SS, tensor, tensor)
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 #ifdef NoRepository
252 # include "laplacianScheme.C"
253 #endif
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
258 
259 // ************************************************************************* //
Foam::fv::laplacianScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: laplacianScheme.H:165
volFieldsFwd.H
Foam::fv::laplacianScheme::New
static tmp< laplacianScheme< Type, GType > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
Definition: laplacianScheme.C:45
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
typeInfo.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:45
Foam::fv::laplacianScheme::tinterpGammaScheme_
tmp< surfaceInterpolationScheme< GType > > tinterpGammaScheme_
Definition: laplacianScheme.H:75
laplacianScheme.C
Foam::fv::laplacianScheme
Abstract base class for laplacian schemes.
Definition: laplacianScheme.H:65
Foam::fv::laplacianScheme::mesh_
const fvMesh & mesh_
Definition: laplacianScheme.H:74
Foam::fv::laplacianScheme::~laplacianScheme
virtual ~laplacianScheme()
Destructor.
Definition: laplacianScheme.C:91
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::fv::laplacianScheme::laplacianScheme
laplacianScheme(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: laplacianScheme.H:117
Foam::fv::laplacianScheme::fvmLaplacian
virtual tmp< fvMatrix< Type > > fvmLaplacian(const GeometricField< GType, fvsPatchField, surfaceMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)=0
Foam::fv::laplacianScheme::laplacianScheme
laplacianScheme(const fvMesh &mesh)
Construct from mesh.
Definition: laplacianScheme.H:109
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
correctedSnGrad.H
Foam::fv::laplacianScheme::type
virtual const word & type() const =0
Runtime type information.
Foam::fv::laplacianScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, laplacianScheme, Istream,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
fv
labelList fv(nPoints)
tmp.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::surfaceInterpolationScheme::New
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: surfaceInterpolationScheme.C:44
Foam::fv::laplacianScheme::tsnGradScheme_
tmp< snGradScheme< Type > > tsnGradScheme_
Definition: laplacianScheme.H:76
surfaceFieldsFwd.H
Foam::fv::correctedSnGrad
Simple central-difference snGrad scheme with non-orthogonal correction.
Definition: correctedSnGrad.H:54
Foam::fv::laplacianScheme::fvcLaplacian
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcLaplacian(const GeometricField< Type, fvPatchField, volMesh > &)=0
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:55
Foam::fv::snGradScheme
Abstract base class for snGrad schemes.
Definition: snGradScheme.H:60
Foam::fv::snGradScheme::New
static tmp< snGradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: snGradScheme.C:46
Foam::linear
Central-differencing interpolation scheme class.
Definition: linear.H:50
Foam::fv::laplacianScheme::operator=
void operator=(const laplacianScheme &)
Disallow default bitwise assignment.
Foam::fv::laplacianScheme::laplacianScheme
laplacianScheme(const laplacianScheme &)
Disallow copy construct.
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52