| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Stratimikos: Thyra-based strategies for linear solvers |
| 4 |
// |
| 5 |
// Copyright 2006 NTESS and the Stratimikos contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef THYRA_IFPACK_PRECONDITIONER_FACTORY_DECL_HPP |
| 11 |
#define THYRA_IFPACK_PRECONDITIONER_FACTORY_DECL_HPP |
| 12 |
|
| 13 |
#include "Thyra_PreconditionerFactoryBase.hpp" |
| 14 |
#include "Thyra_EpetraOperatorViewExtractorBase.hpp" |
| 15 |
#include "Teuchos_StandardCompositionMacros.hpp" |
| 16 |
#include "Ifpack.h" |
| 17 |
|
| 18 |
namespace Thyra { |
| 19 |
|
| 20 |
/** \brief Concrete preconditioner factory subclass based on Ifpack. |
| 21 |
* |
| 22 |
* ToDo: Finish documentation! |
| 23 |
*/ |
| 24 |
class IfpackPreconditionerFactory : public PreconditionerFactoryBase<double> { |
| 25 |
public: |
| 26 |
|
| 27 |
/** @name Constructors/initializers/accessors */ |
| 28 |
//@{ |
| 29 |
|
| 30 |
/** \brief . */ |
| 31 |
IfpackPreconditionerFactory(); |
| 32 |
|
| 33 |
/** \brief Set the strategy object used to extract an |
| 34 |
* <tt>Epetra_Operator</tt> view of an input forward operator. |
| 35 |
* |
| 36 |
* This view will then be dynamically casted to <tt>Epetra_RowMatrix</tt> |
| 37 |
* before it is used. |
| 38 |
* |
| 39 |
* The default implementation used is <tt>EpetraOperatorViewExtractorBase</tt>. |
| 40 |
*/ |
| 41 |
STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor ); |
| 42 |
|
| 43 |
//@} |
| 44 |
|
| 45 |
/** @name Overridden from PreconditionerFactoryBase */ |
| 46 |
//@{ |
| 47 |
|
| 48 |
/** \brief . */ |
| 49 |
bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const; |
| 50 |
/** \brief . */ |
| 51 |
bool applySupportsConj(EConj conj) const; |
| 52 |
/** \brief . */ |
| 53 |
bool applyTransposeSupportsConj(EConj conj) const; |
| 54 |
/** \brief . */ |
| 55 |
Teuchos::RCP<PreconditionerBase<double> > createPrec() const; |
| 56 |
/** \brief . */ |
| 57 |
void initializePrec( |
| 58 |
const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc |
| 59 |
,PreconditionerBase<double> *prec |
| 60 |
,const ESupportSolveUse supportSolveUse |
| 61 |
) const; |
| 62 |
/** \brief . */ |
| 63 |
void uninitializePrec( |
| 64 |
PreconditionerBase<double> *prec |
| 65 |
,Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc |
| 66 |
,ESupportSolveUse *supportSolveUse |
| 67 |
) const; |
| 68 |
|
| 69 |
//@} |
| 70 |
|
| 71 |
/** @name Overridden from ParameterListAcceptor */ |
| 72 |
//@{ |
| 73 |
|
| 74 |
/** \brief . */ |
| 75 |
void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList); |
| 76 |
/** \brief . */ |
| 77 |
Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList(); |
| 78 |
/** \brief . */ |
| 79 |
Teuchos::RCP<Teuchos::ParameterList> unsetParameterList(); |
| 80 |
/** \brief . */ |
| 81 |
Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const; |
| 82 |
/** \brief . */ |
| 83 |
Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const; |
| 84 |
|
| 85 |
//@} |
| 86 |
|
| 87 |
/** \name Public functions overridden from Teuchos::Describable. */ |
| 88 |
//@{ |
| 89 |
|
| 90 |
/** \brief . */ |
| 91 |
std::string description() const; |
| 92 |
|
| 93 |
//@} |
| 94 |
|
| 95 |
private: |
| 96 |
|
| 97 |
// //////////////////////////////// |
| 98 |
// Private data members |
| 99 |
|
| 100 |
Teuchos::RCP<Teuchos::ParameterList> paramList_; |
| 101 |
::Ifpack::EPrecType precType_; |
| 102 |
int overlap_; |
| 103 |
|
| 104 |
// //////////////////////////////// |
| 105 |
// Private member functions |
| 106 |
|
| 107 |
static void initializeTimers(); |
| 108 |
|
| 109 |
}; |
| 110 |
|
| 111 |
} // namespace Thyra |
| 112 |
|
| 113 |
#endif // THYRA_IFPACK_PRECONDITIONER_FACTORY_DECL_HPP |