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/>.
28 A sampledSurface defined by a cuttingPlane. Always triangulated.
31 Does not actually cut until update() called.
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 //- If restricted to zones, name of this zone or a regular expression
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 keyType& zoneKey = word::null
98 //- Construct from dictionary
102 const polyMesh& mesh,
103 const dictionary& dict
108 virtual ~sampledPlane();
113 //- Does the surface need an update?
114 virtual bool needsUpdate() const;
116 //- Mark the surface as needing an update.
117 // May also free up unneeded data.
118 // Return false if surface was already marked as expired.
119 virtual bool expire();
121 //- Update the surface as required.
122 // Do nothing (and return false) if no update was needed
123 virtual bool update();
126 //- Points of surface
127 virtual const pointField& points() const
129 return cuttingPlane::points();
133 virtual const faceList& faces() const
135 return cuttingPlane::faces();
138 //- For every face original cell in mesh
139 const labelList& meshCells() const
141 return cuttingPlane::cutCells();
144 //- sample field on surface
145 virtual tmp<scalarField> sample
147 const volScalarField&
151 //- sample field on surface
152 virtual tmp<vectorField> sample
154 const volVectorField&
157 //- sample field on surface
158 virtual tmp<sphericalTensorField> sample
160 const volSphericalTensorField&
163 //- sample field on surface
164 virtual tmp<symmTensorField> sample
166 const volSymmTensorField&
169 //- sample field on surface
170 virtual tmp<tensorField> sample
172 const volTensorField&
176 //- interpolate field on surface
177 virtual tmp<scalarField> interpolate
179 const interpolation<scalar>&
183 //- interpolate field on surface
184 virtual tmp<vectorField> interpolate
186 const interpolation<vector>&
189 //- interpolate field on surface
190 virtual tmp<sphericalTensorField> interpolate
192 const interpolation<sphericalTensor>&
195 //- interpolate field on surface
196 virtual tmp<symmTensorField> interpolate
198 const interpolation<symmTensor>&
201 //- interpolate field on surface
202 virtual tmp<tensorField> interpolate
204 const interpolation<tensor>&
208 virtual void print(Ostream&) const;
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 } // End namespace Foam
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 # include "sampledPlaneTemplates.C"
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 // ************************************************************************* //