43 const label cellIndex,
48 const label pointOffset,
52 static const cellModel* hexModelPtr_ =
nullptr;
59 const cellModel&
hex = *hexModelPtr_;
65 <<
"Trying to create a quad with " <<
faceLabels.
size() <<
" faces" 76 const face& curFace = faces[curFaceLabel];
78 if (curFace.size() != 2)
81 <<
"face " << curFaceLabel
82 <<
"does not have 2 vertices. Number of vertices: " << curFace
86 if (owner[curFaceLabel] == cellIndex)
88 localFaces[facei] = curFace;
90 else if (neighbour[curFaceLabel] == cellIndex)
95 localFaces[facei].setSize(curFace.size());
99 localFaces[facei][curFace.size() - i - 1] =
106 <<
"face " << curFaceLabel
107 <<
" does not belong to cell " << cellIndex
108 <<
". Face owner: " << owner[curFaceLabel] <<
" neighbour: " 109 << neighbour[curFaceLabel]
120 localFaces[0][0] != localFaces[1][1]
121 && localFaces[0][1] != localFaces[1][0]
128 missingPlaneFace[0] = localFaces[0][0];
129 missingPlaneFace[1] = localFaces[1][1];
130 missingPlaneFace[2] = localFaces[1][0];
131 missingPlaneFace[3] = localFaces[0][1];
133 frontAndBackFaces[2*cellIndex] = face(missingPlaneFace);
136 missingPlaneFace[0] = localFaces[0][0] + pointOffset;
137 missingPlaneFace[1] = localFaces[0][1] + pointOffset;
138 missingPlaneFace[2] = localFaces[1][0] + pointOffset;
139 missingPlaneFace[3] = localFaces[1][1] + pointOffset;
141 frontAndBackFaces[2*cellIndex + 1] = face(missingPlaneFace);
146 cellShapeLabels[0] = localFaces[0][0];
147 cellShapeLabels[1] = localFaces[0][1];
148 cellShapeLabels[2] = localFaces[1][0];
149 cellShapeLabels[3] = localFaces[1][1];
151 cellShapeLabels[4] = localFaces[0][0] + pointOffset;
152 cellShapeLabels[5] = localFaces[0][1] + pointOffset;
153 cellShapeLabels[6] = localFaces[1][0] + pointOffset;
154 cellShapeLabels[7] = localFaces[1][1] + pointOffset;
157 return cellShape(
hex, cellShapeLabels);
161 localFaces[0][0] != localFaces[2][1]
162 && localFaces[0][1] != localFaces[2][0]
169 missingPlaneFace[0] = localFaces[0][0];
170 missingPlaneFace[1] = localFaces[2][1];
171 missingPlaneFace[2] = localFaces[2][0];
172 missingPlaneFace[3] = localFaces[0][1];
174 frontAndBackFaces[2*cellIndex] = face(missingPlaneFace);
177 missingPlaneFace[0] = localFaces[0][0] + pointOffset;
178 missingPlaneFace[1] = localFaces[0][1] + pointOffset;
179 missingPlaneFace[2] = localFaces[2][0] + pointOffset;
180 missingPlaneFace[3] = localFaces[2][1] + pointOffset;
182 frontAndBackFaces[2*cellIndex + 1] = face(missingPlaneFace);
187 cellShapeLabels[0] = localFaces[0][0];
188 cellShapeLabels[1] = localFaces[0][1];
189 cellShapeLabels[2] = localFaces[2][0];
190 cellShapeLabels[3] = localFaces[2][1];
192 cellShapeLabels[4] = localFaces[0][0] + pointOffset;
193 cellShapeLabels[5] = localFaces[0][1] + pointOffset;
194 cellShapeLabels[6] = localFaces[2][0] + pointOffset;
195 cellShapeLabels[7] = localFaces[2][1] + pointOffset;
198 return cellShape(
hex, cellShapeLabels);
202 localFaces[0][0] != localFaces[3][1]
203 && localFaces[0][1] != localFaces[3][0]
210 missingPlaneFace[0] = localFaces[0][0];
211 missingPlaneFace[1] = localFaces[3][1];
212 missingPlaneFace[2] = localFaces[3][0];
213 missingPlaneFace[3] = localFaces[0][1];
215 frontAndBackFaces[2*cellIndex] = face(missingPlaneFace);
218 missingPlaneFace[0] = localFaces[0][0] + pointOffset;
219 missingPlaneFace[1] = localFaces[0][1] + pointOffset;
220 missingPlaneFace[2] = localFaces[3][0] + pointOffset;
221 missingPlaneFace[3] = localFaces[3][1] + pointOffset;
223 frontAndBackFaces[2*cellIndex + 1] = face(missingPlaneFace);
228 cellShapeLabels[0] = localFaces[0][0];
229 cellShapeLabels[1] = localFaces[0][1];
230 cellShapeLabels[2] = localFaces[3][0];
231 cellShapeLabels[3] = localFaces[3][1];
233 cellShapeLabels[4] = localFaces[0][0] + pointOffset;
234 cellShapeLabels[5] = localFaces[0][1] + pointOffset;
235 cellShapeLabels[6] = localFaces[3][0] + pointOffset;
236 cellShapeLabels[7] = localFaces[3][1] + pointOffset;
239 return cellShape(
hex, cellShapeLabels);
244 <<
"Problem with edge matching. Edges: " << localFaces
void size(const label n)
Older name for setAddressableSize.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
IOstream & hex(IOstream &io)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList faceLabels(nFaceLabels)
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
errorManip< error > abort(error &err)
cellShape extrudedQuadCellShape(const label cellIndex, const labelList &faceLabels, const faceList &faces, const labelList &owner, const labelList &neighbour, const label pointOffset, faceList &frontAndBackFaces)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.