46 #include "Epetra_MpiComm.h"
48 #include "Epetra_SerialComm.h"
50 #include "Epetra_CrsMatrix.h"
51 #include "Epetra_Vector.h"
52 #include "Epetra_LinearProblem.h"
53 #include "Epetra_Map.h"
54 #include "Epetra_Import.h"
55 #include "Epetra_Time.h"
56 #include "Galeri_Maps.h"
57 #include "Galeri_CrsMatrices.h"
58 #include "Teuchos_ParameterList.hpp"
59 #include "Teuchos_RCP.hpp"
66 int main(
int argc,
char *argv[])
69 MPI_Init(&argc,&argv);
80 cout <<
"Test `TestOverlappingRowMatrix.exe' passed!" << endl;
86 GaleriList.
set(
"n", nx * nx);
87 GaleriList.
set(
"nx", nx);
88 GaleriList.
set(
"ny", nx);
90 (Galeri::CreateMap (
"Linear", Comm, GaleriList));
92 (Galeri::CreateCrsMatrix (
"Laplace2D", Map.
getRawPtr (), GaleriList));
104 if (Comm.
MyPID() == 0)
105 cout <<
"Time to create B = " << Time.
ElapsedTime() << endl;
112 for (
int i = 0 ; i < A->
NumMyRows() ; ++i)
118 ExtY_B.PutScalar(0.0);
126 if (Comm.
MyPID() == 0)
127 cout <<
"Norm of Y using B = " << Norm_B << endl;
135 if (Comm.
MyPID() == 0)
136 cout <<
"Time to create C = " << Time.
ElapsedTime() << endl;
142 if (NumGlobalRowsB != NumGlobalRowsC) {
143 std::ostringstream os;
144 os <<
"NumGlobalRowsB = " << NumGlobalRowsB
145 <<
" != NumGlobalRowsC = " << NumGlobalRowsC
147 throw std::logic_error (os.str ());
149 if (NumGlobalNonzerosB != NumGlobalNonzerosC) {
150 std::ostringstream os;
151 os <<
"NumGlobalNonzerosB = " << NumGlobalNonzerosB
152 <<
" != NumGlobalNonzerosC = " << NumGlobalNonzerosC
154 throw std::logic_error (os.str ());
159 ExtY_C.PutScalar(0.0);
166 if (Comm.
MyPID() == 0)
167 cout <<
"Norm of Y using C = " << Norm_C << endl;
182 if (Comm.
MyPID() == 0)
183 cout <<
"Test `TestOverlappingRowMatrix.exe' passed!" << endl;
185 return(EXIT_SUCCESS);
int Multiply(bool TransA, const Epetra_Vector &x, Epetra_Vector &y) const
double ElapsedTime(void) const
int NumGlobalRows() const
const Epetra_Map & RowMatrixRowMap() const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Epetra_CrsMatrix * Ifpack_CreateOverlappingCrsMatrix(const Epetra_RowMatrix *Matrix, const int OverlappingLevel)
Creates an overlapping Epetra_CrsMatrix. Returns 0 if OverlappingLevel is 0.
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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...
int main(int argc, char *argv[])
int NumGlobalNonzeros() const
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
int ImportMultiVector(const Epetra_MultiVector &X, Epetra_MultiVector &OvX, Epetra_CombineMode CM=Insert)
virtual int NumGlobalRows() const
Returns the number of global matrix rows.
virtual int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global matrix.
int ExportMultiVector(const Epetra_MultiVector &OvX, Epetra_MultiVector &X, Epetra_CombineMode CM=Add)
#define IFPACK_CHK_ERR(ifpack_err)
void ResetStartTime(void)