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

thresholdCellFaces.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::thresholdCellFaces
00027 
00028 Description
00029     Selects the mesh cell faces specified by a threshold value.
00030     Non-triangulated by default.
00031 
00032 SourceFiles
00033     thresholdCellFaces.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef thresholdCellFaces_H
00038 #define thresholdCellFaces_H
00039 
00040 #include "MeshedSurface.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 class polyMesh;
00048 
00049 /*---------------------------------------------------------------------------*\
00050                        Class thresholdCellFaces Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class thresholdCellFaces
00054 :
00055     public MeshedSurface<face>
00056 {
00057     //- Private typedefs for convenience
00058         typedef MeshedSurface<face> MeshStorage;
00059 
00060         //- Reference to mesh
00061         const polyMesh& mesh_;
00062 
00063         //- For every face the original cell in mesh
00064         labelList meshCells_;
00065 
00066     // Private Member Functions
00067 
00068         void calculate
00069         (
00070             const scalarField&, 
00071             const scalar lowerThreshold,
00072             const scalar upperThreshold,
00073             const bool triangulate
00074         );
00075 
00076 public:
00077 
00078     //- Runtime type information
00079     TypeName("thresholdCellFaces");
00080 
00081 
00082     // Constructors
00083 
00084         //- Construct from mesh, field and threshold value
00085         thresholdCellFaces
00086         (
00087             const polyMesh&,
00088             const scalarField&,
00089             const scalar lowerThreshold,
00090             const scalar upperThreshold,
00091             const bool triangulate = false
00092         );
00093 
00094 
00095     // Member Functions
00096 
00097         //- For every face original cell in mesh
00098         labelList& meshCells()
00099         {
00100             return meshCells_;
00101         }
00102 
00103         //- For every face original cell in mesh
00104         const labelList& meshCells() const
00105         {
00106             return meshCells_;
00107         }
00108 
00109 };
00110 
00111 
00112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00113 
00114 } // End namespace Foam
00115 
00116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 #endif
00122 
00123 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd