From 0feab4d0d7ce53f893893265a001ec441ddab4c1 Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 2 Jan 2025 10:39:34 -0500 Subject: [PATCH] MappingManifold: use std::array. This is a holdover from long ago when we required std::vector instead of ArrayView arguments to various Manifold functions. --- include/deal.II/fe/mapping_manifold.h | 16 +++++++--------- source/fe/mapping_manifold.cc | 12 +----------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/include/deal.II/fe/mapping_manifold.h b/include/deal.II/fe/mapping_manifold.h index 3253309b5a..97ee33bb6c 100644 --- a/include/deal.II/fe/mapping_manifold.h +++ b/include/deal.II/fe/mapping_manifold.h @@ -208,7 +208,8 @@ public: * * Computed each. */ - mutable std::vector> vertices; + mutable std::array, GeometryInfo::vertices_per_cell> + vertices; /** * The current cell. @@ -242,23 +243,20 @@ public: * * Computed once. */ - std::vector> cell_manifold_quadrature_weights; + std::vector::vertices_per_cell>> + cell_manifold_quadrature_weights; /** - * A vector of weights for use in Manifold::get_new_point(). For + * An array of weights for use in Manifold::get_new_point(). For * each point (interior to a cell), we compute the weight each * vertex has for this point. If the point lies at a vertex, then * this vertex has weight one and all others have weight zero. If * the point lies interior to a cell, then the weight every vertex * has is just the $d$-linear shape functions associated with each * vertex evaluated at that point. - * - * This array has size GeometryInfo::vertices_per_cell, but it - * can't be converted into a fixed size array because it is used - * as input for Manifold::get_new_point() which wants to see a - * std::vector for the weights. */ - mutable std::vector vertex_weights; + mutable std::array::vertices_per_cell> + vertex_weights; /** * Unit tangential vectors. Used for the computation of boundary forms and diff --git a/source/fe/mapping_manifold.cc b/source/fe/mapping_manifold.cc index 551b83b87d..b291507932 100644 --- a/source/fe/mapping_manifold.cc +++ b/source/fe/mapping_manifold.cc @@ -79,9 +79,6 @@ MappingManifold::InternalData::reinit( // Store the quadrature this->quad.initialize(q.get_points(), q.get_weights()); - // Resize the weights - this->vertex_weights.resize(GeometryInfo::vertices_per_cell); - // see if we need the (transformation) shape function values // and/or gradients and resize the necessary arrays if (this->update_each & @@ -157,7 +154,6 @@ void MappingManifold::InternalData::store_vertices( const typename Triangulation::cell_iterator &cell) const { - vertices.resize(GeometryInfo::vertices_per_cell); for (const unsigned int i : GeometryInfo::vertex_indices()) vertices[i] = cell->vertex(i); this->cell = cell; @@ -170,8 +166,7 @@ void MappingManifold::InternalData:: compute_manifold_quadrature_weights(const Quadrature &quad) { - cell_manifold_quadrature_weights.resize( - quad.size(), std::vector(GeometryInfo::vertices_per_cell)); + cell_manifold_quadrature_weights.resize(quad.size()); for (unsigned int q = 0; q < quad.size(); ++q) { for (const unsigned int i : GeometryInfo::vertex_indices()) @@ -384,9 +379,6 @@ namespace internal { const UpdateFlags update_flags = data.update_each; - AssertDimension(data.vertices.size(), - GeometryInfo::vertices_per_cell); - if (update_flags & update_quadrature_points) { for (unsigned int point = 0; point < quadrature_points.size(); @@ -425,8 +417,6 @@ namespace internal data.contravariant.end(), DerivativeForm<1, dim, spacedim>()); - AssertDimension(GeometryInfo::vertices_per_cell, - data.vertices.size()); for (unsigned int point = 0; point < n_q_points; ++point) { // Start by figuring out how to compute the direction in -- 2.39.5