ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / OpenFOAM / meshes / meshShapes / cellMatcher / cellMatcherI.H
bloba6a952a8b7bc70819f27de9b6911a53b65a131ad
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "primitiveMesh.H"
27 #include "cellModeller.H"
28 #include "cellModel.H"
30 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
32 inline const Foam::Map<Foam::label>& Foam::cellMatcher::localPoint() const
34     return localPoint_;
38 inline const Foam::faceList& Foam::cellMatcher::localFaces() const
40     return localFaces_;
44 inline const Foam::labelList& Foam::cellMatcher::faceSize() const
46     return faceSize_;
50 inline const Foam::labelList& Foam::cellMatcher::pointMap() const
52     return pointMap_;
56 inline const Foam::labelList& Foam::cellMatcher::faceMap() const
58     return faceMap_;
62 inline const Foam::labelList& Foam::cellMatcher::edgeFaces() const
64     return edgeFaces_;
68 inline const Foam::labelListList& Foam::cellMatcher::pointFaceIndex() const
70     return pointFaceIndex_;
74 inline const Foam::labelList& Foam::cellMatcher::vertLabels() const
76     return vertLabels_;
80 inline const Foam::labelList& Foam::cellMatcher::faceLabels() const
82     return faceLabels_;
86 inline const Foam::cellModel& Foam::cellMatcher::model() const
88     if (cellModelPtr_ == NULL)
89     {
90         cellModelPtr_ = cellModeller::lookup(cellModelName_);
91     }
92     return *cellModelPtr_;
97 // Key into edgeFaces_. key and key+1 are the entries for edge going from
98 // v0 to v1
99 inline Foam::label Foam::cellMatcher::edgeKey
101     const label numVert,
102     const label v0,
103     const label v1
106     return 2*(v0*numVert + v1);
110 // Walk along face consistent with face orientation
111 inline Foam::label Foam::cellMatcher::nextVert
113     const label localVertI,
114     const label size,
115     const bool rightHand
118     if (rightHand)
119     {
120         // face oriented acc. to righthand rule
121         return (localVertI + 1) % size;
122     }
123     else
124     {
125         // face oriented acc. to lefthand rule
126         return (size + localVertI - 1) % size;
127     }
131 // ************************************************************************* //