From f8338521c4cc504a8bb3fec6e244792b62ff7af4 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 14 May 2022 14:12:24 -0400 Subject: [PATCH] Simplify some code. --- source/distributed/fully_distributed_tria.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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 -- 2.39.5