Loading...
Searching...
No Matches
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 "areaFieldsFwd.H"
41#include "edgeFieldsFwd.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49class faMesh;
50
51/*---------------------------------------------------------------------------*\
52 Class edgeInterpolationScheme Declaration
53\*---------------------------------------------------------------------------*/
54
55template<class Type>
57:
58 public refCount
59{
60 // Private Data
61
62 //- Reference to mesh
63 const faMesh& mesh_;
64
65
66public:
68 // Declare run-time constructor selection tables
69
71 (
72 tmp,
74 Mesh,
75 (
76 const faMesh& mesh,
77 Istream& schemeData
78 ),
79 (mesh, schemeData)
80 );
81
83 (
84 tmp,
86 MeshFlux,
87 (
88 const faMesh& mesh,
89 const edgeScalarField& faceFlux,
90 Istream& schemeData
91 ),
92 (mesh, faceFlux, schemeData)
93 );
94
95
96 // Private Member Functions
97
98 //- No copy construct
100
101 //- No copy assignment
102 void operator=(const edgeInterpolationScheme&) = delete;
104
105 // Constructors
106
107 //- Construct from mesh
109 :
110 mesh_(mesh)
111 {}
112
113
114 // Selectors
115
116 //- Return new tmp interpolation scheme
118 (
119 const faMesh& mesh,
120 Istream& schemeData
121 );
122
123 //- Return new tmp interpolation scheme
125 (
126 const faMesh& mesh,
127 const edgeScalarField& faceFlux,
128 Istream& schemeData
129 );
130
131
132 // Destructor
133
134 virtual ~edgeInterpolationScheme();
135
136
137 // Member Functions
138
139 //- Return mesh reference
140 const faMesh& mesh() const
141 {
142 return mesh_;
143 }
144
145
146 //- Return the face-interpolate of the given cell field
147 // with the given owner and neighbour weighting factors
148 static tmp<GeometricField<Type, faePatchField, edgeMesh>>
154 );
155
156 //- Return the face-interpolate of the given cell field
157 // with the given weighting factors
160 (
163 );
164
165
166 //- Return the euclidian edge-interpolate of the given area field
167 // with the given weighting factors
170 (
173 );
174
175
176 //- Return the interpolation weighting factors for the given field
178 (
180 ) const = 0;
181
182 //- Return true if this scheme uses an explicit correction
183 virtual bool corrected() const { return false; }
184
185 //- Return the explicit correction to the face-interpolate
186 // for the given field
189 {
190 return nullptr;
191 }
192
193 //- Return the face-interpolate of the given cell field
194 // with explicit correction
195 virtual tmp<GeometricField<Type, faePatchField, edgeMesh>>
196 interpolate(const GeometricField<Type, faPatchField, areaMesh>&) const;
198 //- Return the euclidian edge-interpolate of the given area field
199 // without explicit correction
202 (
204 ) const;
206 //- Return the face-interpolate of the given tmp cell field
207 // with explicit correction
210 (
212 ) const;
214
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218} // End namespace Foam
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222// Add the patch constructor functions to the hash tables
223
224#define makeEdgeInterpolationTypeScheme(SS, Type) \
225 \
226defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
227 \
228edgeInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
229 add##SS##Type##MeshConstructorToTable_; \
230 \
231edgeInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
232 add##SS##Type##MeshFluxConstructorToTable_;
233
234#define makeEdgeInterpolationScheme(SS) \
235 \
236makeEdgeInterpolationTypeScheme(SS, scalar) \
237makeEdgeInterpolationTypeScheme(SS, vector) \
238makeEdgeInterpolationTypeScheme(SS, tensor)
239
240
241// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242
243#ifdef NoRepository
245#endif
246
247// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248
249#endif
250
251// ************************************************************************* //
Forwards and collection of common area field types.
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
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.
edgeInterpolationScheme(const edgeInterpolationScheme &)=delete
No copy construct.
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.
void operator=(const edgeInterpolationScheme &)=delete
No copy assignment.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
constexpr refCount() noexcept
Default construct, initializing count to 0.
Definition refCount.H:63
A class for managing temporary objects.
Definition tmp.H:75
dynamicFvMesh & mesh
Forwards for edge field types.
Namespace for OpenFOAM.
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
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).