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;
246 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
249 TEUCHOS_DEPRECATED
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitudeType;
257 RILUK(
const Teuchos::RCP<const MatrixType>& A_in);
277 void SetOverlapMode( Tpetra::CombineMode OverlapMode) {OverlapMode_ = OverlapMode;}
290 void setParameters(
const Teuchos::ParameterList& params);
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,
347 Teuchos::ETransp mode = Teuchos::NO_TRANS,
348 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
349 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
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,
368 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
379 magnitude_type computeCondEst(Teuchos::ETransp mode)
const;
381 local_ordinal_type MaxIters = 1550,
382 magnitude_type Tol = 1e-9,
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;
386 return computeCondEst(Teuchos::NO_TRANS);
391 Teuchos::RCP<const Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> >
getMatrix()
const 407 int getLevelOfFill()
const {
return LevelOfFill_; }
416 const Teuchos::RCP<Ifpack2::IlukGraph<local_ordinal_type,global_ordinal_type,node_type> >&
getGraph()
const {
return(Graph_);}
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_);}
430 const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >&
getDomainMap()
const 431 {
return Graph_->getL_Graph()->getDomainMap(); }
434 const Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> >&
getRangeMap()
const 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);
450 void generateXY(Teuchos::ETransp mode,
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;
456 Teuchos::RCP<Ifpack2::IlukGraph<local_ordinal_type,global_ordinal_type,node_type> > Graph_;
457 const Teuchos::RCP<const MatrixType> A_;
458 Teuchos::RCP<MatrixType> L_;
459 Teuchos::RCP<MatrixType> U_;
460 Teuchos::RCP<Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > D_;
469 mutable int numInitialize_;
470 mutable int numCompute_;
471 mutable int numApply_;
473 magnitude_type RelaxValue_;
474 magnitude_type Athresh_;
475 magnitude_type Rthresh_;
476 mutable magnitude_type Condest_;
478 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > OverlapX_;
479 mutable Teuchos::RCP<Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> > OverlapY_;
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
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
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
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
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
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
magnitude_type getRelativeThreshold() const
Get relative threshold value.
Definition: Ifpack2_RILUK_decl.hpp:405
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
Definition: Ifpack2_BlockRelaxation_decl.hpp:64
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
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
double getInitializeTime() const
Returns the time spent in initialize().
Definition: Ifpack2_RILUK_decl.hpp:320
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