From: bangerth Date: Wed, 17 Oct 2007 14:29:29 +0000 (+0000) Subject: Make code much faster by using less accuracy and better preconditioners. Remove some... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cb027ca2e99842e1a34441f1bd6ceeeaf2b334f;p=dealii-svn.git Make code much faster by using less accuracy and better preconditioners. Remove some debug output git-svn-id: https://svn.dealii.org/trunk@15334 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 e91b4df38d..0d54c6b23e 100644 --- a/deal.II/examples/step-22/step-22.cc +++ b/deal.II/examples/step-22/step-22.cc @@ -294,15 +294,17 @@ void InverseMatrix::vmult (Vector &dst, SolverControl solver_control (src.size(), 1e-8*src.l2_norm()); SolverCG<> cg (solver_control, vector_memory); + PreconditionJacobi<> preconditioner; + preconditioner.initialize (*matrix); + dst = 0; try { - cg.solve (*matrix, dst, src, PreconditionIdentity()); + cg.solve (*matrix, dst, src, preconditioner); } catch (...) { - std::cout << "ups 1..." << std::endl; Assert (false, ExcInternalError()); } } @@ -356,7 +358,7 @@ BoussinesqFlowProblem::BoussinesqFlowProblem (const unsigned int degree) FE_Q(degree), 1, FE_Q(degree), 1), dof_handler (triangulation), - n_refinement_steps (6), + n_refinement_steps (4), time_step (0) {} @@ -446,7 +448,7 @@ scalar_product (const Tensor<2,dim> &a, template void BoussinesqFlowProblem::assemble_system () -{ +{ system_matrix=0; system_rhs=0; @@ -729,7 +731,7 @@ void BoussinesqFlowProblem::solve () schur_complement (system_matrix, A_inverse); SolverControl solver_control (system_matrix.block(0,0).m(), - 1e-12*schur_rhs.l2_norm()); + 1e-8*schur_rhs.l2_norm()); SolverCG<> cg (solver_control); try @@ -739,7 +741,6 @@ void BoussinesqFlowProblem::solve () } catch (...) { - std::cout << "ups 2..." << std::endl; abort (); } @@ -775,7 +776,6 @@ void BoussinesqFlowProblem::solve () } catch (...) { - std::cout << "ups 3..." << std::endl; abort (); }