LifeV
SolverPolicyLinearSolver.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file SolverPolicyLinearSolver class
29  @brief This class contains all the informations necessary
30  to solve a linear system
31 
32  @author Gwenol Grandperrin <gwenol.grandperrin@epfl.ch>
33  @date 07-12-2012
34  */
35 
36 #ifndef SOLVERPOLICYLINEARSOLVER_HPP
37 #define SOLVERPOLICYLINEARSOLVER_HPP
38 
39 #include <iostream>
40 #include <boost/shared_ptr.hpp>
41 
42 
43 #ifdef HAVE_MPI
44 #include <Epetra_MpiComm.h>
45 #else
46 #include <Epetra_SerialComm.h>
47 #endif
48 
49 #include <Teuchos_ParameterList.hpp>
50 #include <Teuchos_XMLParameterListHelpers.hpp>
51 #include <Teuchos_RCP.hpp>
52 
53 
54 #include <lifev/core/LifeV.hpp>
55 #include <lifev/core/array/MatrixEpetra.hpp>
56 #include <lifev/core/array/VectorEpetra.hpp>
57 #include <lifev/core/util/Displayer.hpp>
58 #include <lifev/core/algorithm/LinearSolver.hpp>
59 #include <lifev/core/algorithm/Preconditioner.hpp>
60 
61 
62 namespace LifeV
63 {
64 
66 {
67 public:
78 
79  //! Method to set a preconditioner
80  /*!
81  @param preconditionerPtr Preconditioner to be used to solve the system
82  */
83  void setPreconditioner ( preconditionerPtr_Type preconditionerPtr );
84 
85  //! Method to get a preconditioner
87 
88 protected:
89  void initSolver ( Teuchos::ParameterList& list );
90 
91  int solve ( matrixPtr_Type systemMatrix,
92  vectorPtr_Type rhs,
93  vectorPtr_Type solution );
95 
96  virtual Displayer displayer() = 0;
97  virtual commPtr_Type comm() = 0;
98 };
99 
100 } // namespace LifeV
101 
102 #endif /* EXPORTERPOLICYHDF5_HPP */
virtual Displayer displayer()=0
VectorEpetra - The Epetra Vector format Wrapper.
virtual commPtr_Type comm()=0
std::shared_ptr< matrix_Type > matrixPtr_Type
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
std::shared_ptr< VectorEpetra > vectorPtr_Type
void setPreconditioner(preconditionerPtr_Type preconditionerPtr)
Method to set a preconditioner.
std::shared_ptr< comm_Type > commPtr_Type
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< preconditioner_Type > preconditionerPtr_Type
int solve(matrixPtr_Type systemMatrix, vectorPtr_Type rhs, vectorPtr_Type solution)
preconditionerPtr_Type preconditioner()
Method to get a preconditioner.
LinearSolver - Class to wrap linear solver.
std::shared_ptr< solver_Type > solverPtr_Type
double Real
Generic real data.
Definition: LifeV.hpp:175
Preconditioner - Abstract preconditioner class.
void initSolver(Teuchos::ParameterList &list)
Displayer - This class is used to display messages in parallel simulations.
Definition: Displayer.hpp:62