43 #ifndef IFPACK2_CRSRILUK_DECL_HPP
44 #define IFPACK2_CRSRILUK_DECL_HPP
46 #include "Ifpack2_ConfigDefs.hpp"
48 #include "Ifpack2_IlukGraph.hpp"
49 #include "Ifpack2_Preconditioner.hpp"
50 #include "Tpetra_CrsMatrix.hpp"
51 #include "Tpetra_MultiVector.hpp"
53 #include "Teuchos_RefCountPtr.hpp"
213 template<
class MatrixType>
214 class RILUK:
public virtual Ifpack2::Preconditioner<typename MatrixType::scalar_type,typename MatrixType::local_ordinal_type,typename MatrixType::global_ordinal_type,typename MatrixType::node_type> {
221 TEUCHOS_DEPRECATED
typedef typename MatrixType::scalar_type
Scalar;
228 TEUCHOS_DEPRECATED
typedef typename MatrixType::local_ordinal_type
LocalOrdinal;
235 TEUCHOS_DEPRECATED
typedef typename MatrixType::global_ordinal_type
GlobalOrdinal;
242 TEUCHOS_DEPRECATED
typedef typename MatrixType::node_type
Node;
277 void SetOverlapMode( Tpetra::CombineMode OverlapMode) {OverlapMode_ = OverlapMode;}
345 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
346 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
366 int Multiply(
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
367 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
383 const Teuchos::Ptr<
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > &Matrix = Teuchos::null)
385 std::cerr <<
"Warning, Ifpack2::RILUK::computeCondEst currently does not use MaxIters/Tol/etc arguments..." << std::endl;
407 int getLevelOfFill()
const {
return LevelOfFill_; }
419 const MatrixType&
getL()
const {
return(*L_);}
422 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &
getD()
const {
return(*D_);}
425 const MatrixType&
getU()
const {
return(*U_);}
431 {
return Graph_->getL_Graph()->getDomainMap(); }
435 {
return Graph_->getU_Graph()->getRangeMap(); }
440 void setFactored(
bool Flag) {Factored_ = Flag;}
441 void setInitialized(
bool Flag) {isInitialized_ = Flag;}
442 bool isAllocated()
const {
return(isAllocated_);}
443 void setAllocated(
bool Flag) {isAllocated_ = Flag;}
448 void allocate_L_and_U();
449 void initAllValues(
const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> & overlapA);
451 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Xin,
452 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Yin,
453 Teuchos::RCP<
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> >& Xout,
454 Teuchos::RCP<Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> >& Yout)
const;
469 mutable int numInitialize_;
470 mutable int numCompute_;
471 mutable int numApply_;
480 Tpetra::CombineMode OverlapMode_;
CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
const MatrixType & getU() const
Returns the U factor associated with this factored matrix.
Definition: Ifpack2_RILUK_decl.hpp:425
magnitude_type getAbsoluteThreshold() const
Get absolute threshold value.
Definition: Ifpack2_RILUK_decl.hpp:402
int getGlobalNumEntries() const
Returns the number of nonzero entries in the global graph.
Definition: Ifpack2_RILUK_decl.hpp:413
Ifpack2::ScalingType enumerable type.
void SetRelativeThreshold(magnitude_type Rthresh)
Set relative threshold value.
Definition: Ifpack2_RILUK_decl.hpp:274
void SetRelaxValue(magnitude_type RelaxValue)
Set RILU(k) relaxation parameter.
Definition: Ifpack2_RILUK_decl.hpp:268
magnitude_type computeCondEst(Teuchos::ETransp mode) const
Returns the maximum over all the condition number estimate for each local ILU set of factors...
Definition: Ifpack2_RILUK_def.hpp:715
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:232
TEUCHOS_DEPRECATED typedef MatrixType::global_ordinal_type GlobalOrdinal
Preserved only for backwards compatibility. Please use "global_ordinal_type".
Definition: Ifpack2_RILUK_decl.hpp:235
Teuchos::RCP< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > getMatrix() const
Returns a pointer to the input matrix.
Definition: Ifpack2_RILUK_decl.hpp:391
void initialize()
Initialize by computing the symbolic incomplete factorization.
Definition: Ifpack2_RILUK_def.hpp:325
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_RILUK_decl.hpp:322
const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Definition: Ifpack2_RILUK_decl.hpp:434
void SetAbsoluteThreshold(magnitude_type Athresh)
Set absolute threshold value.
Definition: Ifpack2_RILUK_decl.hpp:271
void setParameters(const Teuchos::ParameterList ¶ms)
Definition: Ifpack2_RILUK_def.hpp:125
ILU(k) (incomplete LU with fill level k) factorization of a given Tpetra::RowMatrix.
Definition: Ifpack2_RILUK_decl.hpp:214
Tpetra::CombineMode getOverlapMode()
Get overlap mode type.
Definition: Ifpack2_RILUK_decl.hpp:410
magnitude_type getCondEst() const
Returns the computed condition number estimate, or -1.0 if not computed.
Definition: Ifpack2_RILUK_decl.hpp:389
void SetOverlapMode(Tpetra::CombineMode OverlapMode)
Set overlap mode type.
Definition: Ifpack2_RILUK_decl.hpp:277
bool isComputed() const
Whether compute() has been called.
Definition: Ifpack2_RILUK_decl.hpp:312
int Multiply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS) const
Apply the incomplete factorization (as a product) to X, resulting in Y.
Definition: Ifpack2_RILUK_def.hpp:671
magnitude_type computeCondEst(CondestType CT=Ifpack2::Cheap, local_ordinal_type MaxIters=1550, magnitude_type Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > > &Matrix=Teuchos::null)
Computes the condition number estimate and returns its value.
Definition: Ifpack2_RILUK_decl.hpp:380
MatrixType::node_type node_type
The type of the Kokkos Node used by the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:239
const Teuchos::RCP< Ifpack2::IlukGraph< local_ordinal_type, global_ordinal_type, node_type > > & getGraph() const
Returns the Ifpack2::IlukGraph associated with this factored matrix.
Definition: Ifpack2_RILUK_decl.hpp:416
TEUCHOS_DEPRECATED typedef MatrixType::local_ordinal_type LocalOrdinal
Preserved only for backwards compatibility. Please use "local_ordinal_type".
Definition: Ifpack2_RILUK_decl.hpp:228
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:225
virtual ~RILUK()
Ifpack2_RILUK Destructor.
Definition: Ifpack2_RILUK_def.hpp:97
const MatrixType & getL() const
Returns the L factor associated with this factored matrix.
Definition: Ifpack2_RILUK_decl.hpp:419
Base class for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:130
void compute()
Compute the (numeric) incomplete factorization.
Definition: Ifpack2_RILUK_def.hpp:471
magnitude_type getRelativeThreshold() const
Get relative threshold value.
Definition: Ifpack2_RILUK_decl.hpp:405
void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Apply the (inverse of the) incomplete factorization to X, resulting in Y.
Definition: Ifpack2_RILUK_def.hpp:615
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_RILUK_decl.hpp:246
TEUCHOS_DEPRECATED typedef MatrixType::node_type Node
Preserved only for backwards compatibility. Please use "node_type".
Definition: Ifpack2_RILUK_decl.hpp:242
bool isInitialized() const
Whether initialize() has been called.
Definition: Ifpack2_RILUK_decl.hpp:296
const Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > & getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Definition: Ifpack2_RILUK_decl.hpp:430
double getComputeTime() const
Returns the time spent in compute().
Definition: Ifpack2_RILUK_decl.hpp:321
int getNumCompute() const
How many times compute() has been called for this object.
Definition: Ifpack2_RILUK_decl.hpp:315
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitudeType
Preserved only for backwards compatibility. Please use "magnitude_type".
Definition: Ifpack2_RILUK_decl.hpp:249
const Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > & getD() const
Returns the D factor associated with this factored matrix.
Definition: Ifpack2_RILUK_decl.hpp:422
magnitude_type GetRelaxValue() const
Get RILU(k) relaxation parameter.
Definition: Ifpack2_RILUK_decl.hpp:399
int getNumApply() const
How many times apply() has been called for this object.
Definition: Ifpack2_RILUK_decl.hpp:318
double getInitializeTime() const
Returns the time spent in initialize().
Definition: Ifpack2_RILUK_decl.hpp:320
RILUK(const Teuchos::RCP< const MatrixType > &A_in)
RILUK constuctor with variable number of indices per row.
Definition: Ifpack2_RILUK_def.hpp:50
cheap estimate
Definition: Ifpack2_CondestType.hpp:51
TEUCHOS_DEPRECATED typedef MatrixType::scalar_type Scalar
Preserved only for backwards compatibility. Please use "scalar_type".
Definition: Ifpack2_RILUK_decl.hpp:221
int getNumInitialize() const
How many times initialize() has been called for this object.
Definition: Ifpack2_RILUK_decl.hpp:299
MatrixType::scalar_type scalar_type
The type of the entries of the input MatrixType.
Definition: Ifpack2_RILUK_decl.hpp:218