]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify some code. 13736/head
authorDavid Wells <drwells@email.unc.edu>
Sat, 14 May 2022 18:12:24 +0000 (14:12 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 14 May 2022 18:12:24 +0000 (14:12 -0400)
source/distributed/fully_distributed_tria.cc

index 865176fa5468892b4964dfb6120dca8ff96d43a7..247af922f8ccb6251590e898121c954d1b1324d9 100644 (file)
@@ -256,34 +256,29 @@ namespace parallel
       const dealii::Triangulation<dim, spacedim> *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<dealii::Triangulation<dim, spacedim>> serial_tria;
+      // and we might modify its subdomain_ids and level_subdomain_ids during
+      // partitioning)
+      dealii::Triangulation<dim, spacedim> serial_tria;
 
       // check if other triangulation is not a parallel one, which needs to be
       // partitioned
       if (dynamic_cast<const dealii::parallel::TriangulationBase<dim, spacedim>
                          *>(&other_tria) == nullptr)
         {
-          serial_tria =
-            std::make_unique<dealii::Triangulation<dim, spacedim>>();
-
           // 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

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.