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::patchIdentifier 00026 00027 Description 00028 Identifies patch by name, patch index and physical type 00029 00030 SourceFiles 00031 patchIdentifier.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef patchIdentifier_H 00036 #define patchIdentifier_H 00037 00038 #include <OpenFOAM/word.H> 00039 #include <OpenFOAM/label.H> 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 class dictionary; 00047 00048 // Forward declaration of friend functions and operators 00049 00050 class patchIdentifier; 00051 Ostream& operator<<(Ostream&, const patchIdentifier&); 00052 00053 00054 /*---------------------------------------------------------------------------*\ 00055 Class patchIdentifier Declaration 00056 \*---------------------------------------------------------------------------*/ 00057 00058 class patchIdentifier 00059 { 00060 // Private data 00061 00062 //- Name of patch 00063 word name_; 00064 00065 //- Index of patch in boundary 00066 label index_; 00067 00068 //- Optional physical type 00069 mutable word physicalType_; 00070 00071 00072 public: 00073 00074 // Constructors 00075 00076 //- Construct from components 00077 patchIdentifier 00078 ( 00079 const word& name, 00080 const label index, 00081 const word& physicalType = word::null 00082 ); 00083 00084 //- Construct from dictionary 00085 patchIdentifier 00086 ( 00087 const word& name, 00088 const dictionary&, 00089 const label index 00090 ); 00091 00092 //- Construct from geometric patch, resetting the index 00093 patchIdentifier 00094 ( 00095 const patchIdentifier&, 00096 const label index 00097 ); 00098 00099 00100 // Destructor 00101 00102 virtual ~patchIdentifier(); 00103 00104 00105 // Member Functions 00106 00107 //- Return name 00108 const word& name() const 00109 { 00110 return name_; 00111 } 00112 00113 //- Return name for modification 00114 word& name() 00115 { 00116 return name_; 00117 } 00118 00119 //- Return the optional physical type of the patch 00120 const word& physicalType() const 00121 { 00122 return physicalType_; 00123 } 00124 00125 //- Return the optional physical type of the patch for modification 00126 word& physicalType() 00127 { 00128 return physicalType_; 00129 } 00130 00131 //- Return the index of this patch in the boundaryMesh 00132 label index() const 00133 { 00134 return index_; 00135 } 00136 00137 //- Return the index of this patch in the boundaryMesh for modification 00138 label& index() 00139 { 00140 return index_; 00141 } 00142 00143 //- Write patchIdentifier as a dictionary 00144 void write(Ostream&) const; 00145 00146 00147 // Ostream Operator 00148 00149 friend Ostream& operator<<(Ostream&, const patchIdentifier&); 00150 }; 00151 00152 00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00154 00155 } // End namespace Foam 00156 00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00158 00159 #endif 00160 00161 // ************************ vim: set sw=4 sts=4 et: ************************ //