limitedSurfaceInterpolationScheme.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 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::limitedSurfaceInterpolationScheme
26 
27 Description
28  Abstract base class for limited surface interpolation schemes.
29 
30 SourceFiles
31  limitedSurfaceInterpolationScheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef limitedSurfaceInterpolationScheme_H
36 #define limitedSurfaceInterpolationScheme_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class limitedSurfaceInterpolationScheme Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
51 :
52  public surfaceInterpolationScheme<Type>
53 {
54  // Private Member Functions
55 
56  //- Disallow copy construct
58  (
60  );
61 
62  //- Disallow default bitwise assignment
63  void operator=(const limitedSurfaceInterpolationScheme&);
64 
65 
66 protected:
67 
68  // Protected data
69 
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("limitedSurfaceInterpolationScheme");
77 
78 
79  // Declare run-time constructor selection tables
80 
82  (
83  tmp,
85  Mesh,
86  (
87  const fvMesh& mesh,
88  Istream& schemeData
89  ),
90  (mesh, schemeData)
91  );
92 
94  (
95  tmp,
97  MeshFlux,
98  (
99  const fvMesh& mesh,
100  const surfaceScalarField& faceFlux,
101  Istream& schemeData
102  ),
103  (mesh, faceFlux, schemeData)
104  );
105 
106 
107  // Constructors
108 
109  //- Construct from mesh and faceFlux
111  (
112  const fvMesh& mesh,
113  const surfaceScalarField& faceFlux
114  )
115  :
116  surfaceInterpolationScheme<Type>(mesh),
117  faceFlux_(faceFlux)
118  {}
119 
120 
121  //- Construct from mesh and Istream.
122  // The name of the flux field is read from the Istream and looked-up
123  // from the mesh objectRegistry
125  (
126  const fvMesh& mesh,
127  Istream& is
128  )
129  :
130  surfaceInterpolationScheme<Type>(mesh),
131  faceFlux_
132  (
133  mesh.lookupObject<surfaceScalarField>
134  (
135  word(is)
136  )
137  )
138  {}
139 
140 
141  // Selectors
142 
143  //- Return new tmp interpolation scheme
145  (
146  const fvMesh& mesh,
147  Istream& schemeData
148  );
149 
150  //- Return new tmp interpolation scheme
152  (
153  const fvMesh& mesh,
154  const surfaceScalarField& faceFlux,
155  Istream& schemeData
156  );
157 
158 
159  //- Destructor
161 
162 
163  // Member Functions
164 
165  //- Return the interpolation weighting factors
167  (
169  ) const = 0;
170 
171  //- Return the interpolation weighting factors for the given field,
172  // by limiting the given weights with the given limiter
174  (
176  const surfaceScalarField& CDweights,
177  tmp<surfaceScalarField> tLimiter
178  ) const;
179 
180  //- Return the interpolation weighting factors for the given field
182  (
184  ) const;
185 
186  //- Return the interpolation weighting factors
188  flux
189  (
191  ) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 // Add the patch constructor functions to the hash tables
203 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type) \
204  \
205 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
206  \
207 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> > \
208  add##SS##Type##MeshConstructorToTable_; \
209  \
210 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> > \
211  add##SS##Type##MeshFluxConstructorToTable_; \
212  \
213 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> > \
214  add##SS##Type##MeshConstructorToLimitedTable_; \
215  \
216 limitedSurfaceInterpolationScheme<Type>:: \
217  addMeshFluxConstructorToTable<SS<Type> > \
218  add##SS##Type##MeshFluxConstructorToLimitedTable_;
220 #define makelimitedSurfaceInterpolationScheme(SS) \
221  \
222 makelimitedSurfaceInterpolationTypeScheme(SS, scalar) \
223 makelimitedSurfaceInterpolationTypeScheme(SS, vector) \
224 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
225 makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor) \
226 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #ifdef NoRepository
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const =0
Return the interpolation weighting factors.
TypeName("limitedSurfaceInterpolationScheme")
Runtime type information.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A class for handling words, derived from string.
Definition: word.H:59
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &, const surfaceScalarField &CDweights, tmp< surfaceScalarField > tLimiter) const
Return the interpolation weighting factors for the given field,.
Namespace for OpenFOAM.
Abstract base class for surface interpolation schemes.
declareRunTimeSelectionTable(tmp, limitedSurfaceInterpolationScheme, Mesh,( const fvMesh &mesh, Istream &schemeData ),(mesh, schemeData))
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Abstract base class for limited surface interpolation schemes.
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
A class for managing temporary objects.
Definition: PtrList.H:118