]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add documentation. 7032/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 18 Aug 2018 17:18:55 +0000 (19:18 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 18 Aug 2018 17:18:55 +0000 (19:18 +0200)
include/deal.II/matrix_free/dof_info.templates.h
include/deal.II/matrix_free/fe_evaluation.h

index caaba870dde0542462eb84b37ad56ac48dcb94c7..3dd3a6c69cfae31faa85a000d2af9d91acc55161 100644 (file)
@@ -928,7 +928,7 @@ namespace internal
       // Step 2: fix single contiguous cell among others with interleaved
       // storage
       if (n_interleaved > 0 && index_kinds[static_cast<unsigned int>(
-                                 IndexStorageVariants::contiguous)])
+                                 IndexStorageVariants::contiguous)] > 0)
         for (unsigned int i = 0; i < irregular_cells.size(); ++i)
           if (index_storage_variants[dof_access_cell][i] ==
               IndexStorageVariants::contiguous)
@@ -941,14 +941,6 @@ namespace internal
                 IndexStorageVariants::interleaved_contiguous_mixed_strides)]++;
             }
 
-      n_interleaved =
-        index_kinds[static_cast<unsigned int>(
-          IndexStorageVariants::interleaved_contiguous)] +
-        index_kinds[static_cast<unsigned int>(
-          IndexStorageVariants::interleaved_contiguous_strided)] +
-        index_kinds[static_cast<unsigned int>(
-          IndexStorageVariants::interleaved_contiguous_mixed_strides)];
-
       // Step 3: Interleaved cells are left but also some non-contiguous ones
       // -> revert all to full storage
       if (n_interleaved > 0 &&
index daafb5ad8f74082a8f84e32cc687a2e3e3f052f2..889b13753ee495667ede7713028f5743df6d4f75 100644 (file)
@@ -6885,7 +6885,12 @@ FEEvaluation<dim, fe_degree, n_q_points_1d, n_components_, Number>::
                   const bool        evaluate_gradients,
                   const bool        evaluate_hessians)
 {
-  if (this->dof_info->index_storage_variants
+  // If the index storage is interleaved and contiguous and the vector storage
+  // has the correct alignment, we can directly pass the pointer into the
+  // vector to the evaluate() call, without reading the vector entries into a
+  // separate data field. This saves some operations.
+  if (std::is_same<typename VectorType::value_type, Number>::value &&
+      this->dof_info->index_storage_variants
           [internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
           [this->cell] == internal::MatrixFreeFunctions::DoFInfo::
                             IndexStorageVariants::interleaved_contiguous &&
@@ -6998,7 +7003,13 @@ FEEvaluation<dim, fe_degree, n_q_points_1d, n_components_, Number>::
                     const bool  integrate_gradients,
                     VectorType &destination)
 {
-  if (this->dof_info->index_storage_variants
+  // If the index storage is interleaved and contiguous and the vector storage
+  // has the correct alignment, we can directly pass the pointer into the
+  // vector to the integrate() call, without writing temporary results into a
+  // separate data field that will later be added into the vector. This saves
+  // some operations.
+  if (std::is_same<typename VectorType::value_type, Number>::value &&
+      this->dof_info->index_storage_variants
           [internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
           [this->cell] == internal::MatrixFreeFunctions::DoFInfo::
                             IndexStorageVariants::interleaved_contiguous &&

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.