Loading...
Searching...
No Matches
cellMatcherI.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33}
34
37{
38 return localFaces_;
39}
40
43{
44 return faceSize_;
45}
46
49{
50 return pointMap_;
51}
52
55{
56 return faceMap_;
57}
58
61{
62 return edgeFaces_;
63}
64
69}
70
73{
74 return vertLabels_;
75}
76
79{
80 return faceLabels_;
81}
82
83
84inline const Foam::cellModel& Foam::cellMatcher::model() const
85{
86 if (cellModelPtr_ == nullptr)
87 {
88 cellModelPtr_ = cellModel::ptr(cellModelName_);
89 }
90 return *cellModelPtr_;
91}
92
93
94// Key into edgeFaces_. key and key+1 are the entries for edge going from
95// v0 to v1
96inline Foam::label Foam::cellMatcher::edgeKey
97(
98 const label numVert,
99 const label v0,
100 const label v1
102{
103 return 2*(v0*numVert + v1);
104}
105
106
107// Walk along face consistent with face orientation
108inline Foam::label Foam::cellMatcher::nextVert
109(
110 const label localVertI,
111 const label size,
112 const bool rightHand
113)
114{
115 if (rightHand)
116 {
117 // face oriented acc. to righthand rule
118 return (localVertI + 1) % size;
119 }
120 else
121 {
122 // face oriented acc. to lefthand rule
123 return (size + localVertI - 1) % size;
124 }
125}
126
127
128// ************************************************************************* //
A HashTable to objects of type <T> with a label key.
Definition Map.H:54
const faceList & localFaces() const
const cellModel & model() const
labelListList pointFaceIndex_
pointFaceIndex[localVertI][localFacei] is index in localFace
labelList faceMap_
Map from local to mesh face numbering.
const word cellModelName_
CellModel name.
labelList edgeFaces_
Map from 'edge' to neighbouring faces.
const labelList & faceMap() const
const labelList & faceLabels() const
Map< label > localPoint_
labelList pointMap_
Map from local to mesh vertex numbering.
labelList faceLabels_
After matching: holds mesh faces in cellmodel order.
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
const cellModel * cellModelPtr_
const Map< label > & localPoint() const
labelList vertLabels_
After matching: holds mesh vertices in cellmodel order.
const labelList & pointMap() const
const labelList & vertLabels() const
labelList faceSize_
Number of vertices per face in localFaces_.
const labelList & faceSize() const
static label edgeKey(const label numVert, const label v0, const label v1)
Given start and end of edge generate unique key.
const labelListList & pointFaceIndex() const
const labelList & edgeFaces() const
faceList localFaces_
Faces using local vertex numbering.
Maps a geometry to a set of cell primitives.
Definition cellModel.H:73
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
Definition cellModels.C:113
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
List< face > faceList
List of faces.
Definition faceListFwd.H:41