Driver code for 2D Poisson problem.
318 MPI_Helpers::init(argc,argv);
327 Teuchos::ParameterList ml_parameters;
328 ML_Epetra::SetDefaults(
"SA", ml_parameters);
330 std::cout <<
"hello" << std::endl;
360 cout <<
"==================================="
361 <<
"=================================" << endl;
362 cout <<
"Testing Trilinos solver preconditioned with "
363 <<
"TrilinosMLPreconditioner" << endl;
364 cout <<
"======================================="
365 <<
"=============================" << endl;
377 problem.linear_solver_pt() = linear_solver_pt;
382 for (
unsigned s=0;
s<=2;
s++)
388 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::CG;
389 cout <<
"Using CG as solver" << endl;
390 cout <<
"==================" << endl;
393 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::GMRES;
394 cout <<
"Using GMRES as solver" << endl;
395 cout <<
"=====================" << endl;
398 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::BiCGStab;
399 cout <<
"Using BiCGStab as solver" << endl;
400 cout <<
"========================" << endl;
402 default: cout <<
"Error selecting solver" << endl;
409 problem.doc_solution(doc_info);
411 oomph_info <<
"Number of linear solver iterations: "
413 linear_solver_pt)->iterations() << std::endl << std::endl;
414 conv_file <<
"Number of linear solver iterations: "
416 linear_solver_pt)->iterations() << std::endl;
421 delete linear_solver_pt;
422 delete preconditioner_pt;
431 cout <<
"================================="
432 <<
"=======================================" << endl;
433 cout <<
"Testing Trilinos solver preconditioned"
434 <<
" with TrilinosIFPACKPreconditioner" << endl;
435 cout <<
"==========================================="
436 <<
"=============================" << endl;
449 problem.linear_solver_pt() = linear_solver_pt;
454 for (
unsigned s=0;
s<=2;
s++)
460 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::CG;
461 cout <<
"Using CG as solver" << endl;
462 cout <<
"==================" << endl;
465 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::GMRES;
466 cout <<
"Using GMRES as solver" << endl;
467 cout <<
"=====================" << endl;
470 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::BiCGStab;
471 cout <<
"Using BiCGStab as solver" << endl;
472 cout <<
"========================" << endl;
474 default: cout <<
"Error selecting solver" << endl;
481 problem.doc_solution(doc_info);
483 oomph_info <<
"Number of linear solver iterations: "
485 linear_solver_pt)->iterations() << std::endl << std::endl;
486 conv_file <<
"Number of linear solver iterations: "
488 linear_solver_pt)->iterations() << std::endl;
493 delete linear_solver_pt;
494 delete preconditioner_pt;
505 <<
"======================================"
506 <<
"=================================="
509 <<
"Testing oomph-lib iterative linear solvers "
510 <<
"with Trilinos preconditioners"
513 <<
"======================================="
514 <<
"================================="
515 << endl << endl << endl;
523 for (
unsigned i_prec=0;i_prec<2;i_prec++)
533 cout <<
"Using TrilinosIFPACKPreconditioner as preconditioner" << endl;
534 cout <<
"=====================================================" << endl;
540 cout <<
"Using TrilinosMLPreconditioner as preconditioner" << endl;
541 cout <<
"=================================================" << endl;
547 cout <<
"CG iterative solver" << endl;
548 cout <<
"-------------------" << endl;
551 problem.linear_solver_pt() = linear_solver_pt;
555 preconditioner_pt()= preconditioner_pt;
562 problem.doc_solution(doc_info);
564 oomph_info <<
"Number of linear solver iterations: "
566 linear_solver_pt)->iterations() << std::endl << std::endl;
567 conv_file <<
"Number of linear solver iterations: "
569 linear_solver_pt)->iterations() << std::endl;
571 delete linear_solver_pt;
576 cout <<
"BiCGStab iterative solver" << endl;
577 cout <<
"-------------------------" << endl;
580 problem.linear_solver_pt() = linear_solver_pt;
590 problem.doc_solution(doc_info);
592 oomph_info <<
"Number of linear solver iterations: "
594 linear_solver_pt)->iterations() << std::endl << std::endl;
595 conv_file <<
"Number of linear solver iterations: "
597 linear_solver_pt)->iterations() << std::endl;
599 delete linear_solver_pt;
604 cout <<
"GMRES iterative solver" << endl;
605 cout <<
"----------------------" << endl;
608 problem.linear_solver_pt() = linear_solver_pt;
618 problem.doc_solution(doc_info);
620 oomph_info <<
"Number of linear solver iterations: "
622 linear_solver_pt)->iterations() << std::endl << std::endl;
623 conv_file <<
"Number of linear solver iterations: "
625 linear_solver_pt)->iterations() << std::endl;
627 delete linear_solver_pt;
630 delete preconditioner_pt;
640 cout <<
"=================================="
641 <<
"=======================================" << endl;
642 cout <<
"Testing Trilinos solver preconditioned with"
643 <<
" MatrixBasedDiagPreconditioner" << endl;
644 cout <<
"======================================="
645 <<
"==================================" << endl;
658 problem.linear_solver_pt() = linear_solver_pt;
663 for (
unsigned s=0;
s<=2;
s++)
669 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::CG;
670 cout <<
"Using CG as solver" << endl;
671 cout <<
"==================" << endl;
674 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::GMRES;
675 cout <<
"Using GMRES as solver" << endl;
676 cout <<
"=====================" << endl;
679 linear_solver_pt->
solver_type() = TrilinosAztecOOSolver::BiCGStab;
680 cout <<
"Using BiCGStab as solver" << endl;
681 cout <<
"========================" << endl;
683 default: cout <<
"Error selecting solver" << endl;
690 problem.doc_solution(doc_info);
692 oomph_info <<
"Number of linear solver iterations: "
694 linear_solver_pt)->iterations() << std::endl << std::endl;
695 conv_file <<
"Number of linear solver iterations: "
697 linear_solver_pt)->iterations() << std::endl;
702 delete linear_solver_pt;
705 delete preconditioner_pt;
712 bool never_get_here=
true;
726 MPI_Helpers::finalize();
Micky mouse Poisson problem.
Definition: HypreSolver_test.cc:81
The conjugate gradient method.
Definition: iterative_linear_solver.h:410
The conjugate gradient method.
Definition: iterative_linear_solver.h:284
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
The GMRES method.
Definition: iterative_linear_solver.h:1227
Definition: iterative_linear_solver.h:54
Preconditioner *& preconditioner_pt()
Access function to preconditioner.
Definition: iterative_linear_solver.h:95
Definition: linear_solver.h:68
void enable_doc_time()
Enable documentation of solve times.
Definition: linear_solver.h:110
Matrix-based diagonal preconditioner.
Definition: general_purpose_preconditioners.h:49
Definition: preconditioner.h:54
Definition: trilinos_solver.h:267
unsigned & solver_type()
Access function to Solver_type.
Definition: trilinos_solver.h:442
Definition: trilinos_preconditioners.h:268
Definition: trilinos_preconditioners.h:152
RealScalar s
Definition: level1_cplx_impl.h:130
string filename
Definition: MergeRestartFiles.py:39
double TanPhi
Parameter for angle Phi of "step".
Definition: HypreSolver_test.cc:51
void source_function(const Vector< double > &x, double &source)
Source function required to make the solution above an exact solution.
Definition: HypreSolver_test.cc:60
double Alpha
Parameter for steepness of step.
Definition: extrude_with_macro_element_representation.cc:185
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213