diff --git a/tutorial/extract_edges.cxx b/tutorial/extract_edges.cxx index 0159e7685..f2ddda9b0 100644 --- a/tutorial/extract_edges.cxx +++ b/tutorial/extract_edges.cxx @@ -88,10 +88,23 @@ struct EdgeIndicesWorklet : vtkm::worklet::WorkletReduceByKey vtkm::IdComponent edgeIndex = originEdges[0]; auto cellShape = cellSet.GetCellShape(originCells[0]); + vtkm::ErrorCode error; vtkm::IdComponent pointInCellIndex0; - vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 0, edgeIndex, cellShape, pointInCellIndex0); + error = + vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 0, edgeIndex, cellShape, pointInCellIndex0); + if (error != vtkm::ErrorCode::Success) + { + this->RaiseError(vtkm::ErrorString(error); + return; + } vtkm::IdComponent pointInCellIndex1; - vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 1, edgeIndex, cellShape, pointInCellIndex1); + error = + vtkm::exec::CellEdgeLocalIndex(numPointsInCell, 1, edgeIndex, cellShape, pointInCellIndex1); + if (error != vtkm::ErrorCode::Success) + { + this->RaiseError(vtkm::ErrorString(error); + return; + } auto globalPointIndicesForCell = cellSet.GetIndices(originCells[0]); connectivityOut[0] = globalPointIndicesForCell[pointInCellIndex0]; diff --git a/tutorial/point_to_cell.cxx b/tutorial/point_to_cell.cxx index 2fb037720..7062adef4 100644 --- a/tutorial/point_to_cell.cxx +++ b/tutorial/point_to_cell.cxx @@ -38,7 +38,7 @@ struct ConvertPointFieldToCells : vtkm::worklet::WorkletVisitCellsWithPoints { outCellField = outCellField + inPointFieldVec[pointIndex]; } - outCellField = outCellField / static_cast(numPoints); + outCellField = outCellField / static_cast(numPoints); } };