]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify simplify_categorize_by_boundary_ids 11147/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 5 Nov 2020 14:38:49 +0000 (15:38 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 5 Nov 2020 14:38:49 +0000 (15:38 +0100)
include/deal.II/matrix_free/tools.h

index 38b2a52afad793082daa0e54ad68f2fa1fa9535f..6ff02f395023e57815490ccf14443ec8ef2e1f38 100644 (file)
@@ -40,10 +40,8 @@ namespace MatrixFreeTools
    */
   template <int dim, typename AdditionalData>
   void
-  categorize_by_boundary_ids(
-    const Triangulation<dim> &tria,
-    AdditionalData &          additional_data,
-    const unsigned int        level = numbers::invalid_unsigned_int);
+  categorize_by_boundary_ids(const Triangulation<dim> &tria,
+                             AdditionalData &          additional_data);
 
   /**
    * Compute the diagonal of a linear operator (@p diagonal_global), given
@@ -81,18 +79,19 @@ namespace MatrixFreeTools
   template <int dim, typename AdditionalData>
   void
   categorize_by_boundary_ids(const Triangulation<dim> &tria,
-                             AdditionalData &          additional_data,
-                             const unsigned int        level)
+                             AdditionalData &          additional_data)
   {
     // ... determine if we are on an active or a multigrid level
-    const bool is_mg = (level != numbers::invalid_unsigned_int);
+    const unsigned int level = additional_data.mg_level;
+    const bool         is_mg = (level != numbers::invalid_unsigned_int);
 
     // ... create empty list for the category of each cell
     if (is_mg)
-      additional_data.cell_vectorization_category.resize(
-        std::distance(tria.begin(level), tria.end(level)));
+      additional_data.cell_vectorization_category.assign(
+        std::distance(tria.begin(level), tria.end(level)), 0);
     else
-      additional_data.cell_vectorization_category.resize(tria.n_active_cells());
+      additional_data.cell_vectorization_category.assign(tria.n_active_cells(),
+                                                         0);
 
     // ... set up scaling factor
     std::vector<unsigned int> factors(GeometryInfo<dim>::faces_per_cell);

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.