OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

cellMatcherI.H

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