Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
interpolation
surfaceInterpolation
surfaceInterpolationScheme
surfaceInterpolationScheme.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::surfaceInterpolationScheme
26
27
Description
28
Abstract base class for surface interpolation schemes.
29
30
SourceFiles
31
surfaceInterpolationScheme.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef surfaceInterpolationScheme_H
36
#define surfaceInterpolationScheme_H
37
38
#include <
OpenFOAM/tmp.H
>
39
#include <
finiteVolume/volFieldsFwd.H
>
40
#include <
finiteVolume/surfaceFieldsFwd.H
>
41
#include <
OpenFOAM/typeInfo.H
>
42
#include <
OpenFOAM/runTimeSelectionTables.H
>
43
44
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46
namespace
Foam
47
{
48
49
class
fvMesh;
50
51
/*---------------------------------------------------------------------------*\
52
Class surfaceInterpolationScheme Declaration
53
\*---------------------------------------------------------------------------*/
54
55
template
<
class
Type>
56
class
surfaceInterpolationScheme
57
:
58
public
refCount
59
{
60
// Private data
61
62
//- Hold reference to mesh
63
const
fvMesh
& mesh_;
64
65
66
// Private Member Functions
67
68
//- Disallow copy construct
69
surfaceInterpolationScheme
(
const
surfaceInterpolationScheme
&);
70
71
//- Disallow default bitwise assignment
72
void
operator=(
const
surfaceInterpolationScheme
&);
73
74
75
public
:
76
77
//- Runtime type information
78
TypeName
(
"surfaceInterpolationScheme"
);
79
80
81
// Declare run-time constructor selection tables
82
83
declareRunTimeSelectionTable
84
(
85
tmp
,
86
surfaceInterpolationScheme
,
87
Mesh,
88
(
89
const
fvMesh
&
mesh
,
90
Istream
& schemeData
91
),
92
(mesh, schemeData)
93
);
94
95
declareRunTimeSelectionTable
96
(
97
tmp
,
98
surfaceInterpolationScheme
,
99
MeshFlux,
100
(
101
const
fvMesh
& mesh,
102
const
surfaceScalarField
& faceFlux,
103
Istream
& schemeData
104
),
105
(mesh, faceFlux, schemeData)
106
);
107
108
109
// Constructors
110
111
//- Construct from mesh
112
surfaceInterpolationScheme
(
const
fvMesh
& mesh)
113
:
114
mesh_(mesh)
115
{}
116
117
118
// Selectors
119
120
//- Return new tmp interpolation scheme
121
static
tmp<surfaceInterpolationScheme<Type>
>
New
122
(
123
const
fvMesh
& mesh,
124
Istream
& schemeData
125
);
126
127
//- Return new tmp interpolation scheme
128
static
tmp<surfaceInterpolationScheme<Type>
>
New
129
(
130
const
fvMesh
& mesh,
131
const
surfaceScalarField
& faceFlux,
132
Istream
& schemeData
133
);
134
135
136
// Destructor
137
138
virtual
~surfaceInterpolationScheme
();
139
140
141
// Member Functions
142
143
//- Return mesh reference
144
const
fvMesh
&
mesh
()
const
145
{
146
return
mesh_;
147
}
148
149
150
//- Return the face-interpolate of the given cell field
151
// with the given owner and neighbour weigting factors
152
static
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
153
interpolate
154
(
155
const
GeometricField<Type, fvPatchField, volMesh>
&,
156
const
tmp<surfaceScalarField>
&,
157
const
tmp<surfaceScalarField>
&
158
);
159
160
//- Return the face-interpolate of the given cell field
161
// with the given weighting factors
162
static
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
163
interpolate
164
(
165
const
GeometricField<Type, fvPatchField, volMesh>
&,
166
const
tmp<surfaceScalarField>
&
167
);
168
169
170
//- Return the interpolation weighting factors for the given field
171
virtual
tmp<surfaceScalarField>
weights
172
(
173
const
GeometricField<Type, fvPatchField, volMesh>
&
174
)
const
= 0;
175
176
//- Return true if this scheme uses an explicit correction
177
virtual
bool
corrected
()
const
178
{
179
return
false
;
180
}
181
182
//- Return the explicit correction to the face-interpolate
183
// for the given field
184
virtual
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
185
correction
(
const
GeometricField<Type, fvPatchField, volMesh>
&)
const
186
{
187
return
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>(NULL);
188
}
189
190
//- Return the face-interpolate of the given cell field
191
// with explicit correction
192
virtual
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
193
interpolate
(
const
GeometricField<Type, fvPatchField, volMesh>
&)
const
;
194
195
//- Return the face-interpolate of the given tmp cell field
196
// with explicit correction
197
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>
>
198
interpolate
199
(
200
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>&
201
)
const
;
202
};
203
204
205
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207
}
// End namespace Foam
208
209
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211
// Add the patch constructor functions to the hash tables
212
213
#define makeSurfaceInterpolationTypeScheme(SS, Type) \
214
\
215
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
216
\
217
surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> > \
218
add##SS##Type##MeshConstructorToTable_; \
219
\
220
surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> > \
221
add##SS##Type##MeshFluxConstructorToTable_;
222
223
#define makeSurfaceInterpolationScheme(SS) \
224
\
225
makeSurfaceInterpolationTypeScheme(SS, scalar) \
226
makeSurfaceInterpolationTypeScheme(SS, vector) \
227
makeSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
228
makeSurfaceInterpolationTypeScheme(SS, symmTensor) \
229
makeSurfaceInterpolationTypeScheme(SS, tensor)
230
231
232
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233
234
#ifdef NoRepository
235
# include <
finiteVolume/surfaceInterpolationScheme.C
>
236
#endif
237
238
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239
240
#endif
241
242
// ************************ vim: set sw=4 sts=4 et: ************************ //