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