From: Niklas Fehn Date: Fri, 8 Apr 2022 14:08:39 +0000 (+0200) Subject: now implement correct version X-Git-Tag: v9.4.0-rc1~328^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c1d3b3724e0edad9e43fa934d23c2217ab412ef;p=dealii.git now implement correct version --- diff --git a/source/base/mpi_remote_point_evaluation.cc b/source/base/mpi_remote_point_evaluation.cc index 4af01fa5cc..dd1907609a 100644 --- a/source/base/mpi_remote_point_evaluation.cc +++ b/source/base/mpi_remote_point_evaluation.cc @@ -192,9 +192,10 @@ namespace Utilities if (is_map_unique()) return true; - for (unsigned int i = 1; i < point_ptrs.size(); ++i) - if (point_found(i) == false) - return false; + if (point_ptrs.size() > 0) + for (unsigned int i = 0; i < point_ptrs.size() - 1; ++i) + if (point_found(i) == false) + return false; return true; } @@ -206,8 +207,8 @@ namespace Utilities RemotePointEvaluation::point_found( const unsigned int i) const { - AssertIndexRange(i, point_ptrs.size()); - return (point_ptrs[i] - (i > 0) ? point_ptrs[i - 1] : 0) > 0; + AssertIndexRange(i, point_ptrs.size() - 1); + return (point_ptrs[i + 1] - point_ptrs[i]) > 0; }