![]() |
|
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 cellMatcher 00027 00028 Description 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #include "primitiveMesh.H" 00033 #include "cellModeller.H" 00034 #include "cellModel.H" 00035 00036 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00037 00038 inline const Foam::Map<Foam::label>& Foam::cellMatcher::localPoint() const 00039 { 00040 return localPoint_; 00041 } 00042 00043 00044 inline const Foam::faceList& Foam::cellMatcher::localFaces() const 00045 { 00046 return localFaces_; 00047 } 00048 00049 00050 inline const Foam::labelList& Foam::cellMatcher::faceSize() const 00051 { 00052 return faceSize_; 00053 } 00054 00055 00056 inline const Foam::labelList& Foam::cellMatcher::pointMap() const 00057 { 00058 return pointMap_; 00059 } 00060 00061 00062 inline const Foam::labelList& Foam::cellMatcher::faceMap() const 00063 { 00064 return faceMap_; 00065 } 00066 00067 00068 inline const Foam::labelList& Foam::cellMatcher::edgeFaces() const 00069 { 00070 return edgeFaces_; 00071 } 00072 00073 00074 inline const Foam::labelListList& Foam::cellMatcher::pointFaceIndex() const 00075 { 00076 return pointFaceIndex_; 00077 } 00078 00079 00080 inline const Foam::labelList& Foam::cellMatcher::vertLabels() const 00081 { 00082 return vertLabels_; 00083 } 00084 00085 00086 inline const Foam::labelList& Foam::cellMatcher::faceLabels() const 00087 { 00088 return faceLabels_; 00089 } 00090 00091 00092 inline const Foam::cellModel& Foam::cellMatcher::model() const 00093 { 00094 if (cellModelPtr_ == NULL) 00095 { 00096 cellModelPtr_ = cellModeller::lookup(cellModelName_); 00097 } 00098 return *cellModelPtr_; 00099 } 00100 00101 00102 00103 // Key into edgeFaces_. key and key+1 are the entries for edge going from 00104 // v0 to v1 00105 inline Foam::label Foam::cellMatcher::edgeKey 00106 ( 00107 const label numVert, 00108 const label v0, 00109 const label v1 00110 ) 00111 { 00112 return 2*(v0*numVert + v1); 00113 } 00114 00115 00116 // Walk along face consistent with face orientation 00117 inline Foam::label Foam::cellMatcher::nextVert 00118 ( 00119 const label localVertI, 00120 const label size, 00121 const bool rightHand 00122 ) 00123 { 00124 if (rightHand) 00125 { 00126 // face oriented acc. to righthand rule 00127 return (localVertI + 1) % size; 00128 } 00129 else 00130 { 00131 // face oriented acc. to lefthand rule 00132 return (size + localVertI - 1) % size; 00133 } 00134 } 00135 00136 00137 // ************************************************************************* //