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 -------------------------------------------------------------------------------
10 License
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 * * * * * * * * * * * * * //
29 
31 {
32  return localPoint_;
33 }
34 
35 
37 {
38  return localFaces_;
39 }
40 
41 
42 inline const Foam::labelList& Foam::cellMatcher::faceSize() const
43 {
44  return faceSize_;
45 }
46 
47 
48 inline const Foam::labelList& Foam::cellMatcher::pointMap() const
49 {
50  return pointMap_;
51 }
52 
53 
54 inline const Foam::labelList& Foam::cellMatcher::faceMap() const
55 {
56  return faceMap_;
57 }
58 
59 
61 {
62  return edgeFaces_;
63 }
64 
65 
67 {
68  return pointFaceIndex_;
69 }
70 
71 
73 {
74  return vertLabels_;
75 }
76 
77 
79 {
80  return faceLabels_;
81 }
82 
83 
84 inline 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
96 inline Foam::label Foam::cellMatcher::edgeKey
97 (
98  const label numVert,
99  const label v0,
100  const label v1
101 )
102 {
103  return 2*(v0*numVert + v1);
104 }
105 
106 
107 // Walk along face consistent with face orientation
108 inline 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 // ************************************************************************* //
const Map< label > & localPoint() const
Definition: cellMatcherI.H:23
const labelList & vertLabels() const
Definition: cellMatcherI.H:65
const labelList & faceSize() const
Definition: cellMatcherI.H:35
const faceList & localFaces() const
Definition: cellMatcherI.H:29
const labelList & faceLabels() const
Definition: cellMatcherI.H:71
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
Definition: cellModels.C:113
const labelList & faceMap() const
Definition: cellMatcherI.H:47
Map< label > localPoint_
Definition: cellMatcher.H:120
const cellModel & model() const
Definition: cellMatcherI.H:77
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
static label edgeKey(const label numVert, const label v0, const label v1)
Given start and end of edge generate unique key.
Definition: cellMatcherI.H:90
const labelList & pointMap() const
Definition: cellMatcherI.H:41
const labelList & edgeFaces() const
Definition: cellMatcherI.H:53
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
Definition: cellMatcherI.H:102
const labelListList & pointFaceIndex() const
Definition: cellMatcherI.H:59
A HashTable to objects of type <T> with a label key.