18 #ifndef viskores_exec_CellFace_h
19 #define viskores_exec_CellFace_h
60 return numFaces[cellShapeId];
69 { -1, -1, -1, -1, -1, -1 },
70 { -1, -1, -1, -1, -1, -1 },
71 { -1, -1, -1, -1, -1, -1 },
72 { -1, -1, -1, -1, -1, -1 },
73 { -1, -1, -1, -1, -1, -1 },
74 { -1, -1, -1, -1, -1, -1 },
75 { -1, -1, -1, -1, -1, -1 },
76 { -1, -1, -1, -1, -1, -1 },
77 { -1, -1, -1, -1, -1, -1 },
78 { -1, -1, -1, -1, -1, -1 },
79 { 3, 3, 3, 3, -1, -1 },
80 { -1, -1, -1, -1, -1, -1 },
82 { 3, 3, 4, 4, 4, -1 },
85 return numPointsInFace[cellShapeId][faceIndex];
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 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
120 { -1, -1, -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 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
126 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
128 { { 0, 1, 3, -1 }, { 1, 2, 3, -1 }, { 2, 0, 3, -1 },
129 { 0, 2, 1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
131 { { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 },
132 { -1, -1, -1, -1 }, { -1, -1, -1, -1 }, { -1, -1, -1, -1 } },
134 { { 0, 4, 7, 3 }, { 1, 2, 6, 5 }, { 0, 1, 5, 4 },
135 { 3, 7, 6, 2 }, { 0, 3, 2, 1 }, { 4, 5, 6, 7 } },
137 { { 0, 1, 2, -1 }, { 3, 5, 4, -1 }, { 0, 3, 4, 1 },
138 { 1, 4, 5, 2 }, { 2, 5, 3, 0 }, { -1, -1, -1, -1 } },
140 { { 0, 3, 2, 1 }, { 0, 1, 4, -1 }, { 1, 2, 4, -1 },
141 { 2, 3, 4, -1 }, { 3, 0, 4, -1 },{ -1, -1, -1, -1 } }
144 return pointsInFace[cellShapeId][faceIndex][localPointIndex];
155 template <
typename CellShapeTag>
160 detail::CellFaceTables table;
161 result = table.NumFaces(shape.Id);
174 template <
typename CellShapeTag>
180 if ((faceIndex < 0) || (faceIndex >= detail::CellFaceTables::MAX_NUM_FACES))
188 if (faceIndex >= numFaces)
193 detail::CellFaceTables table;
194 result = table.NumPointsInFace(shape.Id, faceIndex);
210 template <
typename CellShapeTag>
216 if ((faceIndex < 0) || (faceIndex >= detail::CellFaceTables::MAX_NUM_FACES))
224 switch (numFacePoints)
250 template <
typename CellShapeTag>
259 viskores::exec::CellFaceNumberOfPoints(faceIndex, shape, numPointsInFace));
260 if (numPointsInFace < 1)
267 detail::CellFaceTables table;
268 result = table.PointsInFace(shape.Id, faceIndex, pointIndex);
282 template <
typename CellShapeTag,
typename GlobalPo
intIndicesVecType>
286 const GlobalPointIndicesVecType& globalPointIndicesVec,
292 viskores::exec::CellFaceNumberOfPoints(faceIndex, shape, numPointsInFace));
293 if (numPointsInFace < 1)
300 detail::CellFaceTables table;
302 result =
viskores::Id3(globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 0)],
303 globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 1)],
304 globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 2)]);
306 if (result[0] > result[2])
309 result[0] = result[2];
312 if (result[0] > result[1])
315 result[0] = result[1];
318 if (result[1] > result[2])
321 result[1] = result[2];
329 globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, pointIndex)];
330 if (nextPoint < result[2])
332 if (nextPoint < result[1])
334 result[2] = result[1];
335 if (nextPoint < result[0])
337 result[1] = result[0];
338 result[0] = nextPoint;
342 result[1] = nextPoint;
347 result[2] = nextPoint;
362 template <
typename CellShapeTag,
typename GlobalPo
intIndicesVecType>
366 const GlobalPointIndicesVecType& globalPointIndicesVec,
370 minFacePointId = { -1 };
372 viskores::exec::CellFaceNumberOfPoints(faceIndex, shape, numPointsInFace));
373 if (numPointsInFace < 1)
380 detail::CellFaceTables table;
381 minFacePointId = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 0)];
382 viskores::Id nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 1)];
383 if (nextPoint < minFacePointId)
385 minFacePointId = nextPoint;
387 nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, 2)];
388 if (nextPoint < minFacePointId)
390 minFacePointId = nextPoint;
396 nextPoint = globalPointIndicesVec[table.PointsInFace(shape.Id, faceIndex, pointIndex)];
397 if (nextPoint < minFacePointId)
399 minFacePointId = nextPoint;
408 #endif //viskores_exec_CellFace_h