]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow to disable fast matrix-free hanging-node algorithm 12779/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 28 Sep 2021 13:05:09 +0000 (15:05 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 28 Sep 2021 13:07:49 +0000 (15:07 +0200)
include/deal.II/matrix_free/matrix_free.h
include/deal.II/matrix_free/matrix_free.templates.h

index aa538db007ea6fe493b6f95a9eca148923c0d7b3..d867a8bb79e7bdabae4f972cf0b95dc6905a0be3 100644 (file)
@@ -226,7 +226,8 @@ public:
       const bool         overlap_communication_computation    = true,
       const bool         hold_all_faces_to_owned_cells        = false,
       const bool         cell_vectorization_categories_strict = false,
-      const bool         allow_ghosted_vectors_in_loops       = true)
+      const bool         allow_ghosted_vectors_in_loops       = true,
+      const bool         use_fast_hanging_node_algorithm      = true)
       : tasks_parallel_scheme(tasks_parallel_scheme)
       , tasks_block_size(tasks_block_size)
       , mapping_update_flags(mapping_update_flags)
@@ -242,6 +243,7 @@ public:
       , cell_vectorization_categories_strict(
           cell_vectorization_categories_strict)
       , allow_ghosted_vectors_in_loops(allow_ghosted_vectors_in_loops)
+      , use_fast_hanging_node_algorithm(use_fast_hanging_node_algorithm)
       , communicator_sm(MPI_COMM_SELF)
     {}
 
@@ -268,6 +270,7 @@ public:
       , cell_vectorization_categories_strict(
           other.cell_vectorization_categories_strict)
       , allow_ghosted_vectors_in_loops(other.allow_ghosted_vectors_in_loops)
+      , use_fast_hanging_node_algorithm(other.use_fast_hanging_node_algorithm)
       , communicator_sm(other.communicator_sm)
     {}
 
@@ -295,8 +298,9 @@ public:
       cell_vectorization_category   = other.cell_vectorization_category;
       cell_vectorization_categories_strict =
         other.cell_vectorization_categories_strict;
-      allow_ghosted_vectors_in_loops = other.allow_ghosted_vectors_in_loops;
-      communicator_sm                = other.communicator_sm;
+      allow_ghosted_vectors_in_loops  = other.allow_ghosted_vectors_in_loops;
+      use_fast_hanging_node_algorithm = other.use_fast_hanging_node_algorithm;
+      communicator_sm                 = other.communicator_sm;
 
       return *this;
     }
@@ -533,6 +537,11 @@ public:
      */
     bool allow_ghosted_vectors_in_loops;
 
+    /**
+     * Flag that allows to disable the fast hanging-node algorithm.
+     */
+    bool use_fast_hanging_node_algorithm;
+
     /**
      * Shared-memory MPI communicator. Default: MPI_COMM_SELF.
      */
index 4f7666d93e0f9b6cbdfe6b57e17f6db6898dc1b6..eafa6b1afab1e0f69641171653a94468ab7dc57c 100644 (file)
@@ -1036,7 +1036,8 @@ namespace internal
     std::vector<MatrixFreeFunctions::DoFInfo> &         dof_info,
     MatrixFreeFunctions::FaceSetup<dim> &               face_setup,
     MatrixFreeFunctions::ConstraintValues<double> &     constraint_values,
-    const bool use_vector_data_exchanger_full)
+    const bool use_vector_data_exchanger_full,
+    const bool use_fast_hanging_node_algorithm)
   {
     if (do_face_integrals)
       face_setup.initialize(dof_handler[0]->get_triangulation(),
@@ -1225,7 +1226,8 @@ namespace internal
 
                 bool cell_has_hanging_node_constraints = false;
 
-                if (dim > 1 && dofh->get_fe_collection().size() == 1)
+                if (dim > 1 && use_fast_hanging_node_algorithm &&
+                    dofh->get_fe_collection().size() == 1)
                   {
                     local_dof_indices_resolved = local_dof_indices;
 
@@ -1749,7 +1751,8 @@ MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices(
     dof_info,
     face_setup,
     constraint_values,
-    additional_data.communicator_sm != MPI_COMM_SELF);
+    additional_data.communicator_sm != MPI_COMM_SELF,
+    additional_data.use_fast_hanging_node_algorithm);
 
   // set constraint pool from the std::map and reorder the indices
   std::vector<const std::vector<double> *> constraints(

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.