From: Peter Munch Date: Sat, 5 Sep 2020 19:02:32 +0000 (+0200) Subject: Replace C-style arrays in MatrixFree X-Git-Tag: v9.3.0-rc1~1129^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4e488aede40eb29aa190f2ff6eeb9a8ce6cfa30;p=dealii.git Replace C-style arrays in MatrixFree --- diff --git a/include/deal.II/matrix_free/dof_info.h b/include/deal.II/matrix_free/dof_info.h index cef97730b9..36002f9a90 100644 --- a/include/deal.II/matrix_free/dof_info.h +++ b/include/deal.II/matrix_free/dof_info.h @@ -433,7 +433,7 @@ namespace internal * as interior (0), the faces decorated with as exterior (1), and the * cells (2) according to CellOrFaceAccess. */ - std::vector index_storage_variants[3]; + std::array, 3> index_storage_variants; /** * Stores the rowstart indices of the compressed row storage in the @p @@ -485,7 +485,7 @@ namespace internal * as interior (0), the faces decorated with as exterior (1), and the * cells (2) according to CellOrFaceAccess. */ - std::vector dof_indices_contiguous[3]; + std::array, 3> dof_indices_contiguous; /** * Compressed index storage for faster access than through @p @@ -495,7 +495,7 @@ namespace internal * as minus (0), the faces decorated with as plus (1), and the cells * (2). */ - std::vector dof_indices_interleave_strides[3]; + std::array, 3> dof_indices_interleave_strides; /** * Caches the number of indices filled when vectorizing. This @@ -506,7 +506,7 @@ namespace internal * as interior (0), the faces decorated with as exterior (1), and the * cells (2) according to CellOrFaceAccess. */ - std::vector n_vectorization_lanes_filled[3]; + std::array, 3> n_vectorization_lanes_filled; /** * This stores the parallel partitioning that can be used to set up diff --git a/include/deal.II/matrix_free/dof_info.templates.h b/include/deal.II/matrix_free/dof_info.templates.h index 75761d73db..f8d115f6d8 100644 --- a/include/deal.II/matrix_free/dof_info.templates.h +++ b/include/deal.II/matrix_free/dof_info.templates.h @@ -1066,7 +1066,8 @@ namespace internal for (unsigned int face = 0; face < faces.size(); ++face) { auto face_computation = [&](const DoFAccessIndex face_index, - const unsigned int * cell_indices_face) { + const std::array + &cell_indices_face) { bool is_contiguous = false; bool is_interleaved = false; bool needs_full_storage = false; diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index 1c9121b847..0ffed89590 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -1784,14 +1784,14 @@ namespace internal private: template static void - interpolate_generic(const Number * input, - Number * output, - const bool do_gradients, - const unsigned int face_no, - const unsigned int n_points_1d, - const AlignedVector *shape_data, - const unsigned int dofs_per_component_on_cell, - const unsigned int dofs_per_component_on_face) + interpolate_generic(const Number * input, + Number * output, + const bool do_gradients, + const unsigned int face_no, + const unsigned int n_points_1d, + const std::array, 2> &shape_data, + const unsigned int dofs_per_component_on_cell, + const unsigned int dofs_per_component_on_face) { if (face_direction == face_no / 2) { diff --git a/include/deal.II/matrix_free/face_info.h b/include/deal.II/matrix_free/face_info.h index 43d8d820e8..b411c27d7e 100644 --- a/include/deal.II/matrix_free/face_info.h +++ b/include/deal.II/matrix_free/face_info.h @@ -58,7 +58,7 @@ namespace internal * numbers of the cells on the logical "interior" side of the face which * is aligned to the direction of FEEvaluation::get_normal_vector(). */ - unsigned int cells_interior[vectorization_width]; + std::array cells_interior; /** * Indices of the faces in the current face batch as compared to the @@ -73,7 +73,7 @@ namespace internal * For boundary faces, the numbers are set to * `numbers::invalid_unsigned_int`. */ - unsigned int cells_exterior[vectorization_width]; + std::array cells_exterior; /** * Index of the face between 0 and GeometryInfo::faces_per_cell within diff --git a/include/deal.II/matrix_free/mapping_info.h b/include/deal.II/matrix_free/mapping_info.h index 4d7c9f64c5..b2ba970de7 100644 --- a/include/deal.II/matrix_free/mapping_info.h +++ b/include/deal.II/matrix_free/mapping_info.h @@ -220,7 +220,8 @@ namespace internal * but the default case (cell integrals or boundary integrals) only * fills the zeroth component and ignores the first one. */ - AlignedVector> jacobians[2]; + std::array>, 2> + jacobians; /** * The storage of the gradients of the inverse Jacobian @@ -237,10 +238,12 @@ namespace internal * but the default case (cell integrals or boundary integrals) only * fills the zeroth component and ignores the first one. */ - AlignedVector>> - jacobian_gradients[2]; + std::array< + AlignedVector>>, + 2> + jacobian_gradients; /** * Stores the Jacobian transformations times the normal vector (this @@ -249,8 +252,8 @@ namespace internal * * Indexed by @p data_index_offsets. */ - AlignedVector> - normals_times_jacobians[2]; + std::array>, 2> + normals_times_jacobians; /** * Stores the index offset of a particular cell into the quadrature diff --git a/include/deal.II/matrix_free/shape_info.h b/include/deal.II/matrix_free/shape_info.h index b30412de08..0637a5e775 100644 --- a/include/deal.II/matrix_free/shape_info.h +++ b/include/deal.II/matrix_free/shape_info.h @@ -227,7 +227,7 @@ namespace internal * (the vertices) in one data structure. Sorting is first the values, * then gradients, then second derivatives. */ - AlignedVector shape_data_on_face[2]; + std::array, 2> shape_data_on_face; /** * Collects all data of 1D nodal shape values (defined by the Lagrange @@ -239,25 +239,25 @@ namespace internal * * @note In contrast to shape_data_on_face, only the vales are evaluated. */ - AlignedVector quadrature_data_on_face[2]; + std::array, 2> quadrature_data_on_face; /** * Stores one-dimensional values of shape functions on subface. Since * there are two subfaces, store two variants. */ - AlignedVector values_within_subface[2]; + std::array, 2> values_within_subface; /** * Stores one-dimensional gradients of shape functions on subface. Since * there are two subfaces, store two variants. */ - AlignedVector gradients_within_subface[2]; + std::array, 2> gradients_within_subface; /** * Stores one-dimensional gradients of shape functions on subface. Since * there are two subfaces, store two variants. */ - AlignedVector hessians_within_subface[2]; + std::array, 2> hessians_within_subface; /** * We store a copy of the one-dimensional quadrature formula