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::patchZones 00026 00027 Description 00028 Calculates zone number for every face of patch. 00029 00030 Gets constructed from patch and is a labeList with zone number for 00031 every patch face. 00032 00033 SourceFiles 00034 patchZones.C 00035 00036 \*---------------------------------------------------------------------------*/ 00037 00038 #ifndef patchZones_H 00039 #define patchZones_H 00040 00041 #include <OpenFOAM/labelList.H> 00042 #include <OpenFOAM/pointField.H> 00043 #include <OpenFOAM/polyPatch.H> 00044 00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00046 00047 namespace Foam 00048 { 00049 00050 /*---------------------------------------------------------------------------*\ 00051 Class patchZones Declaration 00052 \*---------------------------------------------------------------------------*/ 00053 00054 class patchZones 00055 : 00056 public labelList 00057 { 00058 // Private data 00059 00060 //- Reference to patch 00061 const primitivePatch& pp_; 00062 00063 //- Reference to protected edges 00064 const boolList& borderEdge_; 00065 00066 //- Max number of zones 00067 label nZones_; 00068 00069 00070 // Private Member Functions 00071 00072 //- Gets labels of changed faces and propagates them to the edges. 00073 // Returns labels of edges changed. Does not cross edges marked in 00074 // regionEdge 00075 labelList faceToEdge 00076 ( 00077 const labelList& changedFaces, 00078 labelList& edgeRegion 00079 ); 00080 00081 //- Reverse of faceToEdge: gets edges and returns faces 00082 labelList edgeToFace(const labelList& changedEdges); 00083 00084 //- Fill *this with current zone for every face reachable 00085 // from faceI without crossing edge marked in borderEdge. 00086 void markZone(label faceI); 00087 00088 public: 00089 00090 ClassName("patchZones"); 00091 00092 00093 // Constructors 00094 00095 //- Fills *this with zone of face. Zone is area 00096 // reachable by edge crossing without crossing borderEdge 00097 // (bool for every edge in patch). 00098 patchZones(const primitivePatch& pp, const boolList& borderEdge); 00099 00100 00101 // Member Functions 00102 00103 //- Number of zones 00104 label nZones() const 00105 { 00106 return nZones_; 00107 } 00108 00109 }; 00110 00111 00112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00113 00114 } // End namespace Foam 00115 00116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00117 00118 #endif 00119 00120 // ************************ vim: set sw=4 sts=4 et: ************************ //