From be9d3e78650f3bf7a9d4dba627cffad68271852d Mon Sep 17 00:00:00 2001 From: hartmann Date: Mon, 22 Aug 2005 12:34:22 +0000 Subject: [PATCH] Make it compile with gcc2.95.3 git-svn-id: https://svn.dealii.org/trunk@11302 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-18/step-18.cc | 89 +++++++++++++++-------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index e41e7e29b0..ae5827a93e 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -1880,57 +1880,58 @@ namespace QuasiStaticElasticity // elegant way -- and then, these example // programs also serve the purpose of // introducing what is available in - // deal.II. + // deal.II. + template + class FilteredDataOut : public DataOut + { + public: + FilteredDataOut (const unsigned int subdomain_id) + : + subdomain_id (subdomain_id) + {} + + virtual typename DoFHandler::cell_iterator + first_cell () + { + typename DoFHandler::active_cell_iterator + cell = this->dofs->begin_active(); + while ((cell != this->dofs->end()) && + (cell->subdomain_id() != subdomain_id)) + ++cell; + + return cell; + } + + virtual typename DoFHandler::cell_iterator + next_cell (const typename DoFHandler::cell_iterator &old_cell) + { + if (old_cell != this->dofs->end()) + { + const IteratorFilters::SubdomainEqualTo + predicate(subdomain_id); + + return + ++(FilteredIterator + ::active_cell_iterator> + (predicate,old_cell)); + } + else + return old_cell; + } + + private: + const unsigned int subdomain_id; + }; + template void TopLevel::output_results () const { - class FilteredDataOut : public DataOut - { - public: - FilteredDataOut (const unsigned int subdomain_id) - : - subdomain_id (subdomain_id) - {} - - virtual typename DoFHandler::cell_iterator - first_cell () - { - typename DoFHandler::active_cell_iterator - cell = this->dofs->begin_active(); - while ((cell != this->dofs->end()) && - (cell->subdomain_id() != subdomain_id)) - ++cell; - - return cell; - } - - virtual typename DoFHandler::cell_iterator - next_cell (const typename DoFHandler::cell_iterator &old_cell) - { - if (old_cell != this->dofs->end()) - { - const IteratorFilters::SubdomainEqualTo - predicate(subdomain_id); - - return - ++(FilteredIterator - ::active_cell_iterator> - (predicate,old_cell)); - } - else - return old_cell; - } - - private: - const unsigned int subdomain_id; - }; - // With this newly defined class, declare // an object that is going to generate // the graphical output and attach the // dof handler with it from which to get // the solution vector: - FilteredDataOut data_out(this_mpi_process); + FilteredDataOut data_out(this_mpi_process); data_out.attach_dof_handler (dof_handler); // Then, just as in step-17, define the @@ -2074,7 +2075,7 @@ namespace QuasiStaticElasticity std::ostringstream filename; filename << "solution-"; filename << std::setfill('0'); - filename.setf(std::ios_base::fixed, std::ios_base::floatfield); + filename.setf(std::ios::fixed, std::ios::floatfield); filename << std::setw(9) << std::setprecision(4) << present_time; // Next, in case there are -- 2.39.5