|
Ifpack2 Templated Preconditioning Package
Version 1.0
|
00001 /*@HEADER 00002 // *********************************************************************** 00003 // 00004 // Ifpack2: Tempated Object-Oriented Algebraic Preconditioner Package 00005 // Copyright (2009) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 00028 */ 00029 00030 #ifndef IFPACK2_PRECONDITIONER_HPP 00031 #define IFPACK2_PRECONDITIONER_HPP 00032 00033 #include "Ifpack2_ConfigDefs.hpp" 00034 #include "Ifpack2_CondestType.hpp" 00035 #include "Kokkos_DefaultNode.hpp" 00036 #include "Tpetra_Operator.hpp" 00037 #include "Tpetra_RowMatrix.hpp" 00038 #include "Teuchos_ParameterList.hpp" 00039 #include "Teuchos_ScalarTraits.hpp" 00040 #include <iostream> 00041 00042 namespace Ifpack2 { 00043 00045 00116 template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType> 00117 class Preconditioner : virtual public Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> { 00118 00119 public: 00120 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType magnitudeType; 00121 00123 virtual ~Preconditioner(){} 00124 00127 00129 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > & getDomainMap() const = 0; 00130 00132 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > & getRangeMap() const = 0; 00133 00135 virtual void apply(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X, 00136 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y, 00137 Teuchos::ETransp mode = Teuchos::NO_TRANS, 00138 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(), 00139 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero()) const = 0; 00140 00142 00144 virtual void setParameters(const Teuchos::ParameterList& List) = 0; 00145 00147 virtual void initialize() = 0; 00148 00150 virtual bool isInitialized() const = 0; 00151 00153 virtual void compute() = 0; 00154 00156 virtual bool isComputed() const = 0; 00157 00159 virtual magnitudeType computeCondEst(CondestType CT = Ifpack2::Cheap, 00160 LocalOrdinal MaxIters = 1550, 00161 magnitudeType Tol = 1e-9, 00162 const Teuchos::Ptr<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &Matrix = Teuchos::null) = 0; 00163 00165 virtual magnitudeType getCondEst() const = 0; 00166 00168 virtual Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > getMatrix() const = 0; 00169 00171 virtual int getNumInitialize() const = 0; 00172 00174 virtual int getNumCompute() const = 0; 00175 00177 virtual int getNumApply() const = 0; 00178 00180 virtual double getInitializeTime() const = 0; 00181 00183 virtual double getComputeTime() const = 0; 00184 00186 virtual double getApplyTime() const = 0; 00187 00188 };//class Preconditioner 00189 00190 }//namespace Ifpack2 00191 00192 #endif // IFPACK2_PRECONDITIONER_HPP
1.7.6.1