1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
29 A sampledSurface defined by a cuttingPlane. Always triangulated.
31 Note: does not cut at construction (since might need fields which
32 are not registered yet). Explicitly call update().
37 \*---------------------------------------------------------------------------*/
39 #ifndef sampledPlane_H
40 #define sampledPlane_H
42 #include "sampledSurface.H"
43 #include "cuttingPlane.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class sampledPlane Declaration
52 \*---------------------------------------------------------------------------*/
56 public sampledSurface,
61 //- zone name (if restricted to zones)
64 //- Track if the surface needs an update
65 mutable bool needsUpdate_;
67 // Private Member Functions
69 //- sample field on faces
71 tmp<Field<Type> > sampleField
73 const GeometricField<Type, fvPatchField, volMesh>& vField
79 interpolateField(const interpolation<Type>&) const;
84 //- Runtime type information
85 TypeName("sampledPlane");
90 //- Construct from components
95 const plane& planeDesc,
96 const word& zoneName = word::null
99 //- Construct from dictionary
103 const polyMesh& mesh,
104 const dictionary& dict
110 virtual ~sampledPlane();
115 //- Does the surface need an update?
116 virtual bool needsUpdate() const;
118 //- Mark the surface as needing an update.
119 // May also free up unneeded data.
120 // Return false if surface was already marked as expired.
121 virtual bool expire();
123 //- Update the surface as required.
124 // Do nothing (and return false) if no update was needed
125 virtual bool update();
128 //- Points of surface
129 virtual const pointField& points() const
131 return cuttingPlane::points();
135 virtual const faceList& faces() const
137 return cuttingPlane::faces();
140 //- For every face original cell in mesh
141 const labelList& meshCells() const
143 return cuttingPlane::cutCells();
146 //- sample field on surface
147 virtual tmp<scalarField> sample
149 const volScalarField&
153 //- sample field on surface
154 virtual tmp<vectorField> sample
156 const volVectorField&
159 //- sample field on surface
160 virtual tmp<sphericalTensorField> sample
162 const volSphericalTensorField&
165 //- sample field on surface
166 virtual tmp<symmTensorField> sample
168 const volSymmTensorField&
171 //- sample field on surface
172 virtual tmp<tensorField> sample
174 const volTensorField&
178 //- interpolate field on surface
179 virtual tmp<scalarField> interpolate
181 const interpolation<scalar>&
185 //- interpolate field on surface
186 virtual tmp<vectorField> interpolate
188 const interpolation<vector>&
191 //- interpolate field on surface
192 virtual tmp<sphericalTensorField> interpolate
194 const interpolation<sphericalTensor>&
197 //- interpolate field on surface
198 virtual tmp<symmTensorField> interpolate
200 const interpolation<symmTensor>&
203 //- interpolate field on surface
204 virtual tmp<tensorField> interpolate
206 const interpolation<tensor>&
210 virtual void print(Ostream&) const;
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 # include "sampledPlaneTemplates.C"
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //