1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "sampledIsoSurfaceCell.H"
27 #include "isoSurface.H"
28 #include "volFieldsFwd.H"
29 #include "pointFields.H"
30 #include "volPointInterpolation.H"
32 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 Foam::tmp<Foam::Field<Type> >
36 Foam::sampledIsoSurfaceCell::sampleField
38 const GeometricField<Type, fvPatchField, volMesh>& vField
41 // Recreate geometry if time has changed
44 return tmp<Field<Type> >(new Field<Type>(vField, meshCells_));
49 Foam::tmp<Foam::Field<Type> >
50 Foam::sampledIsoSurfaceCell::interpolateField
52 const interpolation<Type>& interpolator
55 // Recreate geometry if time has changed
58 // One value per point
59 tmp<Field<Type> > tvalues(new Field<Type>(points().size()));
60 Field<Type>& values = tvalues();
62 boolList pointDone(points().size(), false);
64 forAll(faces(), cutFaceI)
66 const face& f = faces()[cutFaceI];
70 label pointI = f[faceVertI];
72 if (!pointDone[pointI])
74 values[pointI] = interpolator.interpolate
79 pointDone[pointI] = true;
88 // ************************************************************************* //