![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 walkPatch 00027 00028 Description 00029 Collection of static functions to do various simple patch related things. 00030 00031 SourceFiles 00032 walkPatch.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef walkPatch_H 00037 #define walkPatch_H 00038 00039 #include "label.H" 00040 #include "labelList.H" 00041 #include "primitivePatch.H" 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class walkPatch Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 class walkPatch 00053 { 00054 // Private data 00055 00056 //- Reference to patch to walk on 00057 const primitivePatch& pp_; 00058 00059 //- Reference to zones 00060 const labelList& faceZone_; 00061 00062 //- How to walk through faces 00063 const bool reverse_; 00064 00065 //- Reference to list to mark off visited faces 00066 boolList& visited_; 00067 00068 00069 // Faces visited 00070 DynamicList<label> visitOrder_; 00071 00072 // Index in face of vertex it was visited through 00073 DynamicList<label> indexInFace_; 00074 00075 00076 // Private Member Functions 00077 00078 //- Get other face using v0, v1. Returns -1 if none. 00079 label getNeighbour 00080 ( 00081 const label faceI, 00082 const label fp, 00083 const label v0, 00084 const label v1 00085 ) const; 00086 00087 //- Gets labels of changed faces and enterVertices on faces. 00088 // Returns labels of faces changed and enterVertices on them. 00089 void faceToFace 00090 ( 00091 const labelList& changedFaces, 00092 const labelList& enterVerts, 00093 00094 labelList& nbrFaces, 00095 labelList& nbrEnterVerts 00096 ); 00097 00098 00099 //- Disallow default bitwise copy construct 00100 walkPatch(const walkPatch&); 00101 00102 //- Disallow default bitwise assignment 00103 void operator=(const walkPatch&); 00104 00105 public: 00106 00107 ClassName("walkPatch"); 00108 00109 00110 // Constructors 00111 00112 //- Construct from components 00113 walkPatch 00114 ( 00115 const primitivePatch& pp, 00116 const labelList& faceZone, // Per face which zone it belongs to 00117 const bool reverse, // Reverse walk 00118 const label faceI, // Current face 00119 const label enterVertI, // Vertex across which this face 00120 // is visited. 00121 boolList& visited 00122 ); 00123 00124 00125 // Member Functions 00126 00127 const DynamicList<label>& visitOrder() const 00128 { 00129 return visitOrder_; 00130 } 00131 00132 const DynamicList<label>& indexInFace() const 00133 { 00134 return indexInFace_; 00135 } 00136 00137 }; 00138 00139 00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00141 00142 } // End namespace Foam 00143 00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00145 00146 #endif 00147 00148 // ************************************************************************* //