OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

sampledPlane.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::sampledPlane
00027 
00028 Description
00029     A sampledSurface defined by a cuttingPlane. Always triangulated.
00030 
00031 SourceFiles
00032     sampledPlane.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef sampledPlane_H
00037 #define sampledPlane_H
00038 
00039 #include "sampledSurface.H"
00040 #include "cuttingPlane.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                        Class sampledPlane Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class sampledPlane
00052 :
00053     public sampledSurface,
00054     public cuttingPlane
00055 {
00056     // Private data
00057 
00058         //- zone name (if restricted to zones)
00059         word zoneName_;
00060 
00061         //- Track if the surface needs an update
00062         mutable bool needsUpdate_;
00063 
00064     // Private Member Functions
00065 
00066         //- sample field on faces
00067         template <class Type>
00068         tmp<Field<Type> > sampleField
00069         (
00070             const GeometricField<Type, fvPatchField, volMesh>& vField
00071         ) const;
00072 
00073 
00074         template <class Type>
00075         tmp<Field<Type> >
00076         interpolateField(const interpolation<Type>&) const;
00077 
00078 
00079 public:
00080 
00081     //- Runtime type information
00082     TypeName("sampledPlane");
00083 
00084 
00085     // Constructors
00086 
00087         //- Construct from components
00088         sampledPlane
00089         (
00090             const word& name,
00091             const polyMesh& mesh,
00092             const plane& planeDesc,
00093             const word& zoneName = word::null
00094         );
00095 
00096         //- Construct from dictionary
00097         sampledPlane
00098         (
00099             const word& name,
00100             const polyMesh& mesh,
00101             const dictionary& dict
00102         );
00103 
00104 
00105     // Destructor
00106 
00107         virtual ~sampledPlane();
00108 
00109 
00110     // Member Functions
00111 
00112         //- Does the surface need an update?
00113         virtual bool needsUpdate() const;
00114 
00115         //- Mark the surface as needing an update.
00116         //  May also free up unneeded data.
00117         //  Return false if surface was already marked as expired.
00118         virtual bool expire();
00119 
00120         //- Update the surface as required.
00121         //  Do nothing (and return false) if no update was needed
00122         virtual bool update();
00123 
00124 
00125         //- Points of surface
00126         virtual const pointField& points() const
00127         {
00128             return cuttingPlane::points();
00129         }
00130 
00131         //- Faces of surface
00132         virtual const faceList& faces() const
00133         {
00134             return cuttingPlane::faces();
00135         }
00136 
00137         //- For every face original cell in mesh
00138         const labelList& meshCells() const
00139         {
00140             return cuttingPlane::cutCells();
00141         }
00142 
00143         //- sample field on surface
00144         virtual tmp<scalarField> sample
00145         (
00146             const volScalarField&
00147         ) const;
00148 
00149 
00150         //- sample field on surface
00151         virtual tmp<vectorField> sample
00152         (
00153             const volVectorField&
00154         ) const;
00155 
00156         //- sample field on surface
00157         virtual tmp<sphericalTensorField> sample
00158         (
00159             const volSphericalTensorField&
00160         ) const;
00161 
00162         //- sample field on surface
00163         virtual tmp<symmTensorField> sample
00164         (
00165             const volSymmTensorField&
00166         ) const;
00167 
00168         //- sample field on surface
00169         virtual tmp<tensorField> sample
00170         (
00171             const volTensorField&
00172         ) const;
00173 
00174 
00175         //- interpolate field on surface
00176         virtual tmp<scalarField> interpolate
00177         (
00178             const interpolation<scalar>&
00179         ) const;
00180 
00181 
00182         //- interpolate field on surface
00183         virtual tmp<vectorField> interpolate
00184         (
00185             const interpolation<vector>&
00186         ) const;
00187 
00188         //- interpolate field on surface
00189         virtual tmp<sphericalTensorField> interpolate
00190         (
00191             const interpolation<sphericalTensor>&
00192         ) const;
00193 
00194         //- interpolate field on surface
00195         virtual tmp<symmTensorField> interpolate
00196         (
00197             const interpolation<symmTensor>&
00198         ) const;
00199 
00200         //- interpolate field on surface
00201         virtual tmp<tensorField> interpolate
00202         (
00203             const interpolation<tensor>&
00204         ) const;
00205 
00206         //- Write
00207         virtual void print(Ostream&) const;
00208 };
00209 
00210 
00211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00212 
00213 } // End namespace Foam
00214 
00215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00216 
00217 #ifdef NoRepository
00218 #   include "sampledPlaneTemplates.C"
00219 #endif
00220 
00221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00222 
00223 #endif
00224 
00225 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd