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

cellToFace.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::cellToFace
00027 
00028 Description
00029     A topoSetSource to select a faceSet from cells.
00030 
00031     Either all faces of cell or some other criterion.
00032     See implementation.
00033     Note: when picking up coupled faces uses cells on neighbouring processors.
00034 
00035 SourceFiles
00036     cellToFace.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef cellToFace_H
00041 #define cellToFace_H
00042 
00043 #include "topoSetSource.H"
00044 #include "NamedEnum.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class cellToFace Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class cellToFace
00056 :
00057     public topoSetSource
00058 {
00059 public:
00060         //- Enumeration defining the valid options
00061         enum cellAction
00062         {
00063             ALL,
00064             BOTH
00065         };
00066 
00067 
00068 private:
00069 
00070         //- Add usage string
00071         static addToUsageTable usage_;
00072 
00073         static const NamedEnum<cellAction, 2> cellActionNames_;
00074 
00075         //- Name of set to use
00076         word setName_;
00077 
00078         //- Option
00079         cellAction option_;
00080 
00081 
00082     // Private Member Functions
00083 
00084         //- Depending on face to cell option add to or delete from cellSet.
00085         void combine(topoSet& set, const bool add) const;
00086 
00087 
00088 public:
00089 
00090     //- Runtime type information
00091     TypeName("cellToFace");
00092 
00093     // Constructors
00094 
00095         //- Construct from components
00096         cellToFace
00097         (
00098             const polyMesh& mesh,
00099             const word& setName,
00100             const cellAction option
00101         );
00102 
00103         //- Construct from dictionary
00104         cellToFace
00105         (
00106             const polyMesh& mesh,
00107             const dictionary& dict
00108         );
00109 
00110         //- Construct from Istream
00111         cellToFace
00112         (
00113             const polyMesh& mesh,
00114             Istream&
00115         );
00116 
00117 
00118     // Destructor
00119 
00120         virtual ~cellToFace();
00121 
00122 
00123     // Member Functions
00124 
00125         virtual void applyToSet
00126         (
00127             const topoSetSource::setAction action,
00128             topoSet&
00129         ) const;
00130 
00131 };
00132 
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 } // End namespace Foam
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 #endif
00141 
00142 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd