]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use AlignedVector in MappingQGeneric. 12468/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 17 Jun 2021 12:50:33 +0000 (08:50 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 17 Jun 2021 14:12:25 +0000 (10:12 -0400)
The last patch indicates the compiler wants to vectorize access to these arrays,
so lets align them better.

include/deal.II/fe/mapping_q_generic.h
include/deal.II/fe/mapping_q_internal.h
source/fe/mapping_q_generic.cc

index ffabffb281e769d4c998cc47768a6ef1fdb9568c..bb8a58f4c980c9d4beeffcac5121d1d875a3f2fb 100644 (file)
@@ -386,14 +386,14 @@ public:
      *
      * Computed once.
      */
-    std::vector<double> shape_values;
+    AlignedVector<double> shape_values;
 
     /**
      * Values of shape function derivatives. Access by function @p derivative.
      *
      * Computed once.
      */
-    std::vector<Tensor<1, dim>> shape_derivatives;
+    AlignedVector<Tensor<1, dim>> shape_derivatives;
 
     /**
      * Values of shape function second derivatives. Access by function @p
@@ -401,7 +401,7 @@ public:
      *
      * Computed once.
      */
-    std::vector<Tensor<2, dim>> shape_second_derivatives;
+    AlignedVector<Tensor<2, dim>> shape_second_derivatives;
 
     /**
      * Values of shape function third derivatives. Access by function @p
@@ -409,7 +409,7 @@ public:
      *
      * Computed once.
      */
-    std::vector<Tensor<3, dim>> shape_third_derivatives;
+    AlignedVector<Tensor<3, dim>> shape_third_derivatives;
 
     /**
      * Values of shape function fourth derivatives. Access by function @p
@@ -417,7 +417,7 @@ public:
      *
      * Computed once.
      */
-    std::vector<Tensor<4, dim>> shape_fourth_derivatives;
+    AlignedVector<Tensor<4, dim>> shape_fourth_derivatives;
 
     /**
      * Unit tangential vectors. Used for the computation of boundary forms and
@@ -515,7 +515,7 @@ public:
      *
      * Computed on each cell.
      */
-    mutable std::vector<DerivativeForm<1, dim, spacedim>> covariant;
+    mutable AlignedVector<DerivativeForm<1, dim, spacedim>> covariant;
 
     /**
      * Tensors of contravariant transformation at each of the quadrature
@@ -524,12 +524,12 @@ public:
      *
      * Computed on each cell.
      */
-    mutable std::vector<DerivativeForm<1, dim, spacedim>> contravariant;
+    mutable AlignedVector<DerivativeForm<1, dim, spacedim>> contravariant;
 
     /**
      * Auxiliary vectors for internal use.
      */
-    mutable std::vector<std::vector<Tensor<1, spacedim>>> aux;
+    mutable std::vector<AlignedVector<Tensor<1, spacedim>>> aux;
 
     /**
      * Stores the support points of the mapping shape functions on the @p
@@ -547,7 +547,7 @@ public:
      * The determinant of the Jacobian in each quadrature point. Filled if
      * #update_volume_elements.
      */
-    mutable std::vector<double> volume_elements;
+    mutable AlignedVector<double> volume_elements;
   };
 
 
index cf155f2df92196fdffdf6743522aeace4895ebca..f7140992565d2a71b816339f6bf8c422a86880bc 100644 (file)
@@ -1881,7 +1881,7 @@ namespace internal
                                         GeometryInfo<dim>::faces_per_cell * d]),
                 mapping_contravariant,
                 data,
-                make_array_view(data.aux[d]));
+                make_array_view(data.aux[d].begin(), data.aux[d].end()));
             }
 
           if (update_flags & update_boundary_forms)
index 1db0f55cba007cb33b785264677a162482dea4af..40f35af3f10cf768bc6a41afe4b190395eb08660 100644 (file)
@@ -239,7 +239,7 @@ MappingQGeneric<dim, spacedim>::InternalData::initialize_face(
            update_JxW_values | update_inverse_jacobians))
         {
           aux.resize(dim - 1,
-                     std::vector<Tensor<1, spacedim>>(n_original_q_points));
+                     AlignedVector<Tensor<1, spacedim>>(n_original_q_points));
 
           // Compute tangentials to the unit cell.
           for (const unsigned int i : GeometryInfo<dim>::face_indices())

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.