diff --git a/vtkm/filter/MIRFilter.hxx b/vtkm/filter/MIRFilter.hxx index 46c4296c6..84c853057 100644 --- a/vtkm/filter/MIRFilter.hxx +++ b/vtkm/filter/MIRFilter.hxx @@ -313,10 +313,10 @@ inline VTKM_CONT vtkm::cont::DataSet MIRFilter::DoExecute( vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this).GetNumberOfCells()); this->error_scaling *= this->scaling_decay; - VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Mir iteration " << currentIterationNum + 1 << "/" << this->max_iter << "\t Total error: " << totalError); + saved.AddField(vtkm::cont::Field( this->GetOutputFieldName(), vtkm::cont::Field::Association::CELL_SET, prevMat)); diff --git a/vtkm/filter/testing/UnitTestMIRFilter.cxx b/vtkm/filter/testing/UnitTestMIRFilter.cxx index c2e0600ca..a5b820e84 100644 --- a/vtkm/filter/testing/UnitTestMIRFilter.cxx +++ b/vtkm/filter/testing/UnitTestMIRFilter.cxx @@ -49,9 +49,9 @@ vtkm::cont::DataSet GetTestDataSet() } } - std::vector idAR{ 1, 2, 2, 1, 2, 1, 1, 2 }; - std::vector lnAR{ 1, 1, 1, 1, 1, 1, 1, 1 }; - std::vector ofAR{ 0, 1, 2, 3, 4, 5, 6, 7 }; + std::vector idAR{ 1, 2, 2, 1, 2, 1, 1, 2 }; + std::vector lnAR{ 1, 1, 1, 1, 1, 1, 1, 1 }; + std::vector ofAR{ 0, 1, 2, 3, 4, 5, 6, 7 }; vtkm::cont::ArrayHandle offsets = vtkm::cont::make_ArrayHandle(ofAR, vtkm::CopyFlag::On); vtkm::cont::ArrayHandle lengths = @@ -83,11 +83,8 @@ vtkm::cont::DataSet GetTestDataSet() } } } - VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "A"); vtkm::cont::DataSet ds = dsb.Create(points, shapes, numberofInd, connections); - VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "B"); ds.AddField(vtkm::cont::Field("scatter_pos", vtkm::cont::Field::Association::CELL_SET, offsets)); - VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "C"); ds.AddField(vtkm::cont::Field("scatter_len", vtkm::cont::Field::Association::CELL_SET, lengths)); ds.AddField(vtkm::cont::Field("scatter_ids", vtkm::cont::Field::Association::WHOLE_MESH, ids)); ds.AddField(vtkm::cont::Field("scatter_vfs", vtkm::cont::Field::Association::WHOLE_MESH, vfs)); @@ -111,8 +108,12 @@ void TestMIR() mir.SetMaxPercentError(vtkm::Float64( 0.00001)); // Only useful for iterations >= 1, will stop iterating if total % error for entire mesh is less than this value // Note it is mathematically impossible to obtain 0% error outside of VERY special cases (neglecting float error) + VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "Before executing filter"); + vtkm::cont::DataSet ds_from_mir = mir.Execute(ds); + VTKM_LOG_S(vtkm::cont::LogLevel::Warn, "After executing filter"); + // Test if ds_from_mir has 40 cells VTKM_TEST_ASSERT(ds_from_mir.GetNumberOfCells() == 40, "Wrong number of output cells"); }