44 #ifndef IFPACK_ADDITIVESCHWARZ_H
45 #define IFPACK_ADDITIVESCHWARZ_H
47 #include "Ifpack_ConfigDefs.h"
48 #include "Ifpack_Preconditioner.h"
49 #include "Ifpack_ConfigDefs.h"
50 #include "Ifpack_Preconditioner.h"
51 #include "Ifpack_Reordering.h"
52 #include "Ifpack_RCMReordering.h"
53 #include "Ifpack_METISReordering.h"
54 #include "Ifpack_LocalFilter.h"
55 #include "Ifpack_NodeFilter.h"
56 #ifdef IFPACK_SUBCOMM_CODE
57 #include "Ifpack_SubdomainFilter.h"
59 #include "Ifpack_SingletonFilter.h"
60 #include "Ifpack_ReorderFilter.h"
62 #include "Ifpack_OverlappingRowMatrix.h"
63 #include "Epetra_CombineMode.h"
64 #include "Epetra_MultiVector.h"
65 #include "Epetra_Map.h"
66 #include "Epetra_Comm.h"
67 #include "Epetra_Time.h"
68 #include "Epetra_LinearProblem.h"
69 #include "Epetra_RowMatrix.h"
70 #include "Epetra_CrsMatrix.h"
71 #include "Teuchos_ParameterList.hpp"
72 #include "Teuchos_RefCountPtr.hpp"
74 #ifdef IFPACK_SUBCOMM_CODE
75 #include "EpetraExt_Reindex_CrsMatrix.h"
76 #include "EpetraExt_Reindex_MultiVector.h"
78 #ifdef IFPACK_NODE_AWARE_CODE
79 #include "EpetraExt_OperatorOut.h"
80 #include "EpetraExt_RowMatrixOut.h"
81 #include "EpetraExt_BlockMapOut.h"
84 #ifdef HAVE_IFPACK_AMESOS
85 #include "Ifpack_AMDReordering.h"
162 int OverlapLevel_in = 0);
196 virtual int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
210 virtual int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
213 virtual double NormInf()
const;
219 virtual const char *
Label()
const;
228 virtual const Epetra_Comm &
Comm()
const;
282 virtual double Condest(
const Ifpack_CondestType CT = Ifpack_Cheap,
283 const int MaxIters = 1550,
284 const double Tol = 1e-9,
285 Epetra_RowMatrix* Matrix_in = 0);
294 virtual const Epetra_RowMatrix&
Matrix()
const
306 virtual std::ostream&
Print(std::ostream&)
const;
308 virtual const T* Inverse()
const
372 virtual const Teuchos::ParameterList&
List()
const
395 Teuchos::RefCountPtr<const Epetra_RowMatrix>
Matrix_;
404 #ifdef IFPACK_SUBCOMM_CODE
408 Teuchos::RCP<Epetra_CrsMatrix> SubdomainCrsMatrix_;
410 Teuchos::RCP<Epetra_CrsMatrix> ReindexedCrsMatrix_;
414 Teuchos::RCP<Epetra_Map> tempMap_;
415 Teuchos::RCP<Epetra_Map> tempDomainMap_;
416 Teuchos::RCP<Epetra_Map> tempRangeMap_;
417 Teuchos::RCP<EpetraExt::CrsMatrix_Reindex> SubdomainMatrixReindexer_;
418 Teuchos::RCP<EpetraExt::MultiVector_Reindex> DomainVectorReindexer_;
419 Teuchos::RCP<EpetraExt::MultiVector_Reindex> RangeVectorReindexer_;
420 mutable Teuchos::RCP<Epetra_MultiVector> tempX_;
421 mutable Teuchos::RCP<Epetra_MultiVector> tempY_;
423 # ifdef IFPACK_NODE_AWARE_CODE
429 #ifdef IFPACK_SUBCOMM_CODE
436 int NumMpiProcsPerSubdomain_;
493 Teuchos::RefCountPtr<Epetra_Time>
Time_;
497 #ifdef IFPACK_SUBCOMM_CODE
498 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingX;
499 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingY;
501 # ifdef IFPACK_NODE_AWARE_CODE
502 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingX;
503 mutable Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingY;
512 int OverlapLevel_in) :
513 #ifdef IFPACK_SUBCOMM_CODE
516 NumMpiProcsPerSubdomain_(1),
520 IsInitialized_(false),
522 UseTranspose_(false),
523 IsOverlapping_(false),
524 OverlapLevel_(OverlapLevel_in),
527 ComputeCondest_(true),
528 UseReordering_(false),
529 ReorderingType_(
"none"),
530 FilterSingletons_(false),
534 InitializeTime_(0.0),
536 ApplyInverseTime_(0.0),
537 InitializeFlops_(0.0),
539 ApplyInverseFlops_(0.0)
542 Matrix_ = Teuchos::rcp( Matrix_in,
false );
544 if (
Matrix_->Comm().NumProc() == 1)
550 Teuchos::ParameterList List_in;
554 #ifdef IFPACK_NODE_AWARE_CODE
555 extern int ML_NODE_ID;
563 Epetra_RowMatrix* MatrixPtr;
565 #ifndef IFPACK_SUBCOMM_CODE
566 # ifdef IFPACK_NODE_AWARE_CODE
584 try{ nodeID = List_.get(
"ML node id",0);}
585 catch(...){fprintf(stderr,
"%s",
"Ifpack_AdditiveSchwarz<T>::Setup(): no parameter \"ML node id\"\n\n");
586 cout << List_ << endl;}
591 if (OverlappingMatrix_ != Teuchos::null)
593 #ifdef IFPACK_SUBCOMM_CODE
594 if (NumMpiProcsPerSubdomain_ > 1) {
595 LocalizedMatrix_ = Teuchos::rcp(
new Ifpack_SubdomainFilter(OverlappingMatrix_, SubdomainId_));
600 # ifdef IFPACK_NODE_AWARE_CODE
601 Ifpack_NodeFilter *tt =
new Ifpack_NodeFilter(OverlappingMatrix_,nodeID);
602 LocalizedMatrix_ = Teuchos::rcp(tt);
611 #ifdef IFPACK_SUBCOMM_CODE
612 if (NumMpiProcsPerSubdomain_ > 1) {
613 LocalizedMatrix_ = Teuchos::rcp(
new Ifpack_SubdomainFilter(Matrix_, SubdomainId_));
618 # ifdef IFPACK_NODE_AWARE_CODE
619 Ifpack_NodeFilter *tt =
new Ifpack_NodeFilter(Matrix_,nodeID);
620 LocalizedMatrix_ = Teuchos::rcp(tt);
629 fprintf(stderr,
"%s",
"AdditiveSchwarz Setup: problem creating local filter matrix.\n");
632 if (LocalizedMatrix_ == Teuchos::null)
636 if (FilterSingletons_) {
638 MatrixPtr = &*SingletonFilter_;
641 MatrixPtr = &*LocalizedMatrix_;
643 if (UseReordering_) {
646 if (ReorderingType_ ==
"rcm")
648 else if (ReorderingType_ ==
"metis")
650 #ifdef HAVE_IFPACK_AMESOS
651 else if (ReorderingType_ ==
"amd" )
655 cerr <<
"reordering type not correct (" << ReorderingType_ <<
")" << endl;
658 if (Reordering_ == Teuchos::null) IFPACK_CHK_ERR(-5);
660 IFPACK_CHK_ERR(Reordering_->SetParameters(List_));
661 IFPACK_CHK_ERR(Reordering_->Compute(*MatrixPtr));
664 ReorderedLocalizedMatrix_ =
667 if (ReorderedLocalizedMatrix_ == Teuchos::null) IFPACK_CHK_ERR(-5);
669 MatrixPtr = &*ReorderedLocalizedMatrix_;
672 #ifdef IFPACK_SUBCOMM_CODE
677 SubdomainCrsMatrix_.reset(
new Epetra_CrsMatrix(Copy, MatrixPtr->RowMatrixRowMap(), -1));
678 Teuchos::RCP<Epetra_Import> tempImporter = Teuchos::rcp(
new Epetra_Import(SubdomainCrsMatrix_->Map(), MatrixPtr->Map()));
679 SubdomainCrsMatrix_->Import(*MatrixPtr, *tempImporter, Insert);
680 SubdomainCrsMatrix_->FillComplete();
682 tempMap_.reset(
new Epetra_Map(SubdomainCrsMatrix_->RowMap().NumGlobalElements(),
683 SubdomainCrsMatrix_->RowMap().NumMyElements(),
684 0, SubdomainCrsMatrix_->Comm()));
685 tempRangeMap_.reset(
new Epetra_Map(SubdomainCrsMatrix_->OperatorRangeMap().NumGlobalElements(),
686 SubdomainCrsMatrix_->OperatorRangeMap().NumMyElements(),
687 0, SubdomainCrsMatrix_->Comm()));
688 tempDomainMap_.reset(
new Epetra_Map(SubdomainCrsMatrix_->OperatorDomainMap().NumGlobalElements(),
689 SubdomainCrsMatrix_->OperatorDomainMap().NumMyElements(),
690 0, SubdomainCrsMatrix_->Comm()));
692 SubdomainMatrixReindexer_.reset(
new EpetraExt::CrsMatrix_Reindex(*tempMap_));
693 DomainVectorReindexer_.reset(
new EpetraExt::MultiVector_Reindex(*tempDomainMap_));
694 RangeVectorReindexer_.reset(
new EpetraExt::MultiVector_Reindex(*tempRangeMap_));
696 ReindexedCrsMatrix_.reset(&((*SubdomainMatrixReindexer_)(*SubdomainCrsMatrix_)),
false);
698 MatrixPtr = &*ReindexedCrsMatrix_;
700 Inverse_ = Teuchos::rcp(
new T(&*ReindexedCrsMatrix_) );
702 Inverse_ = Teuchos::rcp(
new T(MatrixPtr) );
705 if (Inverse_ == Teuchos::null)
715 #ifdef IFPACK_SUBCOMM_CODE
716 MpiRank_ = Matrix_->Comm().MyPID();
717 NumMpiProcs_ = Matrix_->Comm().NumProc();
718 NumMpiProcsPerSubdomain_ = List_in.get(
"subdomain: number-of-processors", 1);
719 NumSubdomains_ = NumMpiProcs_ / NumMpiProcsPerSubdomain_;
720 SubdomainId_ = MpiRank_ / NumMpiProcsPerSubdomain_;
722 if (NumSubdomains_ == 1) {
723 IsOverlapping_ =
false;
728 ComputeCondest_ = List_in.get(
"schwarz: compute condest", ComputeCondest_);
730 if( Teuchos::ParameterEntry *combineModeEntry = List_in.getEntryPtr(
"schwarz: combine mode") )
732 if(
typeid(std::string) == combineModeEntry->getAny().type() )
734 std::string mode = List_in.get(
"schwarz: combine mode",
"Add");
737 else if (mode ==
"Zero")
739 else if (mode ==
"Insert")
740 CombineMode_ = Insert;
741 else if (mode ==
"InsertAdd")
742 CombineMode_ = InsertAdd;
743 else if (mode ==
"Average")
744 CombineMode_ = Average;
745 else if (mode ==
"AbsMax")
746 CombineMode_ = AbsMax;
749 TEUCHOS_TEST_FOR_EXCEPTION(
750 true,std::logic_error
751 ,
"Error, The (Epetra) combine mode of \""<<mode<<
"\" is not valid! Only the values"
752 " \"Add\", \"Zero\", \"Insert\", \"InsertAdd\", \"Average\", and \"AbsMax\" are accepted!"
756 else if (
typeid(Epetra_CombineMode) == combineModeEntry->getAny().type() )
758 CombineMode_ = Teuchos::any_cast<Epetra_CombineMode>(combineModeEntry->getAny());
763 Teuchos::getParameter<std::string>(List_in,
"schwarz: combine mode");
769 List_in.get(
"schwarz: combine mode",
"Zero");
772 ReorderingType_ = List_in.get(
"schwarz: reordering type", ReorderingType_);
773 if (ReorderingType_ ==
"none")
774 UseReordering_ =
false;
776 UseReordering_ =
true;
781 FilterSingletons_ = List_in.get(
"schwarz: filter singletons", FilterSingletons_);
793 IsInitialized_ =
false;
797 if (Time_ == Teuchos::null)
798 Time_ = Teuchos::rcp(
new Epetra_Time(Comm()) );
800 Time_->ResetStartTime();
803 if (IsOverlapping_) {
804 #ifdef IFPACK_SUBCOMM_CODE
805 if (NumMpiProcsPerSubdomain_ > 1) {
811 # ifdef IFPACK_NODE_AWARE_CODE
813 try{ myNodeID = List_.get(
"ML node id",-1);}
814 catch(...){fprintf(stderr,
"pid %d: no such entry (returned %d)\n",Comm().MyPID(),myNodeID);}
826 if (OverlappingMatrix_ == Teuchos::null) {
831 # ifdef IFPACK_NODE_AWARE_CODE
838 IFPACK_CHK_ERR(Setup());
840 # ifdef IFPACK_NODE_AWARE_CODE
847 if (Inverse_ == Teuchos::null)
850 if (LocalizedMatrix_ == Teuchos::null)
853 IFPACK_CHK_ERR(Inverse_->SetUseTranspose(UseTranspose()));
854 IFPACK_CHK_ERR(Inverse_->SetParameters(List_));
855 IFPACK_CHK_ERR(Inverse_->Initialize());
858 Label_ =
"Ifpack_AdditiveSchwarz, ";
860 Label_ +=
", transp";
862 +
", local solver = \n\t\t***** `" + string(Inverse_->Label()) +
"'";
864 IsInitialized_ =
true;
866 InitializeTime_ += Time_->ElapsedTime();
868 #ifdef IFPACK_FLOPCOUNTERS
872 double partial = Inverse_->InitializeFlops();
874 Comm().SumAll(&partial, &total, 1);
875 InitializeFlops_ += total;
885 if (IsInitialized() ==
false)
886 IFPACK_CHK_ERR(Initialize());
888 Time_->ResetStartTime();
892 IFPACK_CHK_ERR(Inverse_->Compute());
896 ComputeTime_ += Time_->ElapsedTime();
898 #ifdef IFPACK_FLOPCOUNTERS
900 double partial = Inverse_->ComputeFlops();
902 Comm().SumAll(&partial, &total, 1);
903 ComputeFlops_ += total;
909 R = ReorderingType_ +
" reord, ";
912 Condest(Ifpack_Cheap);
915 Label_ =
"Ifpack_AdditiveSchwarz, ov = " +
Ifpack_toString(OverlapLevel_)
916 +
", local solver = \n\t\t***** `" + string(Inverse_->Label()) +
"'"
917 +
"\n\t\t***** " + R +
"Condition number estimate = "
929 UseTranspose_ = UseTranspose_in;
932 if (Inverse_!=Teuchos::null)
933 IFPACK_CHK_ERR(Inverse_->SetUseTranspose(UseTranspose_in));
940 Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const
942 IFPACK_CHK_ERR(Matrix_->Apply(X,Y));
957 return(Label_.c_str());
964 return(UseTranspose_);
978 return(Matrix_->Comm());
985 return(Matrix_->OperatorDomainMap());
992 return(Matrix_->OperatorRangeMap());
1004 int NumVectors = X.NumVectors();
1006 if (NumVectors != Y.NumVectors())
1009 Time_->ResetStartTime();
1011 Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingX;
1012 Teuchos::RefCountPtr<Epetra_MultiVector> OverlappingY;
1013 Teuchos::RefCountPtr<Epetra_MultiVector> Xtmp;
1016 #ifdef IFPACK_FLOPCOUNTERS
1017 double pre_partial = Inverse_->ApplyInverseFlops();
1019 Comm().SumAll(&pre_partial, &pre_total, 1);
1023 if (IsOverlapping()) {
1024 #ifdef IFPACK_SUBCOMM_CODE
1025 if (OverlappingX == Teuchos::null) {
1026 OverlappingX = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(), X.NumVectors()) );
1027 if (OverlappingX == Teuchos::null) IFPACK_CHK_ERR(-5);
1028 }
else assert(OverlappingX->NumVectors() == X.NumVectors());
1029 if (OverlappingY == Teuchos::null) {
1030 OverlappingY = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(), Y.NumVectors()) );
1031 if (OverlappingY == Teuchos::null) IFPACK_CHK_ERR(-5);
1032 }
else assert(OverlappingY->NumVectors() == Y.NumVectors());
1034 # ifdef IFPACK_NODE_AWARE_CODE
1035 if (OverlappingX == Teuchos::null) {
1036 OverlappingX = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(),
1038 if (OverlappingX == Teuchos::null) IFPACK_CHK_ERR(-5);
1039 }
else assert(OverlappingX->NumVectors() == X.NumVectors());
1040 if (OverlappingY == Teuchos::null) {
1041 OverlappingY = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(),
1043 if (OverlappingY == Teuchos::null) IFPACK_CHK_ERR(-5);
1044 }
else assert(OverlappingY->NumVectors() == Y.NumVectors());
1046 OverlappingX = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(),
1048 OverlappingY = Teuchos::rcp(
new Epetra_MultiVector(OverlappingMatrix_->RowMatrixRowMap(),
1050 if (OverlappingY == Teuchos::null) IFPACK_CHK_ERR(-5);
1053 OverlappingY->PutScalar(0.0);
1054 OverlappingX->PutScalar(0.0);
1055 IFPACK_CHK_ERR(OverlappingMatrix_->ImportMultiVector(X,*OverlappingX,Insert));
1061 Xtmp = Teuchos::rcp(
new Epetra_MultiVector(X) );
1062 OverlappingX = Xtmp;
1063 OverlappingY = Teuchos::rcp( &Y,
false );
1066 if (FilterSingletons_) {
1068 Epetra_MultiVector ReducedX(SingletonFilter_->Map(),NumVectors);
1069 Epetra_MultiVector ReducedY(SingletonFilter_->Map(),NumVectors);
1070 IFPACK_CHK_ERR(SingletonFilter_->SolveSingletons(*OverlappingX,*OverlappingY));
1071 IFPACK_CHK_ERR(SingletonFilter_->CreateReducedRHS(*OverlappingY,*OverlappingX,ReducedX));
1074 if (!UseReordering_) {
1075 IFPACK_CHK_ERR(Inverse_->ApplyInverse(ReducedX,ReducedY));
1078 Epetra_MultiVector ReorderedX(ReducedX);
1079 Epetra_MultiVector ReorderedY(ReducedY);
1080 IFPACK_CHK_ERR(Reordering_->P(ReducedX,ReorderedX));
1081 IFPACK_CHK_ERR(Inverse_->ApplyInverse(ReorderedX,ReorderedY));
1082 IFPACK_CHK_ERR(Reordering_->Pinv(ReorderedY,ReducedY));
1086 IFPACK_CHK_ERR(SingletonFilter_->UpdateLHS(ReducedY,*OverlappingY));
1090 if (!UseReordering_) {
1091 #ifdef IFPACK_SUBCOMM_CODE
1092 tempX_.reset(&((*RangeVectorReindexer_)(*OverlappingX)),
false);
1093 tempY_.reset(&((*DomainVectorReindexer_)(*OverlappingY)),
false);
1094 IFPACK_CHK_ERR(Inverse_->ApplyInverse(*tempX_,*tempY_));
1096 IFPACK_CHK_ERR(Inverse_->ApplyInverse(*OverlappingX,*OverlappingY));
1100 Epetra_MultiVector ReorderedX(*OverlappingX);
1101 Epetra_MultiVector ReorderedY(*OverlappingY);
1102 IFPACK_CHK_ERR(Reordering_->P(*OverlappingX,ReorderedX));
1103 IFPACK_CHK_ERR(Inverse_->ApplyInverse(ReorderedX,ReorderedY));
1104 IFPACK_CHK_ERR(Reordering_->Pinv(ReorderedY,*OverlappingY));
1108 if (IsOverlapping()) {
1109 IFPACK_CHK_ERR(OverlappingMatrix_->ExportMultiVector(*OverlappingY,Y,
1113 #ifdef IFPACK_FLOPCOUNTERS
1116 double partial = Inverse_->ApplyInverseFlops();
1118 Comm().SumAll(&partial, &total, 1);
1119 ApplyInverseFlops_ += total - pre_total;
1124 ApplyInverseTime_ += Time_->ElapsedTime();
1131 template<
typename T>
1135 #ifdef IFPACK_FLOPCOUNTERS
1136 double IF = InitializeFlops();
1137 double CF = ComputeFlops();
1138 double AF = ApplyInverseFlops();
1140 double IFT = 0.0, CFT = 0.0, AFT = 0.0;
1141 if (InitializeTime() != 0.0)
1142 IFT = IF / InitializeTime();
1143 if (ComputeTime() != 0.0)
1144 CFT = CF / ComputeTime();
1145 if (ApplyInverseTime() != 0.0)
1146 AFT = AF / ApplyInverseTime();
1149 if (Matrix().Comm().MyPID())
1153 os <<
"================================================================================" << endl;
1154 os <<
"Ifpack_AdditiveSchwarz, overlap level = " << OverlapLevel_ << endl;
1155 if (CombineMode_ == Insert)
1156 os <<
"Combine mode = Insert" << endl;
1157 else if (CombineMode_ == Add)
1158 os <<
"Combine mode = Add" << endl;
1159 else if (CombineMode_ == Zero)
1160 os <<
"Combine mode = Zero" << endl;
1161 else if (CombineMode_ == Average)
1162 os <<
"Combine mode = Average" << endl;
1163 else if (CombineMode_ == AbsMax)
1164 os <<
"Combine mode = AbsMax" << endl;
1166 os <<
"Condition number estimate = " << Condest_ << endl;
1167 os <<
"Global number of rows = " << Matrix_->NumGlobalRows() << endl;
1169 #ifdef IFPACK_SUBCOMM_CODE
1171 os <<
"================================================================================" << endl;
1172 os <<
"Subcommunicator stats" << endl;
1173 os <<
"Number of MPI processes in simulation: " << NumMpiProcs_ << endl;
1174 os <<
"Number of subdomains: " << NumSubdomains_ << endl;
1175 os <<
"Number of MPI processes per subdomain: " << NumMpiProcsPerSubdomain_ << endl;
1179 os <<
"Phase # calls Total Time (s) Total MFlops MFlops/s" << endl;
1180 os <<
"----- ------- -------------- ------------ --------" << endl;
1181 os <<
"Initialize() " << std::setw(5) << NumInitialize()
1182 <<
" " << std::setw(15) << InitializeTime()
1183 #ifdef IFPACK_FLOPCOUNTERS
1184 <<
" " << std::setw(15) << 1.0e-6 * IF
1185 <<
" " << std::setw(15) << 1.0e-6 * IFT
1188 os <<
"Compute() " << std::setw(5) << NumCompute()
1189 <<
" " << std::setw(15) << ComputeTime()
1190 #ifdef IFPACK_FLOPCOUNTERS
1191 <<
" " << std::setw(15) << 1.0e-6 * CF
1192 <<
" " << std::setw(15) << 1.0e-6 * CFT
1195 os <<
"ApplyInverse() " << std::setw(5) << NumApplyInverse()
1196 <<
" " << std::setw(15) << ApplyInverseTime()
1197 #ifdef IFPACK_FLOPCOUNTERS
1198 <<
" " << std::setw(15) << 1.0e-6 * AF
1199 <<
" " << std::setw(15) << 1.0e-6 * AFT
1202 os <<
"================================================================================" << endl;
1208 #include "Ifpack_Condest.h"
1210 template<
typename T>
1212 Condest(
const Ifpack_CondestType CT,
const int MaxIters,
1213 const double Tol, Epetra_RowMatrix* Matrix_in)
1218 Condest_ = Ifpack_Condest(*
this, CT, MaxIters, Tol, Matrix_in);
1223 #endif // IFPACK_ADDITIVESCHWARZ_H
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the preconditioner to X, returns the result in Y.
int Setup()
Sets up the localized matrix and the singleton filter.
int OverlapLevel_
Level of overlap among the processors.
Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_
Pointers to the matrix to be preconditioned.
string ReorderingType_
Type of reordering of the local matrix.
double ComputeFlops_
Contains the number of flops for Compute().
virtual int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied (not implemented).
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Ifpack_AMDReordering: approximate minimum degree reordering.
bool UseTranspose_
If true, solve with the transpose (not supported by all solvers).
virtual double ComputeFlops() const
Returns the number of flops in the computation phase.
bool ComputeCondest_
If true, compute the condition number estimate each time Compute() is called.
double Condest_
Contains the estimated condition number.
virtual bool IsInitialized() const
Returns true if the preconditioner has been successfully initialized.
Ifpack_METISReordering: A class to reorder a graph using METIS.
double ApplyInverseFlops_
Contain sthe number of flops for ApplyInverse().
string Ifpack_toString(const int &x)
Convertes an integer to string.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
Teuchos::RefCountPtr< Ifpack_OverlappingRowMatrix > OverlappingMatrix_
Pointers to the overlapping matrix.
virtual int OverlapLevel() const
Returns the level of overlap.
virtual double ApplyInverseTime() const
Returns the time spent in ApplyInverse().
virtual bool IsOverlapping() const
Returns true is an overlapping matrix is present.
virtual double ComputeTime() const
Returns the time spent in Compute().
Teuchos::RefCountPtr< Ifpack_Reordering > Reordering_
Pointer to a reordering object.
virtual double ApplyInverseFlops() const
Returns the number of flops in the application of the preconditioner.
Teuchos::RefCountPtr< Ifpack_ReorderFilter > ReorderedLocalizedMatrix_
Pointer to the reorderd matrix.
virtual int NumInitialize() const
Returns the number of calls to Initialize().
bool IsOverlapping_
If true, overlapping is used.
virtual std::ostream & Print(std::ostream &) const
Prints major information about this preconditioner.
virtual int Initialize()
Initialized the preconditioner.
Ifpack_AdditiveSchwarz(const Ifpack_AdditiveSchwarz &RHS)
Copy constructor (should never be used)
double ComputeTime_
Contains the time for all successful calls to Compute().
Ifpack_RCMReordering: reverse Cuthill-McKee reordering.
Ifpack_AdditiveSchwarz: a class to define Additive Schwarz preconditioners of Epetra_RowMatrix's.
virtual int NumApplyInverse() const
Returns the number of calls to ApplyInverse().
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
Ifpack_AdditiveSchwarz(Epetra_RowMatrix *Matrix_in, int OverlapLevel_in=0)
Ifpack_AdditiveSchwarz constructor with given Epetra_RowMatrix.
double InitializeFlops_
Contains the number of flops for Initialize().
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Ifpack_SingletonFilter: Filter based on matrix entries.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the matrix to X, returns the result in Y.
virtual ~Ifpack_AdditiveSchwarz()
Destructor.
Ifpack_OverlappingRowMatrix: matrix with ghost rows, based on Epetra_RowMatrix.
Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows a...
bool IsInitialized_
If true, the preconditioner has been successfully initialized.
string Label_
Contains the label of this object.
int NumInitialize_
Contains the number of successful calls to Initialize().
virtual int SetParameters(Teuchos::ParameterList &List)
Sets the parameters.
bool UseReordering_
If true, reorder the local matrix.
virtual int Compute()
Computes the preconditioner.
int NumApplyInverse_
Contains the number of successful call to ApplyInverse().
Teuchos::RefCountPtr< Ifpack_SingletonFilter > SingletonFilter_
filtering object.
double InitializeTime_
Contains the time for all successful calls to Initialize().
virtual double InitializeFlops() const
Returns the number of flops in the initialization phase.
bool IsComputed_
If true, the preconditioner has been successfully computed.
virtual const Teuchos::ParameterList & List() const
Returns a reference to the internally stored list.
virtual const char * Label() const
Returns a character string describing the operator.
Teuchos::RefCountPtr< T > Inverse_
Pointer to the local solver.
int NumCompute_
Contains the number of successful call to Compute().
virtual double InitializeTime() const
Returns the time spent in Initialize().
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
double ApplyInverseTime_
Contains the time for all successful calls to ApplyInverse().
Ifpack_ReorderFilter: a class for light-weight reorder of local rows and columns of an Epetra_RowMatr...
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented)
Teuchos::ParameterList List_
Stores a copy of the list given in SetParameters()
Epetra_CombineMode CombineMode_
Combine mode for off-process elements (only if overlap is used)
virtual const Epetra_RowMatrix & Matrix() const
Returns a refernence to the internally stored matrix.
bool FilterSingletons_
Filter for singletons.
virtual double Condest() const
Returns the estimated condition number, or -1.0 if not computed.
virtual int NumCompute() const
Returns the number of calls to Compute().
Teuchos::RefCountPtr< Epetra_Time > Time_
Object used for timing purposes.
Teuchos::RefCountPtr< Ifpack_LocalFilter > LocalizedMatrix_
Localized version of Matrix_ or OverlappingMatrix_.