From: Matthias Maier Date: Thu, 31 Aug 2017 22:19:50 +0000 (-0500) Subject: Avoid memory reallocation X-Git-Tag: v9.0.0-rc1~1131^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ad8b0ae4bcb5679d9c5a05774a279a3d0ef25ae;p=dealii.git Avoid memory reallocation --- diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index ac85dbb881..5412942c81 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -2261,6 +2261,9 @@ convert_generalized_support_point_values_to_dof_values (const std::vectorget_generalized_support_points().size()); AssertDimension(dof_values.size(), this->dofs_per_cell); + std::vector base_dof_values; + std::vector > base_point_values; + // loop over all base elements (respecting multiplicity) and let them do // the work on their share of the input argument @@ -2277,8 +2280,8 @@ convert_generalized_support_point_values_to_dof_values (const std::vector base_dof_values(n_base_dofs); - std::vector > base_point_values(n_base_points); + base_dof_values.resize(n_base_dofs); + base_point_values.resize(n_base_points); for (unsigned int m = 0; m < multiplicity; ++m, current_vector_component += n_base_components)