]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
We know how many elements we need.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 29 Oct 2013 02:23:35 +0000 (02:23 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 29 Oct 2013 02:23:35 +0000 (02:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@31477 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/grid/tria_objects.cc

index d73503bac4b487910a3cae821b30ee01c83c8312..308f55033c1e63e193850c9de852d2c2a2798975 100644 (file)
@@ -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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.