From e598fd6351b4ba0e334aa6a852473b08e4bb03c0 Mon Sep 17 00:00:00 2001 From: "Gunther H. Weber" Date: Fri, 7 Apr 2023 19:02:07 -0700 Subject: [PATCH] Refer to field by name instead of index to fix crash in contour tree exmaple. --- examples/contour_tree_augmented/ContourTreeApp.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/contour_tree_augmented/ContourTreeApp.cxx b/examples/contour_tree_augmented/ContourTreeApp.cxx index 6e50a24e7..5b036c6a3 100644 --- a/examples/contour_tree_augmented/ContourTreeApp.cxx +++ b/examples/contour_tree_augmented/ContourTreeApp.cxx @@ -756,14 +756,13 @@ int main(int argc, char* argv[]) //----Isovalue seleciton start if (numLevels > 0) // if compute isovalues { -// Get the data values for computing the explicit branch decomposition -#ifdef WITH_MPI + // Get the data values for computing the explicit branch decomposition vtkm::cont::ArrayHandle dataField; - result.GetPartitions()[0].GetField(0).GetData().AsArrayHandle(dataField); +#ifdef WITH_MPI + result.GetPartitions()[0].GetField("values").GetData().AsArrayHandle(dataField); bool dataFieldIsSorted = true; #else - vtkm::cont::ArrayHandle dataField; - useDataSet.GetField(0).GetData().AsArrayHandle(dataField); + useDataSet.GetField("values").GetData().AsArrayHandle(dataField); bool dataFieldIsSorted = false; #endif