10 #ifndef vtk_m_exec_CellFace_h
11 #define vtk_m_exec_CellFace_h
52 return numFaces[cellShapeId];
60 { -1, -1, -1, -1, -1, -1 },
61 { -1, -1, -1, -1, -1, -1 },
62 { -1, -1, -1, -1, -1, -1 },
63 { -1, -1, -1, -1, -1, -1 },
64 { -1, -1, -1, -1, -1, -1 },
65 { -1, -1, -1, -1, -1, -1 },
66 { -1, -1, -1, -1, -1, -1 },
67 { -1, -1, -1, -1, -1, -1 },
68 { -1, -1, -1, -1, -1, -1 },
69 { -1, -1, -1, -1, -1, -1 },
70 { 3, 3, 3, 3, -1, -1 },
71 { -1, -1, -1, -1, -1, -1 },
73 { 3, 3, 4, 4, 4, -1 },
76 return numPointsInFace[cellShapeId][faceIndex];
89 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
90 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
92 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
93 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
95 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
96 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
98 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
99 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
101 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
102 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
104 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
105 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
107 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
108 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
110 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
111 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
113 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
114 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
116 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
117 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
119 { { 0, 1, 3, -1 }, { 1, 2, 3, -1 }, { 2, 0, 3, -1 },
120 { 0, 2, 1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
122 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
123 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
125 { { 0, 4, 7, 3 }, { 1, 2, 6, 5 }, { 0, 1, 5, 4 },
126 { 3, 7, 6, 2 }, { 0, 3, 2, 1 }, { 4, 5, 6, 7 } },
128 { { 0, 1, 2, -1 }, { 3, 5, 4, -1 }, { 0, 3, 4, 1 },
129 { 1, 4, 5, 2 }, { 2, 5, 3, 0 }, { -1, -1, -1, -1 } },
131 { { 0, 3, 2, 1 }, { 0, 1, 4, -1 }, { 1, 2, 4, -1 },
132 { 2, 3, 4, -1 }, { 3, 0, 4, -1 },{ -1, -1, -1, -1 } }
135 return pointsInFace[cellShapeId][faceIndex][localPointIndex];
146 template <
typename CellShapeTag>
151 detail::CellFaceTables table;
152 result = table.NumFaces(shape.Id);
165 template <
typename CellShapeTag>
170 if ((faceIndex < 0) || (faceIndex >= detail::CellFaceTables::MAX_NUM_FACES))
178 if (faceIndex >= numFaces)
183 detail::CellFaceTables table;
184 result = table.NumPointsInFace(shape.Id, faceIndex);
200 template <
typename CellShapeTag>
206 if ((faceIndex < 0) || (faceIndex >= detail::CellFaceTables::MAX_NUM_FACES))
214 switch (numFacePoints)
240 template <
typename CellShapeTag>
249 if (numPointsInFace < 1)
256 detail::CellFaceTables table;
257 result = table.PointsInFace(shape.Id, faceIndex, pointIndex);
271 template <
typename CellShapeTag,
typename GlobalPo
intIndicesVecType>
275 const GlobalPointIndicesVecType& globalPointIndicesVec,
281 if (numPointsInFace < 1)
288 detail::CellFaceTables table;
290 result =
vtkm::Id3(globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 0)],
291 globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 1)],
292 globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 2)]);
294 if (result[0] > result[2])
297 result[0] = result[2];
300 if (result[0] > result[1])
303 result[0] = result[1];
306 if (result[1] > result[2])
309 result[1] = result[2];
314 for (
vtkm::IdComponent pointIndex = 3; pointIndex < numPointsInFace; pointIndex++)
316 vtkm::Id nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, pointIndex)];
317 if (nextPoint < result[2])
319 if (nextPoint < result[1])
321 result[2] = result[1];
322 if (nextPoint < result[0])
324 result[1] = result[0];
325 result[0] = nextPoint;
329 result[1] = nextPoint;
334 result[2] = nextPoint;
349 template <
typename CellShapeTag,
typename GlobalPo
intIndicesVecType>
353 const GlobalPointIndicesVecType& globalPointIndicesVec,
357 minFacePointId = { -1 };
359 if (numPointsInFace < 1)
366 detail::CellFaceTables table;
367 minFacePointId = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 0)];
368 vtkm::Id nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 1)];
369 if (nextPoint < minFacePointId)
371 minFacePointId = nextPoint;
373 nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 2)];
374 if (nextPoint < minFacePointId)
376 minFacePointId = nextPoint;
380 for (
vtkm::IdComponent pointIndex = 3; pointIndex < numPointsInFace; pointIndex++)
382 nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, pointIndex)];
383 if (nextPoint < minFacePointId)
385 minFacePointId = nextPoint;
394 #endif //vtk_m_exec_CellFace_h