All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cellMatcherI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "primitiveMesh.H"
27 #include "cellModeller.H"
28 #include "cellModel.H"
29 
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 
33 {
34  return localPoint_;
35 }
36 
37 
39 {
40  return localFaces_;
41 }
42 
43 
45 {
46  return faceSize_;
47 }
48 
49 
51 {
52  return pointMap_;
53 }
54 
55 
57 {
58  return faceMap_;
59 }
60 
61 
63 {
64  return edgeFaces_;
65 }
66 
67 
69 {
70  return pointFaceIndex_;
71 }
72 
73 
75 {
76  return vertLabels_;
77 }
78 
79 
81 {
82  return faceLabels_;
83 }
84 
85 
87 {
88  if (cellModelPtr_ == nullptr)
89  {
91  }
92  return *cellModelPtr_;
93 }
94 
95 
96 
97 // Key into edgeFaces_. key and key+1 are the entries for edge going from
98 // v0 to v1
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
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 // ************************************************************************* //
const Map< label > & localPoint() const
Definition: cellMatcherI.H:32
const labelList & vertLabels() const
Definition: cellMatcherI.H:74
const labelList & faceSize() const
Definition: cellMatcherI.H:44
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or nullptr.
Definition: cellModeller.C:100
const faceList & localFaces() const
Definition: cellMatcherI.H:38
labelList faceMap_
Map from local to mesh face numbering.
Definition: cellMatcher.H:132
const labelList & faceLabels() const
Definition: cellMatcherI.H:80
labelList vertLabels_
After matching: holds mesh vertices in cellmodel order.
Definition: cellMatcher.H:142
labelListList pointFaceIndex_
pointFaceIndex[localVertI][localFacei] is index in localFace
Definition: cellMatcher.H:139
labelList edgeFaces_
Map from &#39;edge&#39; to neighbouring faces.
Definition: cellMatcher.H:135
const cellModel * cellModelPtr_
Definition: cellMatcher.H:150
labelList faceSize_
Number of vertices per face in localFaces_.
Definition: cellMatcher.H:126
labelList faceLabels_
After matching: holds mesh faces in cellmodel order.
Definition: cellMatcher.H:145
const labelList & faceMap() const
Definition: cellMatcherI.H:56
Map< label > localPoint_
Definition: cellMatcher.H:120
const cellModel & model() const
Definition: cellMatcherI.H:86
faceList localFaces_
Faces using local vertex numbering.
Definition: cellMatcher.H:123
labelList pointMap_
Map from local to mesh vertex numbering.
Definition: cellMatcher.H:129
const word cellModelName_
CellModel name.
Definition: cellMatcher.H:148
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
Definition: cellModel.H:64
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
const labelList & pointMap() const
Definition: cellMatcherI.H:50
const labelList & edgeFaces() const
Definition: cellMatcherI.H:62
static label nextVert(const label, const label, const bool)
Step along face either in righthand or lefthand direction.
Definition: cellMatcherI.H:112
const labelListList & pointFaceIndex() const
Definition: cellMatcherI.H:68
A HashTable to objects of type <T> with a label key.
Definition: Map.H:49