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::boundaryRegion 00026 00027 Description 00028 The boundaryRegion persistent data saved as a Map<dictionary>. 00029 00030 The meshReader supports boundaryRegion information. 00031 00032 The <tt>constant/boundaryRegion</tt> file is an @c IOMap<dictionary> 00033 that is used to save the information persistently. 00034 It contains the boundaryRegion information of the following form: 00035 00036 @verbatim 00037 ( 00038 INT 00039 { 00040 BoundaryType WORD; 00041 Label WORD; 00042 } 00043 ... 00044 ) 00045 @endverbatim 00046 00047 SourceFiles 00048 boundaryRegion.C 00049 00050 \*---------------------------------------------------------------------------*/ 00051 00052 #ifndef boundaryRegion_H 00053 #define boundaryRegion_H 00054 00055 #include <OpenFOAM/polyMesh.H> 00056 #include <OpenFOAM/Map.H> 00057 #include <OpenFOAM/dictionary.H> 00058 #include <OpenFOAM/labelList.H> 00059 #include <OpenFOAM/wordList.H> 00060 #include <OpenFOAM/wordReList.H> 00061 00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00063 00064 namespace Foam 00065 { 00066 00067 /*---------------------------------------------------------------------------*\ 00068 Class boundaryRegion Declaration 00069 \*---------------------------------------------------------------------------*/ 00070 00071 class boundaryRegion 00072 : 00073 public Map<dictionary> 00074 { 00075 // Private Member Functions 00076 00077 //- Disallow default bitwise copy construct 00078 boundaryRegion(const boundaryRegion&); 00079 00080 00081 public: 00082 00083 // Constructors 00084 00085 //- Construct null 00086 boundaryRegion(); 00087 00088 //- Construct read from registry, name. instance 00089 boundaryRegion 00090 ( 00091 const objectRegistry&, 00092 const word& name = "boundaryRegion", 00093 const fileName& instance = "constant" 00094 ); 00095 00096 00097 //- Destructor 00098 ~boundaryRegion(); 00099 00100 00101 // Member Functions 00102 00103 //- Append to the end, return index 00104 label append(const dictionary&); 00105 00106 //- Return index corresponding to patch 'name' 00107 // returns -1 if not found 00108 label findIndex(const word& name) const; 00109 00110 //- Return a Map of (id => name) 00111 Map<word> names() const; 00112 00113 //- Return a Map of (id => names) selected by patterns 00114 Map<word> names(const List<wordRe>& patterns) const; 00115 00116 //- Return a Map of (id => type) 00117 Map<word> boundaryTypes() const; 00118 00119 //- Return BoundaryType corresponding to patch 'name' 00120 word boundaryType(const word& name) const; 00121 00122 //- Read constant/boundaryRegion 00123 void readDict 00124 ( 00125 const objectRegistry&, 00126 const word& name = "boundaryRegion", 00127 const fileName& instance = "constant" 00128 ); 00129 00130 //- Write constant/boundaryRegion for later reuse 00131 void writeDict 00132 ( 00133 const objectRegistry&, 00134 const word& name = "boundaryRegion", 00135 const fileName& instance = "constant" 00136 ) const; 00137 00138 00139 // Member Operators 00140 00141 //- Assignment 00142 void operator=(const boundaryRegion&); 00143 00144 //- Assign from Map<dictionary> 00145 void operator=(const Map<dictionary>&); 00146 00147 00148 // Friend Functions 00149 00150 //- Rename regions 00151 // each dictionary entry is a single word: 00152 // @verbatim 00153 // newPatchName originalName; 00154 // @endverbatim 00155 void rename(const dictionary&); 00156 }; 00157 00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00159 00160 } // End namespace Foam 00161 00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00163 00164 #endif 00165 00166 // ************************ vim: set sw=4 sts=4 et: ************************ //