From: wolf Date: Mon, 24 May 1999 14:04:36 +0000 (+0000) Subject: Small changes and speed improvement. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae36806379d6f62c7d4217315e1e17c7f284e3a;p=dealii-svn.git Small changes and speed improvement. git-svn-id: https://svn.dealii.org/trunk@1350 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index 301c56e580..fb7d5a2b96 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -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::EpsCellData> cells; multiset::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::EpsCellData>::iterator c=cells2.begin(); c!=cells2.end(); ++c) {