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.
34 \*---------------------------------------------------------------------------*/
36 #ifndef sampledPlane_H
37 #define sampledPlane_H
39 #include "sampledSurface.H"
40 #include "cuttingPlane.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class sampledPlane Declaration
49 \*---------------------------------------------------------------------------*/
53 public sampledSurface,
58 //- zone name (if restricted to zones)
61 //- Track if the surface needs an update
62 mutable bool needsUpdate_;
64 // Private Member Functions
66 //- sample field on faces
68 tmp<Field<Type> > sampleField
70 const GeometricField<Type, fvPatchField, volMesh>& vField
76 interpolateField(const interpolation<Type>&) const;
81 //- Runtime type information
82 TypeName("sampledPlane");
87 //- Construct from components
92 const plane& planeDesc,
93 const word& zoneName = word::null
96 //- Construct from dictionary
100 const polyMesh& mesh,
101 const dictionary& dict
107 virtual ~sampledPlane();
112 //- Does the surface need an update?
113 virtual bool needsUpdate() const;
115 //- Mark the surface as needing an update.
116 // May also free up unneeded data.
117 // Return false if surface was already marked as expired.
118 virtual bool expire();
120 //- Update the surface as required.
121 // Do nothing (and return false) if no update was needed
122 virtual bool update();
125 //- Points of surface
126 virtual const pointField& points() const
128 return cuttingPlane::points();
132 virtual const faceList& faces() const
134 return cuttingPlane::faces();
137 //- For every face original cell in mesh
138 const labelList& meshCells() const
140 return cuttingPlane::cutCells();
143 //- sample field on surface
144 virtual tmp<scalarField> sample
146 const volScalarField&
150 //- sample field on surface
151 virtual tmp<vectorField> sample
153 const volVectorField&
156 //- sample field on surface
157 virtual tmp<sphericalTensorField> sample
159 const volSphericalTensorField&
162 //- sample field on surface
163 virtual tmp<symmTensorField> sample
165 const volSymmTensorField&
168 //- sample field on surface
169 virtual tmp<tensorField> sample
171 const volTensorField&
175 //- interpolate field on surface
176 virtual tmp<scalarField> interpolate
178 const interpolation<scalar>&
182 //- interpolate field on surface
183 virtual tmp<vectorField> interpolate
185 const interpolation<vector>&
188 //- interpolate field on surface
189 virtual tmp<sphericalTensorField> interpolate
191 const interpolation<sphericalTensor>&
194 //- interpolate field on surface
195 virtual tmp<symmTensorField> interpolate
197 const interpolation<symmTensor>&
200 //- interpolate field on surface
201 virtual tmp<tensorField> interpolate
203 const interpolation<tensor>&
207 virtual void print(Ostream&) const;
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 } // End namespace Foam
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 # include "sampledPlaneTemplates.C"
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 // ************************************************************************* //