44 const label cellIndex,
49 const label pointOffset,
53 static const cellModel* prismModelPtr_ =
nullptr;
60 const cellModel& prism = *prismModelPtr_;
78 const face& curFace = faces[curFaceLabel];
80 if (curFace.size() != 2)
83 <<
"face " << curFaceLabel
84 <<
"does not have 2 vertices. Number of vertices: " << curFace
88 if (owner[curFaceLabel] == cellIndex)
90 localFaces[facei] = curFace;
92 else if (neighbour[curFaceLabel] == cellIndex)
97 localFaces[facei].setSize(curFace.size());
101 localFaces[facei][curFace.size() - i - 1] =
108 <<
"face " << curFaceLabel
109 <<
" does not belong to cell " << cellIndex
110 <<
". Face owner: " << owner[curFaceLabel] <<
" neighbour: " 111 << neighbour[curFaceLabel]
117 if (localFaces[0][1] == localFaces[1][0])
123 missingPlaneFace[0] = localFaces[0][0];
124 missingPlaneFace[1] = localFaces[1][1];
125 missingPlaneFace[2] = localFaces[0][1];
127 frontAndBackFaces[2*cellIndex] = face(missingPlaneFace);
130 missingPlaneFace[0] = localFaces[0][0] + pointOffset;
131 missingPlaneFace[1] = localFaces[0][1] + pointOffset;
132 missingPlaneFace[2] = localFaces[1][1] + pointOffset;
134 frontAndBackFaces[2*cellIndex + 1] = face(missingPlaneFace);
139 cellShapeLabels[0] = localFaces[0][0];
140 cellShapeLabels[1] = localFaces[0][1];
141 cellShapeLabels[2] = localFaces[1][1];
143 cellShapeLabels[3] = localFaces[0][0] + pointOffset;
144 cellShapeLabels[4] = localFaces[0][1] + pointOffset;
145 cellShapeLabels[5] = localFaces[1][1] + pointOffset;
147 return cellShape(prism, cellShapeLabels);
149 else if (localFaces[0][1] == localFaces[2][0])
155 missingPlaneFace[0] = localFaces[0][0];
156 missingPlaneFace[1] = localFaces[2][1];
157 missingPlaneFace[2] = localFaces[0][1];
159 frontAndBackFaces[2*cellIndex] = face(missingPlaneFace);
162 missingPlaneFace[0] = localFaces[0][0] + pointOffset;
163 missingPlaneFace[1] = localFaces[0][1] + pointOffset;
164 missingPlaneFace[2] = localFaces[2][1] + pointOffset;
166 frontAndBackFaces[2*cellIndex + 1] = face(missingPlaneFace);
171 cellShapeLabels[0] = localFaces[0][0];
172 cellShapeLabels[1] = localFaces[0][1];
173 cellShapeLabels[2] = localFaces[2][1];
175 cellShapeLabels[3] = localFaces[0][0] + pointOffset;
176 cellShapeLabels[4] = localFaces[0][1] + pointOffset;
177 cellShapeLabels[5] = localFaces[2][1] + pointOffset;
179 return cellShape(prism, cellShapeLabels);
184 <<
"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...
#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 extrudedTriangleCellShape(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.