From: kanschat Date: Wed, 5 Mar 2014 14:11:32 +0000 (+0000) Subject: remove MGDoFHandler from example X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cef55623eef40c42a9ab3208ff877b3684f9c2f7;p=dealii-svn.git remove MGDoFHandler from example git-svn-id: https://svn.dealii.org/trunk@32613 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-39/step-39.cc b/deal.II/examples/step-39/step-39.cc index 18bb795f8c..6cb28107e3 100644 --- a/deal.II/examples/step-39/step-39.cc +++ b/deal.II/examples/step-39/step-39.cc @@ -38,7 +38,6 @@ #include #include #include -#include // The include files for using the MeshWorker framework #include @@ -438,8 +437,7 @@ namespace Step39 Triangulation triangulation; const MappingQ1 mapping; const FiniteElement &fe; - MGDoFHandler mg_dof_handler; - DoFHandler &dof_handler; + DoFHandler dof_handler; // Then, we have the matrices and vectors related to the global discrete // system. @@ -478,8 +476,7 @@ namespace Step39 : mapping(), fe(fe), - mg_dof_handler(triangulation), - dof_handler(mg_dof_handler), + dof_handler(triangulation), estimates(1) { GridGenerator::hyper_cube_slit(triangulation, -1, 1); @@ -495,6 +492,7 @@ namespace Step39 // First, we use the finite element to distribute degrees of freedom over // the mesh and number them. dof_handler.distribute_dofs(fe); + dof_handler.distribute_mg_dofs(fe); unsigned int n_dofs = dof_handler.n_dofs(); // Then, we already know the size of the vectors representing finite // element functions. @@ -532,8 +530,8 @@ namespace Step39 { // These are roughly the same lines as above for the global matrix, // now for each level. - CompressedSparsityPattern c_sparsity(mg_dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern(mg_dof_handler, c_sparsity, level); + CompressedSparsityPattern c_sparsity(dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level); mg_sparsity[level].copy_from(c_sparsity); mg_matrix[level].reinit(mg_sparsity[level]); @@ -544,8 +542,8 @@ namespace Step39 if (level>0) { CompressedSparsityPattern ci_sparsity; - ci_sparsity.reinit(mg_dof_handler.n_dofs(level-1), mg_dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern_edge(mg_dof_handler, ci_sparsity, level); + ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level); mg_sparsity_dg_interface[level].copy_from(ci_sparsity); mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]); mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]); @@ -617,7 +615,7 @@ namespace Step39 info_box.add_update_flags_all(update_flags); info_box.initialize(fe, mapping); - MeshWorker::DoFInfo dof_info(mg_dof_handler); + MeshWorker::DoFInfo dof_info(dof_handler); // Obviously, the assembler needs to be replaced by one filling level // matrices. Note that it automatically fills the edge matrices as well. @@ -626,12 +624,12 @@ namespace Step39 assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down); MatrixIntegrator integrator; - // Here is the other difference to the previous function: we run over all - // cells, not only the active ones. And we use mg_dof_handler, - // since we need the degrees of freedom on each level, not the global - // numbering. + // Here is the other difference to the previous function: we run + // over all cells, not only the active ones. And we use functions + // ending on _mg since we need the degrees of freedom + // on each level, not the global numbering. MeshWorker::integration_loop ( - mg_dof_handler.begin(), mg_dof_handler.end(), + dof_handler.begin_mg(), dof_handler.end_mg(), dof_info, info_box, integrator, assembler); } @@ -685,7 +683,7 @@ namespace Step39 // preconditioner. First, we need transfer between grid levels. The object // we are using here generates sparse matrices for these transfers. MGTransferPrebuilt > mg_transfer; - mg_transfer.build_matrices(mg_dof_handler); + mg_transfer.build_matrices(dof_handler); // Then, we need an exact solver for the matrix on the coarsest level. FullMatrix coarse_matrix; @@ -721,7 +719,7 @@ namespace Step39 // Now, we are ready to set up the V-cycle operator and the multilevel // preconditioner. - Multigrid > mg(mg_dof_handler, mgmatrix, + Multigrid > mg(dof_handler, mgmatrix, mg_coarse, mg_transfer, mg_smoother, mg_smoother); // Let us not forget the edge matrices needed because of the adaptive @@ -732,7 +730,7 @@ namespace Step39 // which can be used as a regular preconditioner, PreconditionMG, MGTransferPrebuilt > > - preconditioner(mg_dof_handler, mg, mg_transfer); + preconditioner(dof_handler, mg, mg_transfer); // and use it to solve the system. solver.solve(matrix, solution, right_hand_side, preconditioner); } @@ -914,7 +912,7 @@ namespace Step39 setup_system(); deallog << "DoFHandler " << dof_handler.n_dofs() << " dofs, level dofs"; for (unsigned int l=0; l