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 #include "primitiveMesh.H"
29 #include "cellModel.H"
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
34 {
35  return localPoint_;
36 }
37 
38 
40 {
41  return localFaces_;
42 }
43 
44 
46 {
47  return faceSize_;
48 }
49 
50 
52 {
53  return pointMap_;
54 }
55 
56 
58 {
59  return faceMap_;
60 }
61 
62 
64 {
65  return edgeFaces_;
66 }
67 
68 
70 {
71  return pointFaceIndex_;
72 }
73 
74 
76 {
77  return vertLabels_;
78 }
79 
80 
82 {
83  return faceLabels_;
84 }
85 
86 
88 {
89  if (cellModelPtr_ == nullptr)
90  {
91  cellModelPtr_ = cellModel::ptr(cellModelName_);
92  }
93  return *cellModelPtr_;
94 }
95 
96 
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
100 (
101  const label numVert,
102  const label v0,
103  const label v1
104 )
105 {
106  return 2*(v0*numVert + v1);
107 }
108 
109 
110 // Walk along face consistent with face orientation
111 inline Foam::label Foam::cellMatcher::nextVert
112 (
113  const label localVertI,
114  const label size,
115  const bool rightHand
116 )
117 {
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  }
128 }
129 
130 
131 // ************************************************************************* //
Foam::cellMatcher::localFaces
const faceList & localFaces() const
Definition: cellMatcherI.H:39
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
primitiveMesh.H
Foam::cellMatcher::localPoint
const Map< label > & localPoint() const
Definition: cellMatcherI.H:33
Foam::cellModel::ptr
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
Definition: cellModels.C:120
Foam::cellMatcher::vertLabels
const labelList & vertLabels() const
Definition: cellMatcherI.H:75
Foam::cellMatcher::faceMap
const labelList & faceMap() const
Definition: cellMatcherI.H:57
Foam::cellMatcher::nextVert
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
Definition: cellMatcherI.H:112
Foam::cellMatcher::pointFaceIndex
const labelListList & pointFaceIndex() const
Definition: cellMatcherI.H:69
cellModel.H
Foam::cellMatcher::edgeFaces
const labelList & edgeFaces() const
Definition: cellMatcherI.H:63
Foam::cellMatcher::faceSize
const labelList & faceSize() const
Definition: cellMatcherI.H:45
Foam::cellMatcher::edgeKey
static label edgeKey(const label numVert, const label v0, const label v1)
Given start and end of edge generate unique key.
Definition: cellMatcherI.H:100
Foam::cellMatcher::pointMap
const labelList & pointMap() const
Definition: cellMatcherI.H:51
Foam::List< face >
Foam::cellMatcher::faceLabels
const labelList & faceLabels() const
Definition: cellMatcherI.H:81
Foam::cellModel
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
Foam::cellMatcher::model
const cellModel & model() const
Definition: cellMatcherI.H:87
Foam::cellMatcher::localPoint_
Map< label > localPoint_
Definition: cellMatcher.H:121