From: David Wells Date: Thu, 17 Jun 2021 12:50:33 +0000 (-0400) Subject: Use AlignedVector in MappingQGeneric. X-Git-Tag: v9.4.0-rc1~1218^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eff589b763704670a9312414e32d7e2a95f1c3ec;p=dealii.git Use AlignedVector in MappingQGeneric. The last patch indicates the compiler wants to vectorize access to these arrays, so lets align them better. --- diff --git a/include/deal.II/fe/mapping_q_generic.h b/include/deal.II/fe/mapping_q_generic.h index ffabffb281..bb8a58f4c9 100644 --- a/include/deal.II/fe/mapping_q_generic.h +++ b/include/deal.II/fe/mapping_q_generic.h @@ -386,14 +386,14 @@ public: * * Computed once. */ - std::vector shape_values; + AlignedVector shape_values; /** * Values of shape function derivatives. Access by function @p derivative. * * Computed once. */ - std::vector> shape_derivatives; + AlignedVector> shape_derivatives; /** * Values of shape function second derivatives. Access by function @p @@ -401,7 +401,7 @@ public: * * Computed once. */ - std::vector> shape_second_derivatives; + AlignedVector> shape_second_derivatives; /** * Values of shape function third derivatives. Access by function @p @@ -409,7 +409,7 @@ public: * * Computed once. */ - std::vector> shape_third_derivatives; + AlignedVector> shape_third_derivatives; /** * Values of shape function fourth derivatives. Access by function @p @@ -417,7 +417,7 @@ public: * * Computed once. */ - std::vector> shape_fourth_derivatives; + AlignedVector> 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> covariant; + mutable AlignedVector> covariant; /** * Tensors of contravariant transformation at each of the quadrature @@ -524,12 +524,12 @@ public: * * Computed on each cell. */ - mutable std::vector> contravariant; + mutable AlignedVector> contravariant; /** * Auxiliary vectors for internal use. */ - mutable std::vector>> aux; + mutable std::vector>> 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 volume_elements; + mutable AlignedVector volume_elements; }; diff --git a/include/deal.II/fe/mapping_q_internal.h b/include/deal.II/fe/mapping_q_internal.h index cf155f2df9..f714099256 100644 --- a/include/deal.II/fe/mapping_q_internal.h +++ b/include/deal.II/fe/mapping_q_internal.h @@ -1881,7 +1881,7 @@ namespace internal GeometryInfo::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) diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index 1db0f55cba..40f35af3f1 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -239,7 +239,7 @@ MappingQGeneric::InternalData::initialize_face( update_JxW_values | update_inverse_jacobians)) { aux.resize(dim - 1, - std::vector>(n_original_q_points)); + AlignedVector>(n_original_q_points)); // Compute tangentials to the unit cell. for (const unsigned int i : GeometryInfo::face_indices())