edgeInterpolationScheme.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) 2016-2017 Wikki Ltd
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::edgeInterpolationScheme
28
29Description
30 Abstract base class for edge interpolation schemes.
31
32SourceFiles
33 edgeInterpolationScheme.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef edgeInterpolationScheme_H
38#define edgeInterpolationScheme_H
39
40#include "tmp.H"
41#include "areaFieldsFwd.H"
42#include "edgeFieldsFwd.H"
43#include "typeInfo.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51class faMesh;
52
53/*---------------------------------------------------------------------------*\
54 Class edgeInterpolationScheme Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type>
59:
60 public refCount
61{
62 // Private data
63
64 //- Hold reference to mesh
65 const faMesh& mesh_;
66
67
68 // Private Member Functions
69
70 //- No copy assignment
71 void operator=(const edgeInterpolationScheme&) = delete;
72
73
74public:
75
76 // Declare run-time constructor selection tables
79 (
80 tmp,
82 Mesh,
83 (
84 const faMesh& mesh,
85 Istream& schemeData
86 ),
87 (mesh, schemeData)
88 );
91 (
92 tmp,
94 MeshFlux,
95 (
96 const faMesh& mesh,
97 const edgeScalarField& faceFlux,
98 Istream& schemeData
99 ),
100 (mesh, faceFlux, schemeData)
101 );
102
103
104 // Constructors
105
106 //- Construct from mesh
108 :
109 mesh_(mesh)
110 {}
111
112
113 // Selectors
114
115 //- Return new tmp interpolation scheme
117 (
118 const faMesh& mesh,
119 Istream& schemeData
120 );
121
122 //- Return new tmp interpolation scheme
124 (
125 const faMesh& mesh,
126 const edgeScalarField& faceFlux,
127 Istream& schemeData
128 );
129
130
131 // Destructor
132
133 virtual ~edgeInterpolationScheme();
134
135
136 // Member Functions
137
138 //- Return mesh reference
139 const faMesh& mesh() const
140 {
141 return mesh_;
142 }
143
144
145 //- Return the face-interpolate of the given cell field
146 // with the given owner and neighbour weighting factors
149 (
153 );
154
155 //- Return the face-interpolate of the given cell field
156 // with the given weighting factors
159 (
162 );
163
164
165 //- Return the euclidian edge-interpolate of the given area field
166 // with the given weighting factors
169 (
172 );
173
174
175 //- Return the interpolation weighting factors for the given field
177 (
179 ) const = 0;
180
181 //- Return true if this scheme uses an explicit correction
182 virtual bool corrected() const
183 {
184 return false;
185 }
186
187 //- Return the explicit correction to the face-interpolate
188 // for the given field
191 {
192 return nullptr;
193 }
194
195 //- Return the face-interpolate of the given cell field
196 // with explicit correction
199
200 //- Return the euclidian edge-interpolate of the given area field
201 // without explicit correction
204 (
206 ) const;
207
208 //- Return the face-interpolate of the given tmp cell field
209 // with explicit correction
212 (
214 ) const;
215};
216
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220} // End namespace Foam
221
222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223
224// Add the patch constructor functions to the hash tables
226#define makeEdgeInterpolationTypeScheme(SS, Type) \
227 \
228defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
229 \
230edgeInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
231 add##SS##Type##MeshConstructorToTable_; \
232 \
233edgeInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
234 add##SS##Type##MeshFluxConstructorToTable_;
236#define makeEdgeInterpolationScheme(SS) \
237 \
238makeEdgeInterpolationTypeScheme(SS, scalar) \
239makeEdgeInterpolationTypeScheme(SS, vector) \
240makeEdgeInterpolationTypeScheme(SS, tensor)
241
242
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245#ifdef NoRepository
247#endif
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#endif
252
253// ************************************************************************* //
Forwards and collection of common area field types.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Abstract base class for edge interpolation schemes.
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
declareRunTimeSelectionTable(tmp, edgeInterpolationScheme, Mesh,(const faMesh &mesh, Istream &schemeData),(mesh, schemeData))
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &, const tmp< edgeScalarField > &, const tmp< edgeScalarField > &)
Return the face-interpolate of the given cell field.
edgeInterpolationScheme(const faMesh &mesh)
Construct from mesh.
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const =0
Return the interpolation weighting factors for the given field.
static tmp< edgeInterpolationScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > correction(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the explicit correction to the face-interpolate.
const faMesh & mesh() const
Return mesh reference.
declareRunTimeSelectionTable(tmp, edgeInterpolationScheme, MeshFlux,(const faMesh &mesh, const edgeScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
static tmp< GeometricField< Type, faePatchField, edgeMesh > > euclidianInterpolate(const GeometricField< Type, faPatchField, areaMesh > &, const tmp< edgeScalarField > &)
Return the euclidian edge-interpolate of the given area field.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
Forwards for edge field types.
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)