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