43 #ifndef IFPACK2_BLOCKRELAXATION_DEF_HPP 44 #define IFPACK2_BLOCKRELAXATION_DEF_HPP 46 #include "Ifpack2_BlockRelaxation_decl.hpp" 47 #include "Ifpack2_LinearPartitioner_decl.hpp" 52 template<
class MatrixType,
class ContainerType>
55 Time_(
Teuchos::rcp( new
Teuchos::Time(
"Ifpack2::BlockRelaxation") ) ),
57 PartitionerType_(
"linear"),
60 MinDiagonalValue_(0.0),
63 ZeroStartingSolution_(true),
66 IsInitialized_(false),
80 TEUCHOS_TEST_FOR_EXCEPTION(A_ == Teuchos::null, std::runtime_error,
81 Teuchos::typeName(*
this) <<
"::BlockRelaxation(): input matrix reference was null.");
85 template<
class MatrixType,
class ContainerType>
90 template<
class MatrixType,
class ContainerType>
93 Teuchos::ParameterList validparams;
95 List.validateParameters(validparams);
98 if (PrecType_ == Ifpack2::JACOBI)
100 else if (PrecType_ == Ifpack2::GS)
102 else if (PrecType_ == Ifpack2::SGS)
103 PT =
"Symmetric Gauss-Seidel";
108 PrecType_ = Ifpack2::JACOBI;
109 else if (PT ==
"Gauss-Seidel")
110 PrecType_ = Ifpack2::GS;
111 else if (PT ==
"Symmetric Gauss-Seidel")
112 PrecType_ = Ifpack2::SGS;
114 std::ostringstream osstr;
115 osstr <<
"Ifpack2::BlockRelaxation::setParameters: unsupported parameter-value for 'relaxation: type' (" << PT <<
")";
116 std::string str = osstr.str();
117 throw std::runtime_error(str);
130 if (PrecType_ != Ifpack2::JACOBI)
132 if (NumLocalBlocks_ < 0)
133 NumLocalBlocks_ = A_->getNodeNumRows() / (-NumLocalBlocks_);
138 TEUCHOS_TEST_FOR_EXCEPTION(DoBackwardGS_ ==
true, std::runtime_error,
139 "Ifpack2::BlockRelaxation:setParameters ERROR: 'relaxation: backward mode' == true is not supported yet.");
148 template<
class MatrixType,
class ContainerType>
149 const Teuchos::RCP<const Teuchos::Comm<int> > &
151 return A_->getComm();
155 template<
class MatrixType,
class ContainerType>
156 Teuchos::RCP<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
157 typename MatrixType::local_ordinal_type,
158 typename MatrixType::global_ordinal_type,
159 typename MatrixType::node_type> >
165 template<
class MatrixType,
class ContainerType>
166 const Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
167 typename MatrixType::global_ordinal_type,
168 typename MatrixType::node_type> >&
170 return A_->getDomainMap();
174 template<
class MatrixType,
class ContainerType>
175 const Teuchos::RCP<
const Tpetra::Map<
typename MatrixType::local_ordinal_type,
176 typename MatrixType::global_ordinal_type,
177 typename MatrixType::node_type> >&
179 return A_->getRangeMap();
183 template<
class MatrixType,
class ContainerType>
189 template<
class MatrixType,
class ContainerType>
191 return(NumInitialize_);
195 template<
class MatrixType,
class ContainerType>
201 template<
class MatrixType,
class ContainerType>
207 template<
class MatrixType,
class ContainerType>
209 return(InitializeTime_);
213 template<
class MatrixType,
class ContainerType>
215 return(ComputeTime_);
219 template<
class MatrixType,
class ContainerType>
225 template<
class MatrixType,
class ContainerType>
227 return(ComputeFlops_);
231 template<
class MatrixType,
class ContainerType>
237 template<
class MatrixType,
class ContainerType>
238 typename Teuchos::ScalarTraits<typename MatrixType::scalar_type>::magnitudeType
245 template<
class MatrixType,
class ContainerType>
246 typename Teuchos::ScalarTraits<typename MatrixType::scalar_type>::magnitudeType
249 typename MatrixType::local_ordinal_type MaxIters,
251 const Teuchos::Ptr<
const Tpetra::RowMatrix<
typename MatrixType::scalar_type,
252 typename MatrixType::local_ordinal_type,
253 typename MatrixType::global_ordinal_type,
254 typename MatrixType::node_type> > &matrix)
261 Condest_ = Ifpack2::Condest(*
this, CT, MaxIters, Tol, matrix);
267 template<
class MatrixType,
class ContainerType>
269 const Tpetra::MultiVector<
typename MatrixType::scalar_type,
270 typename MatrixType::local_ordinal_type,
271 typename MatrixType::global_ordinal_type,
272 typename MatrixType::node_type>& X,
273 Tpetra::MultiVector<
typename MatrixType::scalar_type,
274 typename MatrixType::local_ordinal_type,
275 typename MatrixType::global_ordinal_type,
276 typename MatrixType::node_type>& Y,
277 Teuchos::ETransp mode,
281 TEUCHOS_TEST_FOR_EXCEPTION(
isComputed() ==
false, std::runtime_error,
282 "Ifpack2::BlockRelaxation::apply ERROR: isComputed() must be true prior to calling apply.");
284 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
285 "Ifpack2::BlockRelaxation::apply ERROR: X.getNumVectors() != Y.getNumVectors().");
287 TEUCHOS_TEST_FOR_EXCEPTION(mode != Teuchos::NO_TRANS, std::runtime_error,
288 "Ifpack2::BlockRelaxation::apply ERORR: transpose modes not supported.");
294 Teuchos::RCP< const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > Xcopy;
295 if (X.getLocalMV().getValues() == Y.getLocalMV().getValues())
296 Xcopy = Teuchos::rcp(
new Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>(X) );
298 Xcopy = Teuchos::rcp( &X,
false );
300 if (ZeroStartingSolution_)
305 case Ifpack2::JACOBI:
306 ApplyInverseJacobi(*Xcopy,Y);
309 ApplyInverseGS(*Xcopy,Y);
312 ApplyInverseSGS(*Xcopy,Y);
315 throw std::runtime_error(
"Ifpack2::BlockRelaxation::apply internal logic error.");
320 ApplyTime_ += Time_->totalElapsedTime();
324 template<
class MatrixType,
class ContainerType>
326 const Tpetra::MultiVector<
typename MatrixType::scalar_type,
327 typename MatrixType::local_ordinal_type,
328 typename MatrixType::global_ordinal_type,
329 typename MatrixType::node_type>& X,
330 Tpetra::MultiVector<
typename MatrixType::scalar_type,
331 typename MatrixType::local_ordinal_type,
332 typename MatrixType::global_ordinal_type,
333 typename MatrixType::node_type>& Y,
334 Teuchos::ETransp mode)
const 336 TEUCHOS_TEST_FOR_EXCEPTION(
isComputed() ==
false, std::runtime_error,
337 "Ifpack2::BlockRelaxation::applyMat() ERROR: isComputed() must be true prior to calling applyMat().");
338 TEUCHOS_TEST_FOR_EXCEPTION(X.getNumVectors() != Y.getNumVectors(), std::runtime_error,
339 "Ifpack2::BlockRelaxation::applyMat() ERROR: X.getNumVectors() != Y.getNumVectors().");
340 A_->apply(X, Y, mode);
344 template<
class MatrixType,
class ContainerType>
346 IsInitialized_ =
false;
348 TEUCHOS_TEST_FOR_EXCEPTION(A_ == Teuchos::null, std::runtime_error,
349 "Ifpack2::BlockRelaxation::Initialize ERROR, Matrix is NULL");
353 NumMyRows_ = A_->getNodeNumRows();
354 NumGlobalRows_ = A_->getGlobalNumRows();
355 NumGlobalNonzeros_ = A_->getGlobalNumEntries();
360 if (PartitionerType_ ==
"linear")
361 Partitioner_ = Teuchos::rcp(
new Ifpack2::LinearPartitioner<Tpetra::RowGraph<LocalOrdinal,GlobalOrdinal,Node> >(A_->getGraph()) );
363 TEUCHOS_TEST_FOR_EXCEPTION(0, std::runtime_error,
"Ifpack2::BlockRelaxation::initialize, invalid partitioner type.");
366 Partitioner_->setParameters(List_);
367 Partitioner_->compute();
370 NumLocalBlocks_ = Partitioner_->numLocalParts();
375 if (A_->getComm()->getSize() != 1)
382 InitializeTime_ += Time_->totalElapsedTime();
383 IsInitialized_ =
true;
387 template<
class MatrixType,
class ContainerType>
400 TEUCHOS_TEST_FOR_EXCEPTION(NumSweeps_ < 0, std::runtime_error,
401 "Ifpack2::BlockRelaxation::compute, NumSweeps_ must be >= 0");
404 ExtractSubmatrices();
407 if (PrecType_ == Ifpack2::JACOBI && OverlapLevel_ > 0) {
409 W_ = Teuchos::rcp(
new Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node>(A_->getRowMap()) );
410 W_->putScalar(Teuchos::ScalarTraits<Scalar>::zero());
411 Teuchos::ArrayRCP<Scalar > w_ptr = W_->getDataNonConst(0);
413 for (LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; ++i) {
414 for (
size_t j = 0 ; j < Partitioner_->numRowsInPart(i) ; ++j) {
415 int LID = (*Partitioner_)(i,j);
416 w_ptr[LID]+= Teuchos::ScalarTraits<Scalar>::one();
428 if (IsParallel_ && ((PrecType_ == Ifpack2::GS) || (PrecType_ == Ifpack2::SGS))) {
429 Importer_=A_->getGraph()->getImporter();
430 if(Importer_==Teuchos::null)
431 Importer_ = Teuchos::rcp(
new Tpetra::Import<LocalOrdinal,GlobalOrdinal,Node>(A_->getDomainMap(),
434 TEUCHOS_TEST_FOR_EXCEPTION(Importer_ == Teuchos::null, std::runtime_error,
435 "Ifpack2::BlockRelaxation::compute ERROR failed to create Importer_");
440 ComputeTime_ += Time_->totalElapsedTime();
445 template<
class MatrixType,
class ContainerType>
448 TEUCHOS_TEST_FOR_EXCEPTION(Partitioner_==Teuchos::null, std::runtime_error,
449 "Ifpack2::BlockRelaxation::ExtractSubmatrices, partitioner is null.");
451 NumLocalBlocks_ = Partitioner_->numLocalParts();
453 Containers_.resize(NumLocalBlocks_);
455 for (LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; ++i) {
456 size_t rows = Partitioner_->numRowsInPart(i);
457 Containers_[i] = Teuchos::rcp(
new ContainerType(rows) );
458 TEUCHOS_TEST_FOR_EXCEPTION(Containers_[i]==Teuchos::null, std::runtime_error,
459 "Ifpack2::BlockRelaxation::ExtractSubmatrices, container consturctor failed.");
461 Containers_[i]->setParameters(List_);
462 Containers_[i]->initialize();
466 for (
size_t j = 0 ; j < rows ; ++j) {
467 Containers_[i]->ID(j) = (*Partitioner_)(i,j);
470 Containers_[i]->compute(A_);
478 template<
class MatrixType,
class ContainerType>
480 const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& X,
481 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y)
const 483 size_t NumVectors = X.getNumVectors();
484 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> AY( Y.getMap(),NumVectors );
487 int starting_iteration=0;
488 if(ZeroStartingSolution_) {
490 starting_iteration=1;
493 for (
int j = starting_iteration; j < NumSweeps_ ; j++) {
495 AY.update(1.0,X,-1.0);
499 ApplyFlops_ += NumVectors * (2 * NumGlobalNonzeros_ + 2 * NumGlobalRows_);
506 template<
class MatrixType,
class ContainerType>
509 size_t NumVectors = X.getNumVectors();
510 Scalar one=Teuchos::ScalarTraits<Scalar>::one();
513 if (OverlapLevel_ == 0) {
515 for (LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; i++) {
517 if (Containers_[i]->getNumRows() == 0)
continue;
518 Containers_[i]->apply(X,Y,Teuchos::NO_TRANS,DampingFactor_,one);
519 ApplyFlops_ += NumVectors * 2 * NumGlobalRows_;
524 for (LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; i++) {
526 if (Containers_[i]->getNumRows() == 0)
continue;
527 Containers_[i]->weightedApply(X,Y,*W_,Teuchos::NO_TRANS,DampingFactor_,one);
529 ApplyFlops_ += NumVectors * 4 * NumGlobalRows_;
535 template<
class MatrixType,
class ContainerType>
537 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y)
const 540 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> Xcopy(X);
541 for (
int j = 0; j < NumSweeps_ ; j++) {
542 DoGaussSeidel(Xcopy,Y);
543 if(j != NumSweeps_-1)
550 template<
class MatrixType,
class ContainerType>
552 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y)
const 557 Scalar one=Teuchos::ScalarTraits<Scalar>::one();
558 int Length = A_->getNodeMaxNumRowEntries();
559 int NumVectors = X.getNumVectors();
560 Teuchos::Array<Scalar> Values;
561 Teuchos::Array<LocalOrdinal> Indices;
562 Values.resize(Length);
563 Indices.resize(Length);
568 Teuchos::RCP< Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node > > Y2;
570 Y2 = Teuchos::rcp(
new Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>(Importer_->getTargetMap(), NumVectors) );
572 Y2 = Teuchos::rcp( &Y,
false );
575 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > x_ptr = X.get2dViewNonConst();
576 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > y_ptr = Y.get2dViewNonConst();
577 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > y2_ptr = Y2->get2dViewNonConst();
580 if (IsParallel_) Y2->doImport(Y,*Importer_,Tpetra::INSERT);
582 for (LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; i++) {
584 if (Containers_[i]->getNumRows() == 0)
continue;
588 for (
size_t j = 0 ; j < Containers_[i]->getNumRows(); j++) {
589 LID = Containers_[i]->ID(j);
591 A_->getLocalRowCopy(LID,Indices(),Values(),NumEntries);
593 for (
size_t k = 0 ; k < NumEntries ; k++) {
594 LocalOrdinal col = Indices[k];
595 for (
int kk = 0 ; kk < NumVectors ; kk++)
596 x_ptr[kk][LID] -= Values[k] * y2_ptr[kk][col];
602 Containers_[i]->apply(X,*Y2,Teuchos::NO_TRANS,DampingFactor_,one);
605 ApplyFlops_ += NumVectors * (2 * NumGlobalNonzeros_ + 2 * NumGlobalRows_);
611 for (
int m = 0 ; m < NumVectors ; ++m)
612 for (
size_t i = 0 ; i < NumMyRows_ ; ++i)
613 y_ptr[m][i] = y2_ptr[m][i];
618 template<
class MatrixType,
class ContainerType>
620 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y)
const 623 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> Xcopy(X);
624 for (
int j = 0; j < NumSweeps_ ; j++) {
626 if(j != NumSweeps_-1)
632 template<
class MatrixType,
class ContainerType>
634 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Xcopy,
635 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y)
const 637 Scalar one=Teuchos::ScalarTraits<Scalar>::one();
638 int Length = A_->getNodeMaxNumRowEntries();
639 int NumVectors = X.getNumVectors();
640 Teuchos::Array<Scalar> Values;
641 Teuchos::Array<LocalOrdinal> Indices;
642 Values.resize(Length);
643 Indices.resize(Length);
648 Teuchos::RCP< Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node > > Y2;
650 Y2 = Teuchos::rcp(
new Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>(Importer_->getTargetMap(), NumVectors) );
652 Y2 = Teuchos::rcp( &Y,
false );
654 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> > x_ptr = X.get2dView();
655 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > xcopy_ptr = Xcopy.get2dViewNonConst();
656 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > y_ptr = Y.get2dViewNonConst();
657 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > y2_ptr = Y2->get2dViewNonConst();
660 if (IsParallel_) Y2->doImport(Y,*Importer_,Tpetra::INSERT);
663 for(LocalOrdinal i = 0 ; i < NumLocalBlocks_ ; i++) {
665 if (Containers_[i]->getNumRows() == 0)
continue;
669 for(
size_t j = 0 ; j < Containers_[i]->getNumRows(); j++) {
670 LID = Containers_[i]->ID(j);
672 A_->getLocalRowCopy(LID,Indices(),Values(),NumEntries);
674 for (
size_t k = 0 ; k < NumEntries ; k++) {
675 LocalOrdinal col = Indices[k];
676 for (
int kk = 0 ; kk < NumVectors ; kk++)
677 xcopy_ptr[kk][LID] -= Values[k] * y2_ptr[kk][col];
683 Containers_[i]->apply(Xcopy,*Y2,Teuchos::NO_TRANS,DampingFactor_,one);
686 ApplyFlops_ += NumVectors * (2 * NumGlobalNonzeros_ + 2 * NumGlobalRows_);
691 for(LocalOrdinal i = NumLocalBlocks_-1; i >=0 ; i--) {
693 if (Containers_[i]->getNumRows() == 0)
continue;
697 for(
size_t j = 0 ; j < Containers_[i]->getNumRows(); j++) {
698 LID = Containers_[i]->ID(j);
700 A_->getLocalRowCopy(LID,Indices(),Values(),NumEntries);
702 for (
size_t k = 0 ; k < NumEntries ; k++) {
703 LocalOrdinal col = Indices[k];
704 for (
int kk = 0 ; kk < NumVectors ; kk++)
705 xcopy_ptr[kk][LID] -= Values[k] * y2_ptr[kk][col];
712 Containers_[i]->apply(Xcopy,*Y2,Teuchos::NO_TRANS,DampingFactor_,one);
715 ApplyFlops_ += NumVectors * (2 * NumGlobalNonzeros_ + 2 * NumGlobalRows_);
722 for (
int m = 0 ; m < NumVectors ; ++m)
723 for (
size_t i = 0 ; i < NumMyRows_ ; ++i)
724 y_ptr[m][i] = y2_ptr[m][i];
728 template<
class MatrixType,
class ContainerType>
730 std::ostringstream oss;
731 oss << Teuchos::Describable::description();
734 oss <<
"{status = initialized, computed";
737 oss <<
"{status = initialized, not computed";
741 oss <<
"{status = not initialized, not computed";
744 if (PrecType_ == Ifpack2::JACOBI) oss <<
"Type = Block Jacobi, " << std::endl;
745 else if (PrecType_ == Ifpack2::GS) oss <<
"Type = Block Gauss-Seidel, " << std::endl;
746 else if (PrecType_ == Ifpack2::SGS) oss <<
"Type = Block Sym. Gauss-Seidel, " << std::endl;
748 oss <<
", global rows = " << A_->getGlobalNumRows()
749 <<
", global cols = " << A_->getGlobalNumCols();
756 template<
class MatrixType,
class ContainerType>
760 using Teuchos::VERB_DEFAULT;
761 using Teuchos::VERB_NONE;
762 using Teuchos::VERB_LOW;
763 using Teuchos::VERB_MEDIUM;
764 using Teuchos::VERB_HIGH;
765 using Teuchos::VERB_EXTREME;
766 Teuchos::EVerbosityLevel vl = verbLevel;
767 if (vl == VERB_DEFAULT) vl = VERB_LOW;
768 const int myImageID = A_->getComm()->getRank();
769 Teuchos::OSTab tab(out);
776 if (vl != VERB_NONE && myImageID == 0) {
779 out <<
"===============================================================================" << endl;
780 out <<
"Sweeps = " << NumSweeps_ << endl;
781 out <<
"damping factor = " << DampingFactor_ << endl;
782 if (PrecType_ == Ifpack2::GS && DoBackwardGS_) {
783 out <<
"Using backward mode (BGS only)" << endl;
785 if (ZeroStartingSolution_) { out <<
"Using zero starting solution" << endl; }
786 else { out <<
"Using input starting solution" << endl; }
787 if (Condest_ == -1.0) { out <<
"Condition number estimate = N/A" << endl; }
788 else { out <<
"Condition number estimate = " << Condest_ << endl; }
790 out <<
"Phase # calls Total Time (s) Total MFlops MFlops/s " << endl;
791 out <<
"------------ ------- --------------- --------------- ---------------" << endl;
799 out <<
"===============================================================================" << endl;
806 #endif // IFPACK2_BLOCKRELAXATION_DEF_HPP magnitudeType computeCondEst(CondestType CT=Cheap, LocalOrdinal MaxIters=1550, magnitudeType Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &matrix=Teuchos::null)
Computes the estimated condition number and returns the value.
Definition: Ifpack2_BlockRelaxation_def.hpp:247
double getApplyFlops() const
Returns the number of flops for the application of the preconditioner.
Definition: Ifpack2_BlockRelaxation_def.hpp:232
CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const
Returns the Tpetra::BlockMap object associated with the range of this matrix operator.
Definition: Ifpack2_BlockRelaxation_def.hpp:150
BlockRelaxation(const Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix)
BlockRelaxation constructor with given Tpetra::RowMatrix input.
Definition: Ifpack2_BlockRelaxation_def.hpp:53
std::string description() const
Return a simple one-line description of this object.
Definition: Ifpack2_BlockRelaxation_def.hpp:729
double getApplyTime() const
Returns the time spent in apply().
Definition: Ifpack2_BlockRelaxation_def.hpp:220
int getNumApply() const
Returns the number of calls to apply().
Definition: Ifpack2_BlockRelaxation_def.hpp:202
void getParameter(const Teuchos::ParameterList ¶ms, const std::string &name, T &value)
Set a value from a ParameterList if a parameter with the specified name exists.
Definition: Ifpack2_Parameters.hpp:59
int getNumCompute() const
Returns the number of calls to compute().
Definition: Ifpack2_BlockRelaxation_def.hpp:196
void setParameters(const Teuchos::ParameterList ¶ms)
Sets all the parameters for the preconditioner.
Definition: Ifpack2_BlockRelaxation_def.hpp:91
void compute()
compute the preconditioner for the specified matrix, diagonal perturbation thresholds and relaxation ...
Definition: Ifpack2_BlockRelaxation_def.hpp:388
Ifpack2::BlockRelaxation: defines relaxation preconditioners for Tpetra::RowMatrix objects...
Definition: Ifpack2_BlockRelaxation_decl.hpp:137
double getInitializeTime() const
Returns the time spent in initialize().
Definition: Ifpack2_BlockRelaxation_def.hpp:208
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 preconditioner to X, returns the result in Y.
Definition: Ifpack2_BlockRelaxation_def.hpp:268
double getComputeFlops() const
Returns the number of flops in the computation phase.
Definition: Ifpack2_BlockRelaxation_def.hpp:226
double getComputeTime() const
Returns the time spent in compute().
Definition: Ifpack2_BlockRelaxation_def.hpp:214
bool isComputed() const
Return true if compute() has been called.
Definition: Ifpack2_BlockRelaxation_decl.hpp:191
virtual ~BlockRelaxation()
BlockRelaxation Destructor.
Definition: Ifpack2_BlockRelaxation_def.hpp:86
bool isInitialized() const
Returns true if the preconditioner has been successfully initialized.
Definition: Ifpack2_BlockRelaxation_decl.hpp:183
int getNumInitialize() const
Returns the number of calls to initialize().
Definition: Ifpack2_BlockRelaxation_def.hpp:190
void initialize()
Initialize.
Definition: Ifpack2_BlockRelaxation_def.hpp:345
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_BlockRelaxation_def.hpp:757
const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Definition: Ifpack2_BlockRelaxation_def.hpp:178
const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Definition: Ifpack2_BlockRelaxation_def.hpp:169
magnitudeType getCondEst() const
Returns the computed estimated condition number, or -1.0 if no computed.
Definition: Ifpack2_BlockRelaxation_def.hpp:239
Definition: Ifpack2_BlockRelaxation_decl.hpp:64
void applyMat(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS) const
Applies the matrix to a Tpetra::MultiVector.
Definition: Ifpack2_BlockRelaxation_def.hpp:325
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMatrix() const
Returns a reference to the matrix to be preconditioned.
Definition: Ifpack2_BlockRelaxation_def.hpp:160
void getValidParameters(Teuchos::ParameterList ¶ms)
Fills a list which contains all the parameters possibly used by Ifpack2.
Definition: Ifpack2_Parameters.cpp:47
Ifpack2::LinearPartitioner: A class to define linear partitions.
Definition: Ifpack2_LinearPartitioner_decl.hpp:54