1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 edgeInterpolationScheme
28 Abstract base class for edge interpolation schemes.
31 edgeInterpolationScheme.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef edgeInterpolationScheme_H
36 #define edgeInterpolationScheme_H
39 #include "areaFieldsFwd.H"
40 #include "edgeFieldsFwd.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class edgeInterpolationScheme Declaration
53 \*---------------------------------------------------------------------------*/
56 class edgeInterpolationScheme
62 //- Hold reference to mesh
66 // Private Member Functions
68 //- Disallow default bitwise assignment
69 void operator=(const edgeInterpolationScheme&);
74 // Declare run-time constructor selection tables
76 declareRunTimeSelectionTable
79 edgeInterpolationScheme,
88 declareRunTimeSelectionTable
91 edgeInterpolationScheme,
95 const edgeScalarField& faceFlux,
98 (mesh, faceFlux, schemeData)
104 //- Construct from mesh
105 edgeInterpolationScheme(const faMesh& mesh)
113 //- Return new tmp interpolation scheme
114 static tmp<edgeInterpolationScheme<Type> > New
120 //- Return new tmp interpolation scheme
121 static tmp<edgeInterpolationScheme<Type> > New
124 const edgeScalarField& faceFlux,
131 virtual ~edgeInterpolationScheme();
136 //- Return mesh reference
137 const faMesh& mesh() const
143 //- Return the face-interpolate of the given cell field
144 // with the given owner and neighbour weigting factors
145 static tmp<GeometricField<Type, faePatchField, edgeMesh> >
148 const GeometricField<Type, faPatchField, areaMesh>&,
149 const tmp<edgeScalarField>&,
150 const tmp<edgeScalarField>&
153 //- Return the face-interpolate of the given cell field
154 // with the given weigting factors
155 static tmp<GeometricField<Type, faePatchField, edgeMesh> >
158 const GeometricField<Type, faPatchField, areaMesh>&,
159 const tmp<edgeScalarField>&
163 //- Return the euclidian edge-interpolate of the given area field
164 // with the given weigting factors
165 static tmp<GeometricField<Type, faePatchField, edgeMesh> >
168 const GeometricField<Type, faPatchField, areaMesh>&,
169 const tmp<edgeScalarField>&
173 //- Return the interpolation weighting factors for the given field
174 virtual tmp<edgeScalarField> weights
176 const GeometricField<Type, faPatchField, areaMesh>&
179 //- Return true if this scheme uses an explicit correction
180 virtual bool corrected() const
185 //- Return the explicit correction to the face-interpolate
186 // for the given field
187 virtual tmp<GeometricField<Type, faePatchField, edgeMesh> >
188 correction(const GeometricField<Type, faPatchField, areaMesh>&) const
190 return tmp<GeometricField<Type, faePatchField, edgeMesh> >(NULL);
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
200 virtual tmp<GeometricField<Type, faePatchField, edgeMesh> >
203 const GeometricField<Type, faPatchField, areaMesh>&
206 //- Return the face-interpolate of the given tmp cell field
207 // with explicit correction
208 tmp<GeometricField<Type, faePatchField, edgeMesh> >
211 const tmp<GeometricField<Type, faPatchField, areaMesh> >&
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // Add the patch constructor functions to the hash tables
224 #define makeEdgeInterpolationTypeScheme(SS, Type) \
226 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
228 edgeInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type> > \
229 add##SS##Type##MeshConstructorToTable_; \
231 edgeInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type> > \
232 add##SS##Type##MeshFluxConstructorToTable_;
234 #define makeEdgeInterpolationScheme(SS) \
236 makeEdgeInterpolationTypeScheme(SS, scalar) \
237 makeEdgeInterpolationTypeScheme(SS, vector) \
238 makeEdgeInterpolationTypeScheme(SS, tensor)
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 # include "edgeInterpolationScheme.C"
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 // ************************************************************************* //