]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add slight performance enhancement.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Apr 1998 09:06:31 +0000 (09:06 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 6 Apr 1998 09:06:31 +0000 (09:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@143 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe.cc

index c4907af43f7e091a890b413a0e4615a1c18ac1b8..7425da55142768393da4006547b1bffdfb9ae4cd 100644 (file)
@@ -306,18 +306,16 @@ void FiniteElement<1>::fill_fe_values (const Triangulation<1>::cell_iterator &ce
                                   // equally spaced along the line
   if (compute_ansatz_points) 
     {
-      ansatz_points.erase (ansatz_points.begin(), ansatz_points.end());
-      ansatz_points.reserve (total_dofs);
-
+      unsigned int next = 0;
                                       // first the dofs in the vertices
       for (unsigned int vertex=0; vertex<2; vertex++) 
        for (unsigned int i=0; i<dofs_per_vertex; ++i)
-         ansatz_points.push_back (cell->vertex(vertex));
+         ansatz_points[next++] = cell->vertex(vertex);
       
                                       // now dofs on line
       for (unsigned int i=0; i<dofs_per_line; ++i) 
-       ansatz_points.push_back (cell->vertex(0) +
-                                Point<1>((i+1.0)/(total_dofs+1.0)*h));
+       ansatz_points[next++] = cell->vertex(0) +
+                               Point<1>((i+1.0)/(total_dofs+1.0)*h);
     };
 };
 
@@ -330,6 +328,7 @@ void FiniteElement<1>::face_ansatz_points (const typename Triangulation<1>::face
 };
 
 
+
 bool FiniteElement<2>::operator == (const FiniteElement<2> &f) const {
   return ((dofs_per_vertex == f.dofs_per_vertex) &&
          (dofs_per_line == f.dofs_per_line) &&

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.