From: bangerth Date: Tue, 29 Oct 2013 02:23:35 +0000 (+0000) Subject: We know how many elements we need. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beb467c705c155dcf28ffc1da8f18044e86fbf5c;p=dealii-svn.git We know how many elements we need. git-svn-id: https://svn.dealii.org/trunk@31477 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/grid/tria_objects.cc b/deal.II/source/grid/tria_objects.cc index d73503bac4..308f55033c 100644 --- a/deal.II/source/grid/tria_objects.cc +++ b/deal.II/source/grid/tria_objects.cc @@ -265,7 +265,14 @@ namespace internal 4*new_size-children.size(), -1); + // for the following two fields, we know exactly how many elements + // we need, so first reserve then resize (resize itself, at least + // with some compiler libraries, appears to round up the size it + // actually reserves) + boundary_or_material_id.reserve (new_size); boundary_or_material_id.resize (new_size); + + user_data.reserve (new_size); user_data.resize (new_size); face_orientations.reserve (new_size * GeometryInfo<3>::faces_per_cell);