39 const label vertPerCell,
40 const label facePerCell,
41 const label maxVertPerFace,
42 const word& cellModelName
46 localFaces_(facePerCell),
47 faceSize_(facePerCell, -1),
48 pointMap_(vertPerCell),
49 faceMap_(facePerCell),
50 edgeFaces_(2*vertPerCell*vertPerCell),
51 pointFaceIndex_(vertPerCell),
52 vertLabels_(vertPerCell),
53 faceLabels_(facePerCell),
54 cellModelName_(cellModelName),
55 cellModelPtr_(nullptr)
61 f.setSize(maxVertPerFace);
86 label facei = myFaces[myFacei];
88 const face&
f = faces[facei];
89 face& localFace = localFaces_[myFacei];
92 faceSize_[myFacei] =
f.
size();
96 label vertI =
f[localVertI];
99 if (iter == localPoint_.
end())
103 if (newVertI >= pointMap_.size())
109 localFace[localVertI] = newVertI;
110 localPoint_.insert(vertI, newVertI);
116 localFace[localVertI] = *iter;
121 faceMap_[myFacei] = facei;
127 const label fp = iter();
128 pointMap_[fp] = iter.key();
142 forAll(localFaces_, localFacei)
144 const face&
f = localFaces_[localFacei];
146 label prevVertI = faceSize_[localFacei] - 1;
151 fp < faceSize_[localFacei];
155 label start =
f[prevVertI];
158 label key1 = edgeKey(numVert, start, end);
159 label key2 = edgeKey(numVert, end, start);
161 if (edgeFaces_[key1] == -1)
164 edgeFaces_[key1] = localFacei;
165 edgeFaces_[key2] = localFacei;
167 else if (edgeFaces_[key1+1] == -1)
170 edgeFaces_[key1+1] = localFacei;
171 edgeFaces_[key2+1] = localFacei;
176 <<
"edgeFaces_ full at entry:" << key1
177 <<
" for edge " << start <<
" " << end
190 forAll(pointFaceIndex_, i)
192 labelList& faceIndices = pointFaceIndex_[i];
197 forAll(localFaces_, localFacei)
199 const face&
f = localFaces_[localFacei];
204 fp < faceSize_[localFacei];
209 pointFaceIndex_[vert][localFacei] = fp;
220 const label localFacei
223 label key = edgeKey(numVert, v0, v1);
225 if (edgeFaces_[key] == localFacei)
227 return edgeFaces_[key+1];
229 else if (edgeFaces_[key+1] == localFacei)
231 return edgeFaces_[key];
236 <<
"edgeFaces_ does not contain:" << localFacei
237 <<
" for edge " << v0 <<
" " << v1 <<
" at key " << key
238 <<
" edgeFaces_[key, key+1]:" << edgeFaces_[key]
239 <<
" , " << edgeFaces_[key+1]
249 os <<
"Faces:" <<
endl;
251 forAll(localFaces_, facei)
255 for (
label fp = 0; fp < faceSize_[facei]; fp++)
257 os <<
' ' << localFaces_[facei][fp];
262 os <<
"Face map : " << faceMap_ <<
endl;
263 os <<
"Point map : " << pointMap_ <<
endl;
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
labelListList pointFaceIndex_
pointFaceIndex[localVertI][localFacei] is index in localFace
label calcLocalFaces(const faceList &faces, const labelList &myFaces)
Calculates localFaces. Returns number of local vertices (or -1.
void write(Ostream &os) const
cellMatcher(const label vertPerCell, const label facePerCell, const label maxVertPerFace, const word &cellModelName)
Construct given mesh and shape factors.
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.
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 string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable