From: bangerth Date: Wed, 17 Oct 2007 19:45:08 +0000 (+0000) Subject: Use a more interesting geometry. Precondition the DGQ0 mass matrix, which while diago... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ac9036043c90466989bba05f569f3c7076f7dc9;p=dealii-svn.git Use a more interesting geometry. Precondition the DGQ0 mass matrix, which while diagonal, still needs a number of CG iterations on non-uniform meshes. git-svn-id: https://svn.dealii.org/trunk@15340 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-22/step-22.cc b/deal.II/examples/step-22/step-22.cc index 43690c31e7..c08c0d5f14 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -163,7 +164,7 @@ InitialValues::value (const Point &p, const unsigned int component) const { if (component == dim+1) - return (p.distance (Point(.25,.5)) < .1 ? 1 : 0); + return (p.distance (Point(.05,-.95)) < .05 ? 1 : 0); else return 0; } @@ -378,7 +379,11 @@ BoussinesqFlowProblem::BoussinesqFlowProblem (const unsigned int degree) template void BoussinesqFlowProblem::make_grid_and_dofs () { - GridGenerator::hyper_cube (triangulation, 0, 1); + GridGenerator::half_hyper_shell (triangulation, Point(), 0.5, 1.0); + + static HalfHyperShellBoundary boundary; + triangulation.set_boundary (0, boundary); + triangulation.refine_global (n_refinement_steps); dof_handler.distribute_dofs (fe); @@ -792,11 +797,13 @@ void BoussinesqFlowProblem::solve () SolverControl solver_control (system_matrix.block(2,2).m(), 1e-8*system_rhs.block(2).l2_norm()); SolverCG<> cg (solver_control); - + PreconditionJacobi<> preconditioner; + preconditioner.initialize (system_matrix.block(2,2)); + try { cg.solve (system_matrix.block(2,2), solution.block(2), system_rhs.block(2), - PreconditionIdentity()); + preconditioner); } catch (...) { @@ -929,7 +936,7 @@ void BoussinesqFlowProblem::run () std::cout << std::endl; } - while (time <= 10); + while (time <= 40); }