36 #include <lifev/navier_stokes/solver/NavierStokesSolver/SolverPolicyLinearSolver.hpp> 39 #include <lifev/core/util/LifeChrono.hpp> 48 std::string resourcesPath = list.get (
"Resources path",
"./Resources" );
49 resourcesPath.append (
"/");
50 const std::string solverParamFile = list.get (
"Parameters file",
"SolverParamList.xml" );
51 Teuchos::RCP< Teuchos::ParameterList > solverParameters = Teuchos::rcp (
new Teuchos::ParameterList );
52 solverParameters = Teuchos::getParametersFromXmlFile ( resourcesPath + solverParamFile );
55 displayer().leaderPrint (
"\n[Solver initialization]\n" );
56 M_solver.reset (
new solver_Type );
57 M_solver->setCommunicator ( comm() );
59 displayer().leaderPrint (
"Setting up the solver... " );
60 M_solver->setParameters ( *solverParameters );
65 SolverPolicyLinearSolver::setPreconditioner ( preconditionerPtr_Type preconditionerPtr )
67 M_solver->setPreconditioner ( preconditionerPtr );
70 SolverPolicyLinearSolver::preconditionerPtr_Type
71 SolverPolicyLinearSolver::preconditioner()
73 return M_solver->preconditioner();
78 SolverPolicyLinearSolver::solve ( matrixPtr_Type systemMatrix,
80 vectorPtr_Type solution )
82 M_solver->setOperator ( systemMatrix );
83 M_solver->setRightHandSide ( rhs );
84 return M_solver->solve ( solution );
void initSolver(Teuchos::ParameterList &list)