37 #ifndef PRECONDITIONERSOLVERBELOS_HPP 38 #define PRECONDITIONERSOLVERBELOS_HPP 1
41 #include <Teuchos_ParameterList.hpp> 42 #include "Teuchos_XMLParameterListHelpers.hpp" 43 #include <Epetra_Operator.h> 46 #include <lifev/core/array/MapEpetra.hpp> 47 #include <lifev/core/array/VectorEpetra.hpp> 48 #include <lifev/core/array/MatrixEpetra.hpp> 49 #include <lifev/core/util/Displayer.hpp> 50 #include <lifev/core/algorithm/Preconditioner.hpp> 51 #include <lifev/core/algorithm/LinearSolver.hpp> 52 #include <lifev/core/filter/GetPot.hpp> 63 class PreconditionerLinearSolver
64 :
public Preconditioner
71 typedef Epetra_Operator prec_raw_type;
72 typedef std::shared_ptr<prec_raw_type> prec_type;
74 typedef LinearSolver solver_Type;
75 typedef std::shared_ptr<solver_Type> solverPtr_Type;
77 typedef MatrixEpetra<
Real> operator_raw_type;
78 typedef std::shared_ptr<operator_raw_type> operator_type;
80 typedef Preconditioner preconditioner_Type;
81 typedef std::shared_ptr<preconditioner_Type> preconditionerPtr_Type;
83 typedef Displayer::comm_Type comm_Type;
84 typedef Displayer::commPtr_Type commPtr_Type;
86 typedef Teuchos::ParameterList list_Type;
99 PreconditionerLinearSolver ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_MpiComm ( MPI_COMM_WORLD ) ) );
101 PreconditionerLinearSolver ( std::shared_ptr<Epetra_Comm> comm = std::shared_ptr<Epetra_Comm> (
new Epetra_SerialComm ) );
105 virtual ~PreconditionerLinearSolver();
119 virtual void createParametersList ( list_Type& list,
120 const GetPot& dataFile,
121 const std::string& section,
122 const std::string& subSection );
131 static void createLinearSolverList ( list_Type& list,
132 const GetPot& dataFile,
133 const std::string& section,
134 const std::string& subSection =
"SolverLinear",
135 const bool& verbose =
true );
141 virtual Int buildPreconditioner ( operator_type& matrix );
144 virtual void resetPreconditioner();
147 virtual Real condest();
150 virtual void showMe ( std::ostream& output = std::cout )
const;
162 Int SetUseTranspose (
const bool useTranspose =
false );
172 Int Apply (
const Epetra_MultiVector& vector1, Epetra_MultiVector& vector2 )
const;
179 Int ApplyInverse (
const Epetra_MultiVector& vector1, Epetra_MultiVector& vector2 )
const;
183 const Epetra_Map& OperatorRangeMap()
const;
186 const Epetra_Map& OperatorDomainMap()
const;
198 void setDataFromGetPot (
const GetPot& dataFile,
const std::string& section );
205 void setSolver ( SolverAztecOO& );
214 bool isPreconditionerSet()
const;
217 prec_raw_type* preconditioner();
220 prec_type preconditionerPtr();
223 solverPtr_Type solverPtr();
226 std::string preconditionerType();
232 solverPtr_Type M_solver;
233 preconditionerPtr_Type M_preconditioner;
236 bool M_printSubiterationCount;
237 std::string M_precName;
238 std::string M_precDataSection;
242 inline Preconditioner* createLinearSolverPreconditioner()
244 return new PreconditionerLinearSolver();
int32_type Int
Generic integer data.
static const LifeV::UInt elm_nodes_num[]
double Real
Generic real data.