41 const label vertPerCell,
42 const label facePerCell,
43 const label maxVertPerFace,
44 const word& cellModelName
48 localFaces_(facePerCell),
49 faceSize_(facePerCell, -1),
50 pointMap_(vertPerCell),
51 faceMap_(facePerCell),
52 edgeFaces_(2*vertPerCell*vertPerCell),
53 pointFaceIndex_(vertPerCell),
54 vertLabels_(vertPerCell),
55 faceLabels_(facePerCell),
56 cellModelName_(cellModelName),
57 cellModelPtr_(nullptr)
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];
206 pointFaceIndex_[vert][localFacei] = 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]
235 <<
" , " << edgeFaces_[key+1]
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.
void setSize(const label n)
Alias for resize()
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void size(const label n)
Older name for setAddressableSize.
Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh ...
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.
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.
virtual bool write()
Write the output fields.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
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.