diff --git a/vtkm/worklet/particleadvection/GridEvaluators.h b/vtkm/worklet/particleadvection/GridEvaluators.h index b369fa92e..01045bc19 100644 --- a/vtkm/worklet/particleadvection/GridEvaluators.h +++ b/vtkm/worklet/particleadvection/GridEvaluators.h @@ -336,9 +336,10 @@ public: rowSize = dims[0]; RectilinearType gridPoints = coords.GetData().Cast(); - xAxis = gridPoints.GetPortalConstControl().GetFirstPortal(); - yAxis = gridPoints.GetPortalConstControl().GetSecondPortal(); - zAxis = gridPoints.GetPortalConstControl().GetThirdPortal(); + RectilinearConstPortal gridPointsPortal = gridPoints.PrepareForInput(DeviceAdapterTag()); + xAxis = gridPointsPortal.GetFirstPortal(); + yAxis = gridPointsPortal.GetSecondPortal(); + zAxis = gridPointsPortal.GetThirdPortal(); } VTKM_CONT @@ -495,9 +496,11 @@ private: typedef vtkm::cont::ArrayHandle AxisHandle; typedef vtkm::cont::ArrayHandleCartesianProduct RectilinearType; - typename AxisHandle::PortalConstControl xAxis; - typename AxisHandle::PortalConstControl yAxis; - typename AxisHandle::PortalConstControl zAxis; + typedef typename RectilinearType::template ExecutionTypes::PortalConst + RectilinearConstPortal; + typename AxisHandle::template ExecutionTypes::PortalConst xAxis; + typename AxisHandle::template ExecutionTypes::PortalConst yAxis; + typename AxisHandle::template ExecutionTypes::PortalConst zAxis; vtkm::Bounds bounds; vtkm::Id3 dims; PortalType vectors; diff --git a/vtkm/worklet/testing/UnitTestParticleAdvection.cxx b/vtkm/worklet/testing/UnitTestParticleAdvection.cxx index 5d2c4f576..67c8c9570 100644 --- a/vtkm/worklet/testing/UnitTestParticleAdvection.cxx +++ b/vtkm/worklet/testing/UnitTestParticleAdvection.cxx @@ -118,10 +118,12 @@ void RandomPoint(const vtkm::Bounds& bounds, vtkm::Vec& p) template vtkm::cont::DataSet CreateUniformDataSet(const vtkm::Bounds& bounds, const vtkm::Id3& dims) { - vtkm::Vec origin(bounds.X.Min, bounds.Y.Min, bounds.Z.Min); - vtkm::Vec spacing(bounds.X.Length() / (dims[0] - 1), - bounds.Y.Length() / (dims[1] - 1), - bounds.Z.Length() / (dims[2] - 1)); + vtkm::Vec origin(static_cast(bounds.X.Min), + static_cast(bounds.Y.Min), + static_cast(bounds.Z.Min)); + vtkm::Vec spacing(static_cast(bounds.X.Length() / (dims[0] - 1)), + static_cast(bounds.Y.Length() / (dims[1] - 1)), + static_cast(bounds.Z.Length() / (dims[2] - 1))); vtkm::cont::DataSetBuilderUniform dataSetBuilder; vtkm::cont::DataSet ds = dataSetBuilder.Create(dims, origin, spacing); @@ -134,22 +136,22 @@ vtkm::cont::DataSet CreateRectilinearDataSet(const vtkm::Bounds& bounds, const v vtkm::cont::DataSetBuilderRectilinear dataSetBuilder; std::vector xvals, yvals, zvals; - vtkm::Vec spacing(bounds.X.Length() / (dims[0] - 1), - bounds.Y.Length() / (dims[1] - 1), - bounds.Z.Length() / (dims[2] - 1)); + vtkm::Vec spacing(static_cast(bounds.X.Length() / (dims[0] - 1)), + static_cast(bounds.Y.Length() / (dims[1] - 1)), + static_cast(bounds.Z.Length() / (dims[2] - 1))); xvals.resize(dims[0]); - xvals[0] = bounds.X.Min; + xvals[0] = static_cast(bounds.X.Min); for (vtkm::Id i = 1; i < dims[0]; i++) xvals[i] = xvals[i - 1] + spacing[0]; yvals.resize(dims[1]); yvals.resize(dims[1]); - yvals[0] = bounds.Y.Min; + yvals[0] = static_cast(bounds.Y.Min); for (vtkm::Id i = 1; i < dims[1]; i++) yvals[i] = yvals[i - 1] + spacing[1]; zvals.resize(dims[2]); - zvals[0] = bounds.Z.Min; + zvals[0] = static_cast(bounds.Z.Min); for (vtkm::Id i = 1; i < dims[2]; i++) zvals[i] = zvals[i - 1] + spacing[2]; @@ -392,10 +394,12 @@ void TestEvaluators() //Test the result for the evaluator ValidateEvaluator(constEval, pointIns, vec, "constant vector evaluator"); ValidateEvaluator(uniformEval, pointIns, vec, "uniform evaluator"); + ValidateEvaluator(rectEval, pointIns, vec, "rectilinear evaluator"); //Test taking one step. ValidateIntegrator(constRK4, pointIns, stepResult, "constant vector RK4"); ValidateIntegrator(uniformRK4, pointIns, stepResult, "uniform RK4"); + ValidateIntegrator(rectRK4, pointIns, stepResult, "rectilinear evaluator"); } } }