From 9e78b3b8f6252cb43b7942b87272ffc2208dfd0f Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 15 Feb 2010 20:57:55 +0000 Subject: [PATCH] apply changes in library interface git-svn-id: https://svn.dealii.org/trunk@20639 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-38/step-38.cc | 28 ++++++++++++++-------------- deal.II/examples/step-39/step-39.cc | 28 ++++++++++++++++------------ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index eb030711a7..43411b0cc6 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -360,7 +360,8 @@ void Step12::assemble_system () // this is a handy shortcut. It // receives all the stuff we // created so far. - MeshWorker::IntegrationInfoBox info_box(dof_handler); + MeshWorker::IntegrationInfoBox info_box; + MeshWorker::DoFInfo dof_info(dof_handler); info_box.initialize(integration_worker, fe, mapping); // Finally, the integration loop @@ -386,9 +387,9 @@ void Step12::assemble_system () // result of std::bind if the local // integrators were, for example, // non-static member functions. - MeshWorker::integration_loop + MeshWorker::loop, MeshWorker::IntegrationInfoBox > (dof_handler.begin_active(), dof_handler.end(), - info_box, + dof_info, info_box, &Step12::integrate_cell_term, &Step12::integrate_boundary_term, &Step12::integrate_face_term, @@ -627,7 +628,7 @@ void Step12::integrate_face_term (DoFInfo& dinfo1, DoFInfo& dinfo2, template void Step12::solve (Vector &solution) { - SolverControl solver_control (1000, 1e-12, false, false); + SolverControl solver_control (1000, 1e-12); SolverRichardson<> solver (solver_control); // Here we create the @@ -736,7 +737,7 @@ void Step12::output_results (const unsigned int cycle) const Assert (cycle < 10, ExcInternalError()); filename += ".eps"; - std::cout << "Writing grid to <" << filename << ">..." << std::endl; + deallog << "Writing grid to <" << filename << ">" << std::endl; std::ofstream eps_output (filename.c_str()); GridOut grid_out; @@ -749,8 +750,7 @@ void Step12::output_results (const unsigned int cycle) const Assert (cycle < 10, ExcInternalError()); filename += ".gnuplot"; - std::cout << "Writing solution to <" << filename << ">..." - << std::endl << std::endl; + deallog << "Writing solution to <" << filename << ">" << std::endl; std::ofstream gnuplot_output (filename.c_str()); DataOut data_out; @@ -770,7 +770,7 @@ void Step12::run () { for (unsigned int cycle=0; cycle<6; ++cycle) { - std::cout << "Cycle " << cycle << ':' << std::endl; + deallog << "Cycle " << cycle << std::endl; if (cycle == 0) { @@ -782,15 +782,15 @@ void Step12::run () refine_grid (); - std::cout << " Number of active cells: " - << triangulation.n_active_cells() - << std::endl; + deallog << "Number of active cells: " + << triangulation.n_active_cells() + << std::endl; setup_system (); - std::cout << " Number of degrees of freedom: " - << dof_handler.n_dofs() - << std::endl; + deallog << "Number of degrees of freedom: " + << dof_handler.n_dofs() + << std::endl; assemble_system (); solve (solution); diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index 7de4081c58..12f257628d 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -443,11 +443,12 @@ Step39::assemble_matrix() integration_worker.add_update_flags(update_flags, true, true, true, true); assembler.initialize(matrix); - MeshWorker::IntegrationInfoBox info_box(dof_handler); + MeshWorker::IntegrationInfoBox info_box; + MeshWorker::DoFInfo dof_info(dof_handler); info_box.initialize(integration_worker, fe, mapping); - MeshWorker::integration_loop( + MeshWorker::loop, MeshWorker::IntegrationInfoBox >( dof_handler.begin_active(), dof_handler.end(), - info_box, + dof_info, info_box, &MatrixIntegrator::cell, &MatrixIntegrator::bdry, &MatrixIntegrator::face, @@ -469,11 +470,12 @@ Step39::assemble_mg_matrix() assembler.initialize(mg_matrix); assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down); - MeshWorker::IntegrationInfoBox info_box(mg_dof_handler); + MeshWorker::IntegrationInfoBox info_box; + MeshWorker::DoFInfo dof_info(mg_dof_handler); info_box.initialize(integration_worker, fe, mapping); - MeshWorker::integration_loop( + MeshWorker::loop, MeshWorker::IntegrationInfoBox > ( mg_dof_handler.begin(), mg_dof_handler.end(), - info_box, + dof_info, info_box, &MatrixIntegrator::cell, &MatrixIntegrator::bdry, &MatrixIntegrator::face, @@ -497,12 +499,13 @@ Step39::assemble_right_hand_side() Vector* rhs = &right_hand_side; data.add(rhs, "RHS"); assembler.initialize(data); - MeshWorker::IntegrationInfoBox info_box(dof_handler); + MeshWorker::IntegrationInfoBox info_box; + MeshWorker::DoFInfo dof_info(dof_handler); info_box.initialize(integration_worker, fe, mapping); - MeshWorker::integration_loop( + MeshWorker::loop, MeshWorker::IntegrationInfoBox >( dof_handler.begin_active(), dof_handler.end(), - info_box, + dof_info, info_box, &RHSIntegrator::cell, &RHSIntegrator::bdry, &RHSIntegrator::face, @@ -618,11 +621,12 @@ Step39::estimate() BlockVector* est = &estimates; out_data.add(est, "cells"); assembler.initialize(out_data, false); - MeshWorker::IntegrationInfoBox info_box(dof_handler); + MeshWorker::IntegrationInfoBox info_box; + MeshWorker::DoFInfo dof_info(dof_handler); info_box.initialize(integration_worker, fe, mapping, solution_data); - MeshWorker::integration_loop ( + MeshWorker::loop, MeshWorker::IntegrationInfoBox > ( dof_handler.begin_active(), dof_handler.end(), - info_box, + dof_info, info_box, &Estimator::cell, &Estimator::bdry, &Estimator::face, -- 2.39.5