From: Daniel Arndt Date: Wed, 9 Jan 2019 18:18:47 +0000 (+0100) Subject: Merge pull request #7569 from GivAlz/AddTestGlobalTree X-Git-Tag: v9.1.0-rc1~455 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a6b49b1915700eaf561af8f2dfa385a2bab7c26;p=dealii.git Merge pull request #7569 from GivAlz/AddTestGlobalTree Add test and support for non-mpi to GridTools::build_global_tree --- 7a6b49b1915700eaf561af8f2dfa385a2bab7c26 diff --cc source/grid/grid_tools.cc index 57717e4e48,caa15ded21..e48689f582 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@@ -5090,15 -5088,18 +5090,17 @@@ namespace GridTool MPI_Comm mpi_communicator) { #ifndef DEAL_II_WITH_MPI - (void)local_description; (void)mpi_communicator; - Assert(false, - ExcMessage( - "GridTools::build_global_description_tree() requires MPI.")); - return RTree, unsigned int>>{}; + // Building a tree with the only boxes available without MPI + std::vector, unsigned int>> boxes_index( + local_description.size()); + // Adding to each box the rank of the process owning it + for (unsigned int i = 0; i < local_description.size(); ++i) + boxes_index[i] = std::make_pair(local_description[i], 0u); + return pack_rtree(boxes_index); #else // Exchanging local bounding boxes - std::vector>> global_bboxes; - global_bboxes = + const std::vector>> global_bboxes = Utilities::MPI::all_gather(mpi_communicator, local_description); // Preparing to flatten the vector