41 const label vertPerCell,
42 const label facePerCell,
43 const label maxVertPerFace,
44 const word& cellModelName
61 f.setSize(maxVertPerFace);
66 faceIndices.setSize(facePerCell);
86 const label facei = myFaces[myFacei];
88 const face&
f = faces[facei];
89 face& localFace = localFaces_[myFacei];
92 faceSize_[myFacei] =
f.size();
96 const label vertI =
f[localVertI];
98 const auto iter = localPoint_.cfind(vertI);
102 localFace[localVertI] = iter.val();
108 if (newVertI >= pointMap_.size())
114 localFace[localVertI] = newVertI;
115 localPoint_.insert(vertI, newVertI);
121 faceMap_[myFacei] = facei;
127 pointMap_[iter.val()] = iter.key();
141 forAll(localFaces_, localFacei)
143 const face&
f = localFaces_[localFacei];
145 label prevVertI = faceSize_[localFacei] - 1;
150 fp < faceSize_[localFacei];
154 label start =
f[prevVertI];
157 label key1 = edgeKey(numVert, start, end);
158 label key2 = edgeKey(numVert, end, start);
160 if (edgeFaces_[key1] == -1)
163 edgeFaces_[key1] = localFacei;
164 edgeFaces_[key2] = localFacei;
166 else if (edgeFaces_[key1+1] == -1)
169 edgeFaces_[key1+1] = localFacei;
170 edgeFaces_[key2+1] = localFacei;
175 <<
"edgeFaces_ full at entry:" << key1
176 <<
" for edge " << start <<
" " << end
189 for (
labelList& faceIndices : pointFaceIndex_)
194 forAll(localFaces_, localFacei)
196 const face&
f = localFaces_[localFacei];
201 fp < faceSize_[localFacei];
205 const label vert =
f[fp];
217 const label localFacei
220 const label
key = edgeKey(numVert, v0, v1);
222 if (edgeFaces_[
key] == localFacei)
224 return edgeFaces_[
key+1];
226 else if (edgeFaces_[key+1] == localFacei)
228 return edgeFaces_[
key];
232 <<
"edgeFaces_ does not contain:" << localFacei
233 <<
" for edge " << v0 <<
" " << v1 <<
" at key " <<
key
234 <<
" edgeFaces_[key, key+1]:" << edgeFaces_[
key]
246 forAll(localFaces_, facei)
250 for (label fp = 0; fp < faceSize_[facei]; fp++)
252 os <<
' ' << localFaces_[facei][fp];
257 os <<
"Face map : " << faceMap_ <<
nl;
258 os <<
"Point map : " << pointMap_ <<
endl;
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
label calcLocalFaces(const faceList &faces, const labelList &myFaces)
Calculates localFaces. Returns number of local vertices (or -1.
labelList pointMap_
Map from local to mesh vertex numbering.
labelList faceLabels_
After matching: holds mesh faces in cellmodel order.
const cellModel * cellModelPtr_
void write(Ostream &os) const
labelList vertLabels_
After matching: holds mesh vertices in cellmodel order.
labelList faceSize_
Number of vertices per face in localFaces_.
static label edgeKey(const label numVert, const label v0, const label v1)
Given start and end of edge generate unique key.
label otherFace(const label numVert, const label v0, const label v1, const label localFacei) const
Given start,end of edge lookup both faces sharing it and return.
void calcEdgeAddressing(const label numVert)
Fill edge (start, end) to face number.
faceList localFaces_
Faces using local vertex numbering.
cellMatcher(const cellMatcher &)=delete
No copy construct.
void calcPointFaceIndex()
Fill vertex/face to index in face data structure.
A face is a list of labels corresponding to mesh vertices.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
constexpr auto key(const Type &t) noexcept
Helper function to return the enum value.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.