00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "Ifpack_OverlapFactor.h"
00031 #include "Epetra_Comm.h"
00032 #include "Epetra_Map.h"
00033 #include "Epetra_CrsGraph.h"
00034 #include "Epetra_CrsMatrix.h"
00035 #include "Epetra_VbrMatrix.h"
00036 #include "Epetra_RowMatrix.h"
00037 #include "Epetra_Vector.h"
00038 #include "Epetra_MultiVector.h"
00039
00040
00041 Ifpack_OverlapFactor::Ifpack_OverlapFactor(const Ifpack_OverlapGraph * OverlapGraph)
00042 : Factored_(false),
00043 Allocated_(false),
00044 ValuesInitialized_(false),
00045 OverlapGraph_(OverlapGraph),
00046 UserMatrix_(0)
00047 {
00048 }
00049
00050 Ifpack_OverlapFactor::Ifpack_OverlapFactor(const Epetra_RowMatrix * UserMatrix)
00051 : Factored_(false),
00052 Allocated_(false),
00053 ValuesInitialized_(false),
00054 OverlapGraph_(0),
00055 UserMatrix_(UserMatrix)
00056 {
00057 }
00058
00059 Ifpack_OverlapFactor::Ifpack_OverlapFactor(const Ifpack_OverlapFactor & Source)
00060 : Factored_(Source.Factored_),
00061 Allocated_(Source.Allocated_),
00062 ValuesInitialized_(Source.ValuesInitialized_),
00063 OverlapGraph_(Source.OverlapGraph_),
00064 UserMatrix_(Source.UserMatrix_)
00065 {
00066 }
00067
00068 int Ifpack_OverlapFactor::InitValues(const Epetra_RowMatrix * UserMatrix) {
00069
00070
00071 if (OverlapGraph_!=0) {
00072
00073 Epetra_CrsMatrix * CrsMatrix = dynamic_cast<Epetra_CrsMatrix *>(UserMatrix);
00074 if (CrsMatrix!=0)
00075 if (!Allocated()) EPETRA_CHK_ERR(-1);
00076 if (ValuesInitialized()) EPETRA_CHK_ERR(1);
00077
00078 EPETRA_CHK_ERR(DerivedFactor());
00079 SetValuesInitialized(false);
00080 SetFactored(true);
00081 return(0);
00082 }
00083
00084 int Ifpack_OverlapFactor::Factor() {
00085
00086 if (!ValuesInitialized()) EPETRA_CHK_ERR(-1);
00087 if (Factored()) EPETRA_CHK_ERR(1);
00088
00089 EPETRA_CHK_ERR(DerivedFactor());
00090 SetValuesInitialized(false);
00091 SetFactored(true);
00092 return(0);
00093 }