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/>.
26 \*---------------------------------------------------------------------------*/
28 #include "edgeInterpolate.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 // Return weighting factors for scheme given by name in dictionary
44 tmp<edgeInterpolationScheme<Type> > scheme
46 const edgeScalarField& faceFlux,
50 return edgeInterpolationScheme<Type>::New
59 // Return weighting factors for scheme given by name in dictionary
61 tmp<edgeInterpolationScheme<Type> > scheme
63 const edgeScalarField& faceFlux,
67 return edgeInterpolationScheme<Type>::New
71 faceFlux.mesh().schemesDict().interpolationScheme(name)
76 // Return weighting factors for scheme given by name in dictionary
78 tmp<edgeInterpolationScheme<Type> > scheme
84 return edgeInterpolationScheme<Type>::New
92 // Return weighting factors for scheme given by name in dictionary
94 tmp<edgeInterpolationScheme<Type> > scheme
100 return edgeInterpolationScheme<Type>::New
103 mesh.schemesDict().interpolationScheme(name)
108 // Interpolate field onto faces using scheme given by name in dictionary
110 tmp<GeometricField<Type, faePatchField, edgeMesh> >
113 const GeometricField<Type, faPatchField, areaMesh>& vf,
114 const edgeScalarField& faceFlux,
118 # ifdef DEBUGInterpolations
119 if (edgeInterpolation::debug)
122 << "(const GeometricField<Type, faPatchField, areaMesh>&, "
123 << "const edgeScalarField&, Istream&) : "
124 << "interpolating GeometricField<Type, faPatchField, areaMesh> "
129 return scheme<Type>(faceFlux, schemeData)().interpolate(vf);
133 // Interpolate field onto faces using scheme given by name in dictionary
135 tmp<GeometricField<Type, faePatchField, edgeMesh> >
138 const GeometricField<Type, faPatchField, areaMesh>& vf,
139 const edgeScalarField& faceFlux,
143 # ifdef DEBUGInterpolations
144 if (edgeInterpolation::debug)
147 << "(const GeometricField<Type, faPatchField, areaMesh>&, "
148 << "const edgeScalarField&, const word&) : "
149 << "interpolating GeometricField<Type, faPatchField, areaMesh> "
155 return scheme<Type>(faceFlux, name)().interpolate(vf);
158 // Interpolate field onto faces using scheme given by name in dictionary
160 tmp<GeometricField<Type, faePatchField, edgeMesh> >
163 const tmp<GeometricField<Type, faPatchField, areaMesh> >& tvf,
164 const edgeScalarField& faceFlux,
168 tmp<GeometricField<Type, faePatchField, edgeMesh> > tsf =
169 interpolate(tvf(), faceFlux, name);
176 // Interpolate field onto faces using scheme given by name in dictionary
178 tmp<GeometricField<Type, faePatchField, edgeMesh> >
181 const GeometricField<Type, faPatchField, areaMesh>& vf,
182 const tmp<edgeScalarField>& tFaceFlux,
186 tmp<GeometricField<Type, faePatchField, edgeMesh> > tsf =
187 interpolate(vf, tFaceFlux(), name);
194 // Interpolate field onto faces using scheme given by name in dictionary
196 tmp<GeometricField<Type, faePatchField, edgeMesh> >
199 const tmp<GeometricField<Type, faPatchField, areaMesh> >& tvf,
200 const tmp<edgeScalarField>& tFaceFlux,
204 tmp<GeometricField<Type, faePatchField, edgeMesh> > tsf =
205 interpolate(tvf(), tFaceFlux(), name);
214 // Interpolate field onto faces using scheme given by name in dictionary
216 tmp<GeometricField<Type, faePatchField, edgeMesh> >
219 const GeometricField<Type, faPatchField, areaMesh>& vf,
223 # ifdef DEBUGInterpolations
224 if (edgeInterpolation::debug)
227 << "(const GeometricField<Type, faPatchField, areaMesh>&, "
229 << "interpolating GeometricField<Type, faPatchField, areaMesh> "
234 return scheme<Type>(vf.mesh(), schemeData)().interpolate(vf);
237 // Interpolate field onto faces using scheme given by name in dictionary
239 tmp<GeometricField<Type, faePatchField, edgeMesh> >
242 const GeometricField<Type, faPatchField, areaMesh>& vf,
246 # ifdef DEBUGInterpolations
247 if (edgeInterpolation::debug)
250 << "(const GeometricField<Type, faPatchField, areaMesh>&, "
252 << "interpolating GeometricField<Type, faPatchField, areaMesh> "
258 return scheme<Type>(vf.mesh(), name)().interpolate(vf);
261 // Interpolate field onto faces using scheme given by name in dictionary
263 tmp<GeometricField<Type, faePatchField, edgeMesh> >
266 const tmp<GeometricField<Type, faPatchField, areaMesh> >& tvf,
270 tmp<GeometricField<Type, faePatchField, edgeMesh> > tsf =
271 interpolate(tvf(), name);
279 // Interpolate field onto faces using central differencing
281 tmp<GeometricField<Type, faePatchField, edgeMesh> >
284 const GeometricField<Type, faPatchField, areaMesh>& vf
288 # ifdef DEBUGInterpolations
289 if (edgeInterpolation::debug)
292 << "(const GeometricField<Type, faPatchField, areaMesh>&) : "
293 << "interpolating GeometricField<Type, faPatchField, areaMesh> "
294 << "using run-time selected scheme"
299 return interpolate(vf, "interpolate(" + vf.name() + ')');
303 // Interpolate field onto faces using central differencing
305 tmp<GeometricField<Type, faePatchField, edgeMesh> >
308 const tmp<GeometricField<Type, faPatchField, areaMesh> >& tvf
311 tmp<GeometricField<Type, faePatchField, edgeMesh> > tsf =
318 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
320 } // End namespace fac
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
324 } // End namespace Foam
326 // ************************************************************************* //