43 #ifndef IFPACK2_ADDITIVESCHWARZ_DECL_HPP 44 #define IFPACK2_ADDITIVESCHWARZ_DECL_HPP 46 #include "Ifpack2_ConfigDefs.hpp" 47 #include "Tpetra_ConfigDefs.hpp" 48 #include "Ifpack2_Preconditioner.hpp" 49 #include "Ifpack2_Parameters.hpp" 50 #include "Teuchos_ParameterList.hpp" 51 #include "Teuchos_RefCountPtr.hpp" 52 #include "Teuchos_Time.hpp" 54 #include "Tpetra_MultiVector.hpp" 55 #include "Tpetra_Map.hpp" 56 #include "Tpetra_CrsMatrix.hpp" 58 #include "Ifpack2_ReorderFilter.hpp" 59 #include "Ifpack2_SingletonFilter.hpp" 60 #include "Ifpack2_OverlappingRowMatrix.hpp" 62 #ifdef HAVE_IFPACK2_ZOLTAN2 63 #include "Zoltan2_OrderingSolution.hpp" 122 template<
class MatrixType,
class LocalInverseType>
123 class AdditiveSchwarz :
virtual public Ifpack2::Preconditioner<typename MatrixType::scalar_type,typename MatrixType::local_ordinal_type,typename MatrixType::global_ordinal_type,typename MatrixType::node_type> {
126 typedef typename MatrixType::scalar_type Scalar;
127 typedef typename MatrixType::local_ordinal_type LocalOrdinal;
128 typedef typename MatrixType::global_ordinal_type GlobalOrdinal;
129 typedef typename MatrixType::node_type Node;
130 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType magnitudeType;
131 typedef typename Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> LocalMatrixType;
146 AdditiveSchwarz(
const Teuchos::RCP<
const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > & Matrix_in,
int OverlapLevel_in = 0);
156 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &
getDomainMap()
const;
159 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &
getRangeMap()
const;
162 virtual Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
getMatrix()
const;
167 virtual void apply(
const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
168 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
169 Teuchos::ETransp mode = Teuchos::NO_TRANS,
170 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
171 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const;
176 template <
class DomainScalar,
class RangeScalar>
177 void applyTempl(
const Tpetra::MultiVector<DomainScalar,LocalOrdinal,GlobalOrdinal,Node> &X,
178 Tpetra::MultiVector<RangeScalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
179 Teuchos::ETransp mode = Teuchos::NO_TRANS,
180 RangeScalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
181 RangeScalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const;
184 virtual void setParameters(
const Teuchos::ParameterList& List);
200 LocalOrdinal MaxIters = 1550,
201 magnitudeType Tol = 1e-9,
202 const Teuchos::Ptr<
const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &Matrix = Teuchos::null);
232 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
237 virtual std::ostream&
print(std::ostream& os)
const;
258 const Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
Matrix_;
321 #endif // IFPACK2_ADDITIVESCHWARZ_DECL_HPP int NumInitialize_
Contains the number of successful calls to Initialize().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:295
void applyTempl(const Tpetra::MultiVector< DomainScalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< RangeScalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, RangeScalar alpha=Teuchos::ScalarTraits< Scalar >::one(), RangeScalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Applies the effect of the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:220
double ComputeTime_
Contains the time for all successful calls to compute().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:303
Tpetra::CombineMode CombineMode_
Combine mode for off-process elements (only if overlap is used)
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:280
CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
virtual void compute()
Computes all (coefficient) data necessary to apply the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:422
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const
Returns the Map associated with the domain of this operator, which must be compatible with X...
Definition: Ifpack2_AdditiveSchwarz_def.hpp:110
virtual int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:492
void setup()
Sets up the localized matrix and the singleton filter.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:600
virtual bool isInitialized() const
Returns true if the preconditioner has been successfully initialized, false otherwise.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:414
virtual double getInitializeTime() const
Returns the time spent in initialize().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:500
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:546
Teuchos::RCP< Ifpack2::OverlappingRowMatrix< LocalMatrixType > > OverlappingMatrix_
Pointers to the overlapping matrix.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:261
virtual void setParameters(const Teuchos::ParameterList &List)
Sets all parameters for the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:304
virtual magnitudeType computeCondEst(CondestType CT=Ifpack2::Cheap, LocalOrdinal MaxIters=1550, magnitudeType Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix=Teuchos::null)
Computes the condition number estimate and returns its value.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:450
virtual double getComputeTime() const
Returns the time spent in compute().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:508
const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Matrix_
Pointers to the matrix to be preconditioned.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:258
virtual ~AdditiveSchwarz()
Destructor.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:103
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:523
virtual std::ostream & print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:581
virtual double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:516
double InitializeTime_
Contains the time for all successful calls to initialize().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:301
virtual void initialize()
Computes all (graph-related) data necessary to initialize the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:371
virtual magnitudeType getCondEst() const
Returns the computed condition number estimate, or -1.0 if not computed.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:468
bool IsComputed_
If true, the preconditioner has been successfully computed.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:272
AdditiveSchwarz(const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix_in, int OverlapLevel_in=0)
Ifpack2::AdditiveSchwarz constructor with given Tpetra::RowMatrix.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:68
Teuchos::RCP< Teuchos::Time > Time_
Object used for timing purposes.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:313
Teuchos::RCP< Ifpack2::SingletonFilter< LocalMatrixType > > SingletonMatrix_
filtering object.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:293
bool ComputeCondest_
If true, compute the condition number estimate each time Compute() is called.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:284
Base class for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:130
bool FilterSingletons_
Filter for singletons.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:291
virtual Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMatrix() const
Returns a pointer to the input matrix.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:125
int NumApply_
Contains the number of successful call to apply().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:299
double ApplyTime_
Contains the time for all successful calls to apply().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:305
bool IsOverlapping_
If true, overlapping is used.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:274
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
Definition: Ifpack2_AdditiveSchwarz_def.hpp:118
bool IsInitialized_
If true, the preconditioner has been successfully initialized.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:270
double ApplyFlops_
Contain sthe number of flops for ApplyInverse().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:311
bool UseSubdomain_
If true, subdomain filtering is used.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:288
Teuchos::RCP< Ifpack2::ReorderFilter< LocalMatrixType > > ReorderedLocalizedMatrix_
Pointer to the reordered matrix.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:267
bool UseReordering_
If true, reorder the local matrix.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:286
int NumCompute_
Contains the number of successful call to Compute().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:297
Teuchos::RCP< LocalInverseType > Inverse_
Pointer to the local solver.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:315
int OverlapLevel_
Level of overlap among the processors.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:276
virtual int getNumCompute() const
Returns the number of calls to compute().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:484
double InitializeFlops_
Contains the number of flops for Initialize().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:307
Additive Schwarz domain decomposition for Tpetra::RowMatrix objects.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:123
virtual bool isComputed() const
Returns true if the preconditioner has been successfully computed, false otherwise.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:441
Teuchos::RCP< LocalMatrixType > LocalizedMatrix_
Localized version of Matrix_ or OverlappingMatrix_.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:265
double ComputeFlops_
Contains the number of flops for Compute().
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:309
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
magnitudeType Condest_
Contains the estimated condition number.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:282
virtual int getOverlapLevel() const
Returns the level of overlap.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:592
cheap estimate
Definition: Ifpack2_CondestType.hpp:51
virtual void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Applies the effect of the preconditioner.
Definition: Ifpack2_AdditiveSchwarz_def.hpp:133
virtual int getNumInitialize() const
Returns the number of calls to initialize().
Definition: Ifpack2_AdditiveSchwarz_def.hpp:476
Teuchos::ParameterList List_
Stores a copy of the list given in SetParameters()
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:278