From dec855efb92e700520f9dc51e36fea43289de765 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 5 Feb 2010 17:51:15 +0000 Subject: [PATCH] Minor adjustments. git-svn-id: https://svn.dealii.org/trunk@20515 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-16/step-16.cc | 57 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/deal.II/examples/step-16/step-16.cc b/deal.II/examples/step-16/step-16.cc index 2b562d310e..13da73cfc8 100644 --- a/deal.II/examples/step-16/step-16.cc +++ b/deal.II/examples/step-16/step-16.cc @@ -41,7 +41,7 @@ #include #include -//These are the same include files +//These are the same include files //as in step-16 necessary for the //multi-level methods #include @@ -62,12 +62,12 @@ using namespace dealii; -//This class is basically the same -//class as in step-16. The only -//difference is that here we solve Laplace's +//This class is basically the same +//class as in step-16. The only +//difference is that here we solve Laplace's //problem on an adaptively refined grid. template -class LaplaceProblem +class LaplaceProblem { public: LaplaceProblem (const unsigned int deg); @@ -90,14 +90,14 @@ class LaplaceProblem SparseMatrix system_matrix; //This object holds the information f - //or the hanging nodes. + //or the hanging nodes. ConstraintMatrix constraints; MGLevelObject mg_sparsity; MGLevelObject > mg_matrices; - /* The matrices at the interface - * between two refinement levels, + /* The matrices at the interface + * between two refinement levels, * coupling coarse to fine.*/ MGLevelObject > mg_interface_matrices_up; @@ -109,7 +109,8 @@ class LaplaceProblem template -LaplaceProblem::LaplaceProblem (const unsigned int deg) : +LaplaceProblem::LaplaceProblem (const unsigned int deg) + : triangulation (Triangulation::limit_level_difference_at_vertices), fe (deg), mg_dof_handler (triangulation), @@ -198,8 +199,8 @@ void LaplaceProblem::setup_system () } } -//And the same for the mg matrices -//for the interface. Note that there +//And the same for the mg matrices +//for the interface. Note that there //is no such interface on the coarsest level for(unsigned int level=0; level::setup_system () // for the Poisson equation you have seen a // lot of times before. template -void LaplaceProblem::assemble_system () -{ +void LaplaceProblem::assemble_system () +{ QGauss quadrature_formula(1+degree); - FEValues fe_values (fe, quadrature_formula, + FEValues fe_values (fe, quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); @@ -263,20 +264,20 @@ void LaplaceProblem::assemble_system () // the same as above. Only the loop // goes over all existing cells now // and the results must be entered - // into the correct matrix. Here comes - // the difference to global refinement - // into play. We have to fill the interface + // into the correct matrix. Here comes + // the difference to global refinement + // into play. We have to fill the interface // matrices correctly. // Since we only do multi-level // preconditioning, no right-hand // side is assembled here. template -void LaplaceProblem::assemble_multigrid () -{ +void LaplaceProblem::assemble_multigrid () +{ QGauss quadrature_formula(1+degree); - FEValues fe_values (fe, quadrature_formula, + FEValues fe_values (fe, quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); @@ -319,7 +320,7 @@ void LaplaceProblem::assemble_multigrid () .add_lines (boundary_interface_dofs[level]); boundary_interface_constraints[level].close (); } - + typename MGDoFHandler::cell_iterator cell = mg_dof_handler.begin(), endc = mg_dof_handler.end(); @@ -359,10 +360,10 @@ void LaplaceProblem::assemble_multigrid () .distribute_local_to_global (cell_matrix, local_dof_indices, mg_matrices[level]); - + for (unsigned int i=0; i::assemble_multigrid () } template -void LaplaceProblem::solve () +void LaplaceProblem::solve () { // Create a memory handler for // regular vectors. Note, that @@ -564,7 +565,7 @@ void LaplaceProblem::refine_local () } } } - else //erster Quadrant + else //erster Quadrant { const Point p = cell->center(); bool positive = p(0) > 0; @@ -609,7 +610,7 @@ void LaplaceProblem::output_results (const unsigned int cycle) const } template -void LaplaceProblem::run () +void LaplaceProblem::run () { for (unsigned int cycle=0; cycle<9; ++cycle) { @@ -635,7 +636,7 @@ void LaplaceProblem::run () -int main () +int main () { try { @@ -657,7 +658,7 @@ int main () return 1; } - catch (...) + catch (...) { std::cerr << std::endl << std::endl << "----------------------------------------------------" -- 2.39.5