1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "surfaceInterpolate.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 // Return weighting factors for scheme given by name in dictionary
43 tmp<surfaceInterpolationScheme<Type> > scheme
45 const surfaceScalarField& faceFlux,
49 return surfaceInterpolationScheme<Type>::New
58 // Return weighting factors for scheme given by name in dictionary
60 tmp<surfaceInterpolationScheme<Type> > scheme
62 const surfaceScalarField& faceFlux,
66 return surfaceInterpolationScheme<Type>::New
70 faceFlux.mesh().interpolationScheme(name)
75 // Return weighting factors for scheme given by name in dictionary
77 tmp<surfaceInterpolationScheme<Type> > scheme
83 return surfaceInterpolationScheme<Type>::New
91 // Return weighting factors for scheme given by name in dictionary
93 tmp<surfaceInterpolationScheme<Type> > scheme
99 return surfaceInterpolationScheme<Type>::New
102 mesh.interpolationScheme(name)
107 // Interpolate field onto faces using scheme given by name in dictionary
109 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
112 const GeometricField<Type, fvPatchField, volMesh>& vf,
113 const surfaceScalarField& faceFlux,
117 if (surfaceInterpolation::debug)
120 << "(const GeometricField<Type, fvPatchField, volMesh>&, "
121 << "const surfaceScalarField&, Istream&) : "
122 << "interpolating GeometricField<Type, fvPatchField, volMesh> "
126 return scheme<Type>(faceFlux, schemeData)().interpolate(vf);
130 // Interpolate field onto faces using scheme given by name in dictionary
132 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
135 const GeometricField<Type, fvPatchField, volMesh>& vf,
136 const surfaceScalarField& faceFlux,
140 if (surfaceInterpolation::debug)
143 << "(const GeometricField<Type, fvPatchField, volMesh>&, "
144 << "const surfaceScalarField&, const word&) : "
145 << "interpolating GeometricField<Type, fvPatchField, volMesh> "
150 return scheme<Type>(faceFlux, name)().interpolate(vf);
153 // Interpolate field onto faces using scheme given by name in dictionary
155 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
158 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
159 const surfaceScalarField& faceFlux,
163 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf =
164 interpolate(tvf(), faceFlux, name);
171 // Interpolate field onto faces using scheme given by name in dictionary
173 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
176 const GeometricField<Type, fvPatchField, volMesh>& vf,
177 const tmp<surfaceScalarField>& tFaceFlux,
181 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf =
182 interpolate(vf, tFaceFlux(), name);
189 // Interpolate field onto faces using scheme given by name in dictionary
191 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
194 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
195 const tmp<surfaceScalarField>& tFaceFlux,
199 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf =
200 interpolate(tvf(), tFaceFlux(), name);
209 // Interpolate field onto faces using scheme given by name in dictionary
211 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
214 const GeometricField<Type, fvPatchField, volMesh>& vf,
218 if (surfaceInterpolation::debug)
221 << "(const GeometricField<Type, fvPatchField, volMesh>&, "
223 << "interpolating GeometricField<Type, fvPatchField, volMesh> "
227 return scheme<Type>(vf.mesh(), schemeData)().interpolate(vf);
230 // Interpolate field onto faces using scheme given by name in dictionary
232 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
235 const GeometricField<Type, fvPatchField, volMesh>& vf,
239 if (surfaceInterpolation::debug)
242 << "(const GeometricField<Type, fvPatchField, volMesh>&, "
244 << "interpolating GeometricField<Type, fvPatchField, volMesh> "
249 return scheme<Type>(vf.mesh(), name)().interpolate(vf);
252 // Interpolate field onto faces using scheme given by name in dictionary
254 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
257 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf,
261 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf =
262 interpolate(tvf(), name);
270 // Interpolate field onto faces using central differencing
272 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
275 const GeometricField<Type, fvPatchField, volMesh>& vf
278 if (surfaceInterpolation::debug)
281 << "(const GeometricField<Type, fvPatchField, volMesh>&) : "
282 << "interpolating GeometricField<Type, fvPatchField, volMesh> "
283 << "using run-time selected scheme"
287 return interpolate(vf, "interpolate(" + vf.name() + ')');
291 // Interpolate field onto faces using central differencing
293 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
296 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
299 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf =
306 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
308 } // End namespace fvc
310 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
312 } // End namespace Foam
314 // ************************************************************************* //