| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// ShyLU: Scalable Hybrid LU Preconditioner and Solver |
| 4 |
// |
| 5 |
// Copyright 2011 NTESS and the ShyLU contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
/** \file IQRSolver.h |
| 11 |
|
| 12 |
\brief Encapsulates the IQR inexact solver functionality |
| 13 |
|
| 14 |
\author Radu Popescu |
| 15 |
|
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef IQRSOLVER_H_ |
| 19 |
#define IQRSOLVER_H_ |
| 20 |
|
| 21 |
#if defined(ShyLU_DDCore_SHOW_DEPRECATED_WARNINGS) |
| 22 |
#ifdef __GNUC__ |
| 23 |
#warning "The ShyLU_DDCore package is deprecated" |
| 24 |
#endif |
| 25 |
#endif |
| 26 |
|
| 27 |
#include <vector> |
| 28 |
|
| 29 |
#include <Epetra_BlockMap.h> |
| 30 |
#include <Epetra_MultiVector.h> |
| 31 |
#include <Epetra_Operator.h> |
| 32 |
|
| 33 |
#include <shylu_internal_gmres_tools.h> |
| 34 |
#include <shylu_internal_gmres.h> |
| 35 |
|
| 36 |
#include <Ifpack_Preconditioner.h> |
| 37 |
|
| 38 |
#include <Teuchos_ParameterList.hpp> |
| 39 |
#include <Teuchos_RCP.hpp> |
| 40 |
|
| 41 |
#include <shylu_probing_operator.h> |
| 42 |
|
| 43 |
namespace IQR { |
| 44 |
|
| 45 |
class IQRSolver { |
| 46 |
public: |
| 47 |
// Public type definitions |
| 48 |
typedef IQR::GMRESManager<Epetra_BlockMap, |
| 49 |
Epetra_MultiVector, |
| 50 |
std::vector<std::vector<double> >, |
| 51 |
std::vector<double> > GMRESStateManager; |
| 52 |
|
| 53 |
// Public constructor and destructor |
| 54 |
IQRSolver(const Teuchos::ParameterList& pList); |
| 55 |
virtual ~IQRSolver(); |
| 56 |
|
| 57 |
// Public methods |
| 58 |
int Solve(const ShyLU_Probing_Operator& S, |
| 59 |
const Epetra_MultiVector& B, |
| 60 |
Epetra_MultiVector & X); |
| 61 |
|
| 62 |
private: |
| 63 |
// Private methods |
| 64 |
int Compute(const ShyLU_Probing_Operator& S, |
| 65 |
const Epetra_MultiVector& B, |
| 66 |
Epetra_MultiVector & X); |
| 67 |
|
| 68 |
// Private data |
| 69 |
Teuchos::RCP<GMRESStateManager> gmresStateManager_; |
| 70 |
Teuchos::RCP<Ifpack_Preconditioner> prec_; |
| 71 |
bool isComputed_; |
| 72 |
double krylovDim_; |
| 73 |
int numIter_; |
| 74 |
bool doScaling_; |
| 75 |
bool useFullIQR_; |
| 76 |
std::string precType_; |
| 77 |
std::string precAmesosType_; |
| 78 |
}; |
| 79 |
|
| 80 |
} /* namespace IQR */ |
| 81 |
|
| 82 |
#endif /* IQRSOLVER_H_ */ |