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 
43 {
44  return faceSize_;
45 }
46 
47 
49 {
50  return pointMap_;
51 }
52 
53 
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 
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 // ************************************************************************* //
Foam::cellMatcher::localFaces
const faceList & localFaces() const
Definition: cellMatcherI.H:36
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::cellMatcher::localPoint
const Map< label > & localPoint() const
Definition: cellMatcherI.H:30
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:72
Foam::cellMatcher::faceMap
const labelList & faceMap() const
Definition: cellMatcherI.H:54
Foam::cellMatcher::nextVert
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
Definition: cellMatcherI.H:109
Foam::cellMatcher::pointFaceIndex
const labelListList & pointFaceIndex() const
Definition: cellMatcherI.H:66
Foam::cellMatcher::edgeFaces
const labelList & edgeFaces() const
Definition: cellMatcherI.H:60
Foam::cellMatcher::faceSize
const labelList & faceSize() const
Definition: cellMatcherI.H:42
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:97
Foam::cellMatcher::pointMap
const labelList & pointMap() const
Definition: cellMatcherI.H:48
Foam::List< face >
Foam::cellMatcher::faceLabels
const labelList & faceLabels() const
Definition: cellMatcherI.H:78
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:84
Foam::cellMatcher::localPoint_
Map< label > localPoint_
Definition: cellMatcher.H:120