From: David Wells Date: Sat, 14 May 2022 18:12:24 +0000 (-0400) Subject: Simplify some code. X-Git-Tag: v9.4.0-rc1~216^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13736%2Fhead;p=dealii.git Simplify some code. --- diff --git a/source/distributed/fully_distributed_tria.cc b/source/distributed/fully_distributed_tria.cc index 865176fa54..247af922f8 100644 --- a/source/distributed/fully_distributed_tria.cc +++ b/source/distributed/fully_distributed_tria.cc @@ -256,34 +256,29 @@ namespace parallel const dealii::Triangulation *other_tria_ptr = &other_tria; // temporary serial triangulation (since the input triangulation is const - // and we might modify its subdomain_ids - // and level_subdomain_ids during partitioning); this pointer only points - // to anything if the source triangulation is serial, and ensures that our - // copy is eventually deleted - std::unique_ptr> serial_tria; + // and we might modify its subdomain_ids and level_subdomain_ids during + // partitioning) + dealii::Triangulation serial_tria; // check if other triangulation is not a parallel one, which needs to be // partitioned if (dynamic_cast *>(&other_tria) == nullptr) { - serial_tria = - std::make_unique>(); - // actually copy the serial triangulation - serial_tria->copy_triangulation(other_tria); + serial_tria.copy_triangulation(other_tria); // partition triangulation - this->partitioner(*serial_tria, + this->partitioner(serial_tria, dealii::Utilities::MPI::n_mpi_processes( this->mpi_communicator)); // partition multigrid levels if (this->is_multilevel_hierarchy_constructed()) - GridTools::partition_multigrid_levels(*serial_tria); + GridTools::partition_multigrid_levels(serial_tria); // use the new serial triangulation to create the construction data - other_tria_ptr = serial_tria.get(); + other_tria_ptr = &serial_tria; } // create construction data