]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Correct memory access in grid_tools_guess_pt_owner_02 8159/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 14 May 2019 10:07:28 +0000 (12:07 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 14 May 2019 10:09:11 +0000 (12:09 +0200)
tests/grid/grid_tools_guess_pt_owner_02.cc
tests/grid/grid_tools_guess_pt_owner_02.output

index 483136152f28669c950cd5b8ee19b2b204bfb486..db6d784309786ecf86cdf3aa5560cf3546388d8b 100644 (file)
@@ -86,14 +86,11 @@ test_point_owner(unsigned int n_procs)
       unsigned int tot_pt = 0;
       for (unsigned int rk = 0; rk < n_procs; ++rk)
         {
-          const auto & rk_points = std::get<0>(output_tp)[rk];
-          unsigned int first_el  = rk * (rk + 1) / 2 - 1;
-          unsigned int last_el   = (rk + 1) * (rk + 2) / 2;
+          const auto &rk_points = std::get<0>(output_tp)[rk];
           for (unsigned int box = 0; box < rk; ++box)
             {
-              if (std::find(rk_points.begin() + first_el,
-                            rk_points.begin() + last_el,
-                            tot_pt) == rk_points.end())
+              if (std::find(rk_points.begin(), rk_points.end(), tot_pt) ==
+                  rk_points.end())
                 {
                   deallog << "Point " << tot_pt << " not found in rank " << rk
                           << std::endl;
index 816e8115e0c240cf32e24cf1806fffddceef1e23..06872b55112b09074501b89ad73f4f03a1f57caa 100644 (file)
@@ -33,8 +33,7 @@ DEAL::TEST PASSED
 DEAL::Simulating 3 processes
 DEAL::TEST PASSED
 DEAL::Simulating 5 processes
-DEAL::Point 2 not found in rank 2
-DEAL::TEST FAILED
+DEAL::TEST PASSED
 DEAL::Simulating 7 processes
 DEAL::TEST PASSED
 DEAL::Simulating 9 processes

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.