// @HEADER // ***************************************************************************** // ShyLU: Scalable Hybrid LU Preconditioner and Solver // // Copyright 2011 NTESS and the ShyLU contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef _FROSCH_FROSCHPRECONDITIONER_DECL_HPP #define _FROSCH_FROSCHPRECONDITIONER_DECL_HPP #include // FROSch #include #include namespace FROSch { using namespace Teuchos; using namespace Xpetra; template class FROSchPreconditioner : public Solver { protected: // Xpetra using ConstXMatrixPtr = typename Solver::ConstXMatrixPtr; using XMultiVector = MultiVector; using ConstXMultiVector = const MultiVector; using XMultiVectorPtr = RCP; using ConstXMultiVectorPtr = RCP; using ConstXMultiVectorPtrVecPtr = ArrayRCP; using XMultiVectorFactory = typename Solver::XMultiVectorFactory; // Teuchos using ParameterListPtr = typename Solver::ParameterListPtr; // FROSch using SchwarzPreconditionerPtr = RCP >; using TwoLevelBlockPreconditionerPtr = RCP >; using TwoLevelPreconditionerPtr = RCP >; using UN = unsigned; using UNVec = Array; using UNVecPtr = ArrayRCP; using GOVecPtr = ArrayRCP; public: //! Initialize the internal solver virtual int initialize(); //! Compute the internal solver virtual int compute(); /*! \brief Computes the operator-multivector application. Loosely, performs \f$Y = \alpha \cdot A^{\textrm{mode}} \cdot X + \beta \cdot Y\f$. However, the details of operation vary according to the values of \c alpha and \c beta. Specifically - if beta == 0, apply() must overwrite \c Y, so that any values in \c Y (including NaNs) are ignored. - if alpha == 0, apply() may short-circuit the operator, so that any values in \c X (including NaNs) are ignored. */ void apply(const XMultiVector &x, XMultiVector &y, ETransp mode=NO_TRANS, SC alpha=ScalarTraits::one(), SC beta=ScalarTraits::zero()) const; int updateMatrix(ConstXMatrixPtr k, bool reuseInitialize=false); protected: //! Constructor FROSchPreconditioner(ConstXMatrixPtr k, ParameterListPtr parameterList, string description); SchwarzPreconditionerPtr FROSchPreconditioner_ = null; friend class SolverFactory; }; } #endif