1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 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
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/>.
28 A sampledSurface defined by a cuttingPlane. Always triangulated.
30 Note: does not cut at construction (since might need fields which
31 are not registered yet). Explicitly call update().
36 \*---------------------------------------------------------------------------*/
38 #ifndef sampledPlane_H
39 #define sampledPlane_H
41 #include "sampledSurface.H"
42 #include "cuttingPlane.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class sampledPlane Declaration
51 \*---------------------------------------------------------------------------*/
55 public sampledSurface,
60 //- zone name (if restricted to zones)
63 //- Track if the surface needs an update
64 mutable bool needsUpdate_;
66 // Private Member Functions
68 //- sample field on faces
70 tmp<Field<Type> > sampleField
72 const GeometricField<Type, fvPatchField, volMesh>& vField
78 interpolateField(const interpolation<Type>&) const;
83 //- Runtime type information
84 TypeName("sampledPlane");
89 //- Construct from components
94 const plane& planeDesc,
95 const word& zoneName = word::null
98 //- Construct from dictionary
102 const polyMesh& mesh,
103 const dictionary& dict
109 virtual ~sampledPlane();
114 //- Does the surface need an update?
115 virtual bool needsUpdate() const;
117 //- Mark the surface as needing an update.
118 // May also free up unneeded data.
119 // Return false if surface was already marked as expired.
120 virtual bool expire();
122 //- Update the surface as required.
123 // Do nothing (and return false) if no update was needed
124 virtual bool update();
127 //- Points of surface
128 virtual const pointField& points() const
130 return cuttingPlane::points();
134 virtual const faceList& faces() const
136 return cuttingPlane::faces();
139 //- For every face original cell in mesh
140 const labelList& meshCells() const
142 return cuttingPlane::cutCells();
145 //- sample field on surface
146 virtual tmp<scalarField> sample
148 const volScalarField&
152 //- sample field on surface
153 virtual tmp<vectorField> sample
155 const volVectorField&
158 //- sample field on surface
159 virtual tmp<sphericalTensorField> sample
161 const volSphericalTensorField&
164 //- sample field on surface
165 virtual tmp<symmTensorField> sample
167 const volSymmTensorField&
170 //- sample field on surface
171 virtual tmp<tensorField> sample
173 const volTensorField&
177 //- interpolate field on surface
178 virtual tmp<scalarField> interpolate
180 const interpolation<scalar>&
184 //- interpolate field on surface
185 virtual tmp<vectorField> interpolate
187 const interpolation<vector>&
190 //- interpolate field on surface
191 virtual tmp<sphericalTensorField> interpolate
193 const interpolation<sphericalTensor>&
196 //- interpolate field on surface
197 virtual tmp<symmTensorField> interpolate
199 const interpolation<symmTensor>&
202 //- interpolate field on surface
203 virtual tmp<tensorField> interpolate
205 const interpolation<tensor>&
209 virtual void print(Ostream&) const;
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 } // End namespace Foam
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 # include "sampledPlaneTemplates.C"
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 // ************************************************************************* //