43 const label cellIndex,
48 const label fluentCellModelID
52 static List<const cellModel*> fluentCellModelLookup
63 static label faceMatchingOrder[7][6] =
65 {-1, -1, -1, -1, -1, -1},
66 {-1, -1, -1, -1, -1, -1},
67 { 0, 1, 2, 3, -1, -1},
68 {-1, -1, -1, -1, -1, -1},
74 const cellModel& curModel = *fluentCellModelLookup[fluentCellModelID];
80 <<
"Number of face labels not equal to" 81 <<
"number of face in the model. " 83 <<
" number of faces in model: " << curModel.nFaces()
94 const labelList& curFace = faces[curFaceLabel];
96 if (owner[curFaceLabel] == cellIndex)
98 localFaces[facei] = curFace;
100 else if (neighbour[curFaceLabel] == cellIndex)
103 localFaces[facei].
setSize(curFace.size());
107 localFaces[facei][curFace.size() - i - 1] =
114 <<
"face " << curFaceLabel
115 <<
" does not belong to cell " << cellIndex
116 <<
". Face owner: " << owner[curFaceLabel] <<
" neighbour: " 117 << neighbour[curFaceLabel]
138 List<bool> meshFaceUsed(localFaces.size(),
false);
141 const faceList& modelFaces = curModel.modelFaces();
145 modelFaces[faceMatchingOrder[fluentCellModelID][0]];
149 forAll(localFaces, meshFacei)
151 if (localFaces[meshFacei].size() == firstModelFace.size())
156 const labelList& curMeshFace = localFaces[meshFacei];
158 meshFaceUsed[meshFacei] =
true;
160 forAll(curMeshFace, pointi)
162 pointLabels[firstModelFace[pointi]] = curMeshFace[pointi];
172 <<
"Cannot find match for first face. " 173 <<
"cell model: " << curModel.name() <<
" first model face: " 174 << firstModelFace <<
" Mesh faces: " << localFaces
178 for (label modelFacei = 1; modelFacei < modelFaces.size(); modelFacei++)
183 [faceMatchingOrder[fluentCellModelID][modelFacei]];
188 forAll(localFaces, meshFacei)
192 !meshFaceUsed[meshFacei]
193 && localFaces[meshFacei].size() == curModelFace.size()
197 labelList meshFaceLabels = localFaces[meshFacei];
202 rotation < meshFaceLabels.size();
207 label nMatchedLabels = 0;
209 forAll(meshFaceLabels, pointi)
214 == meshFaceLabels[pointi]
221 if (nMatchedLabels >= 2)
230 forAll(meshFaceLabels, pointi)
233 meshFaceLabels[pointi];
236 meshFaceUsed[meshFacei] =
true;
243 label firstLabel = meshFaceLabels[0];
245 for (label i = 1; i < meshFaceLabels.size(); i++)
247 meshFaceLabels[i - 1] = meshFaceLabels[i];
250 meshFaceLabels.
last() = firstLabel;
262 <<
"Cannot find match for face " 264 <<
".\nModel: " << curModel.name() <<
" model face: " 265 << curModelFace <<
" Mesh faces: " << localFaces
void size(const label n)
Older name for setAddressableSize.
labelList pointLabels(nPoints, -1)
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.
void setSize(const label n)
Alias for resize()
static const cellModel * ptr(const modelType model)
Look up pointer to cellModel by enumeration, or nullptr on failure.
errorManip< error > abort(error &err)
T & last()
Access last element of the list, position [size()-1].
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
cellShape create3DCellShape(const label cellIndex, const labelList &faceLabels, const faceList &faces, const labelList &owner, const labelList &neighbour, const label fluentCellModelID)