]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Small changes and speed improvement.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 May 1999 14:04:36 +0000 (14:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 May 1999 14:04:36 +0000 (14:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@1350 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/data_io.cc

index 301c56e5802e01dd82fa17f525cea1a819e67c4e..fb7d5a2b96989eef67840bcda5670623d6523bbb 100644 (file)
@@ -1134,7 +1134,7 @@ void DataOut<2>::write_eps (ostream &out, const EpsOutputData &eod) const {
                                    // Make output values local by
                                    // copying them to a multiset.
                                    // Perform the necessary turn.
-   DoFHandler<2>::active_cell_iterator endc = dofs->end();
+   const DoFHandler<2>::active_cell_iterator endc = dofs->end();
    multiset<DataOut<2>::EpsCellData> cells;
    multiset<DataOut<2>::EpsCellData> cells2;
    
@@ -1248,9 +1248,18 @@ void DataOut<2>::write_eps (ostream &out, const EpsOutputData &eod) const {
 
           cells2.insert(cd);
         };
+
+                                       // since we don't need #cells# any
+                                       // more, delete it now
+       cells.clear ();
      }
-   else
-     cells2=cells;
+   else 
+                                     // copy #cells# to #cells2#. since
+                                     // we don't need #cells# any
+                                     // more, we use a trick for copying
+                                     // that is significantly faster
+     cells2.swap (cells);
+   
 
 
                                    // Next we have to shift and scale
@@ -1263,8 +1272,6 @@ void DataOut<2>::write_eps (ostream &out, const EpsOutputData &eod) const {
 
    const double scale = 300 / (xmax-xmin > ymax-ymin ? xmax-xmin : ymax-ymin);
    
-   cells.clear();
-
    for (typename multiset<DataOut<2>::EpsCellData>::iterator c=cells2.begin();
        c!=cells2.end(); ++c)
      {

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.