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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::limitedSurfaceInterpolationScheme
28 
29 Group
30  grpFvLimitedSurfaceInterpolationSchemes
31 
32 Description
33  Abstract base class for limited surface interpolation schemes.
34 
35 SourceFiles
36  limitedSurfaceInterpolationScheme.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef limitedSurfaceInterpolationScheme_H
41 #define limitedSurfaceInterpolationScheme_H
42 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class limitedSurfaceInterpolationScheme Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public surfaceInterpolationScheme<Type>
58 {
59  // Private Member Functions
60 
61  //- No copy construct
63  (
65  ) = delete;
66 
67  //- No copy assignment
68  void operator=(const limitedSurfaceInterpolationScheme&) = delete;
69 
70 
71 protected:
72 
73  // Protected data
74 
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("limitedSurfaceInterpolationScheme");
82 
83 
84  // Declare run-time constructor selection tables
85 
87  (
88  tmp,
90  Mesh,
91  (
92  const fvMesh& mesh,
93  Istream& schemeData
94  ),
95  (mesh, schemeData)
96  );
97 
99  (
100  tmp,
102  MeshFlux,
103  (
104  const fvMesh& mesh,
105  const surfaceScalarField& faceFlux,
106  Istream& schemeData
107  ),
108  (mesh, faceFlux, schemeData)
109  );
110 
111 
112  // Constructors
113 
114  //- Construct from mesh and faceFlux
116  (
117  const fvMesh& mesh,
118  const surfaceScalarField& faceFlux
119  )
120  :
122  faceFlux_(faceFlux)
123  {}
124 
125 
126  //- Construct from mesh and Istream.
127  // The name of the flux field is read from the Istream and looked-up
128  // from the mesh objectRegistry
130  (
131  const fvMesh& mesh,
132  Istream& is
133  )
134  :
136  faceFlux_
137  (
138  mesh.lookupObject<surfaceScalarField>
139  (
140  word(is)
141  )
142  )
143  {}
144 
145 
146  // Selectors
147 
148  //- Return new tmp interpolation scheme
150  (
151  const fvMesh& mesh,
152  Istream& schemeData
153  );
154 
155  //- Return new tmp interpolation scheme
157  (
158  const fvMesh& mesh,
159  const surfaceScalarField& faceFlux,
160  Istream& schemeData
161  );
162 
163 
164  //- Destructor
166 
167 
168  // Member Functions
169 
170  //- Return the interpolation weighting factors
172  (
174  ) const = 0;
175 
176  //- Return the interpolation weighting factors for the given field,
177  // by limiting the given weights with the given limiter
179  (
181  const surfaceScalarField& CDweights,
182  tmp<surfaceScalarField> tLimiter
183  ) const;
184 
185  //- Return the interpolation weighting factors for the given field
187  (
189  ) const;
190 
191  //- Return the interpolation weighting factors
193  flux
194  (
196  ) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 // Add the patch constructor functions to the hash tables
207 
208 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type) \
209  \
210 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
211  \
212 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
213  add##SS##Type##MeshConstructorToTable_; \
214  \
215 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
216  add##SS##Type##MeshFluxConstructorToTable_; \
217  \
218 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
219  add##SS##Type##MeshConstructorToLimitedTable_; \
220  \
221 limitedSurfaceInterpolationScheme<Type>:: \
222  addMeshFluxConstructorToTable<SS<Type>> \
223  add##SS##Type##MeshFluxConstructorToLimitedTable_;
224 
225 #define makelimitedSurfaceInterpolationScheme(SS) \
226  \
227 makelimitedSurfaceInterpolationTypeScheme(SS, scalar) \
228 makelimitedSurfaceInterpolationTypeScheme(SS, vector) \
229 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
230 makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor) \
231 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
232 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #ifdef NoRepository
238 #endif
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::limitedSurfaceInterpolationScheme::New
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: limitedSurfaceInterpolationScheme.C:39
Foam::limitedSurfaceInterpolationScheme::~limitedSurfaceInterpolationScheme
virtual ~limitedSurfaceInterpolationScheme()
Destructor.
Definition: limitedSurfaceInterpolationScheme.C:128
limitedSurfaceInterpolationScheme.C
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::limitedSurfaceInterpolationScheme::declareRunTimeSelectionTable
declareRunTimeSelectionTable(tmp, limitedSurfaceInterpolationScheme, Mesh,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
Foam::limitedSurfaceInterpolationScheme::flux
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: limitedSurfaceInterpolationScheme.C:195
Foam::objectRegistry::lookupObject
const Type & lookupObject(const word &name, const bool recursive=false) const
Definition: objectRegistryTemplates.C:434
Foam::limitedSurfaceInterpolationScheme::TypeName
TypeName("limitedSurfaceInterpolationScheme")
Runtime type information.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::limitedSurfaceInterpolationScheme::faceFlux_
const surfaceScalarField & faceFlux_
Definition: limitedSurfaceInterpolationScheme.H:74
Foam::limitedSurfaceInterpolationScheme
Abstract base class for limited surface interpolation schemes.
Definition: limitedSurfaceInterpolationScheme.H:54
Foam::limitedSurfaceInterpolationScheme::weights
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &, const surfaceScalarField &CDweights, tmp< surfaceScalarField > tLimiter) const
Return the interpolation weighting factors for the given field,.
Definition: limitedSurfaceInterpolationScheme.C:137
Foam::limitedSurfaceInterpolationScheme::limiter
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const =0
Return the interpolation weighting factors.
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:57
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
surfaceInterpolationScheme.H