Skip to content

Commit

Permalink
Delete visibility scalar data if it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Nov 22, 2024
1 parent 476b274 commit 8200717
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/viennals/lsCalculateVisibilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ template <class NumericType, int D> class CalculateVisibilities {
}
}

levelSet->getPointData().insertNextScalarData(visibilities,
visibilitiesLabel);
auto &pointData = levelSet->getPointData();
// delete if already exists
if (int i = pointData.getScalarDataIndex(visibilitiesLabel); i != -1) {
pointData.eraseScalarData(i);
}
pointData.insertNextScalarData(visibilities, visibilitiesLabel);

assert(id == numDefinedPoints);
}
Expand Down

0 comments on commit 8200717

Please sign in to comment.