47 #include "Epetra_SerialComm.h" 48 #include "Epetra_Time.h" 51 #include "Epetra_MpiComm.h" 55 #include "Epetra_Map.h" 56 #include "Epetra_CrsGraph.h" 57 #include "Epetra_CrsMatrix.h" 58 #include "Epetra_Vector.h" 59 #include "Epetra_LinearProblem.h" 71 #include "../epetra_test_err.h" 73 int main(
int argc,
char *argv[]) {
75 int i, ierr=0, returnierr=0;
81 MPI_Init(&argc,&argv);
84 MPI_Comm_size(MPI_COMM_WORLD, &size);
85 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
97 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
101 Epetra_MpiComm Comm(MPI_COMM_WORLD);
103 Epetra_SerialComm Comm;
105 if (!verbose) Comm.SetTracebackMode(0);
107 int MyPID = Comm.MyPID();
108 int NumProc = Comm.NumProc();
110 bool verbose1 = verbose;
111 if( verbose ) verbose = (MyPID==0);
118 if( verbose1 ) cout << Comm << endl << flush;
120 int NumMyElements = 3;
121 int NumGlobalElements = NumProc*NumMyElements;
124 Epetra_Map Map( NumGlobalElements, NumMyElements, 0, Comm );
125 if( verbose1 ) cout << Map << endl << flush;
127 Epetra_CrsGraph Graph( Copy, Map, 1 );
129 int PIDFac = 10*MyPID;
130 int index = PIDFac+2;
131 Graph.InsertGlobalIndices( PIDFac+0, 1, &index );
133 Graph.InsertGlobalIndices( PIDFac+1, 1, &index );
135 Graph.InsertGlobalIndices( PIDFac+2, 1, &index );
137 Graph.FillComplete();
138 if( verbose1 ) cout << Graph << endl << flush;
162 Epetra_CrsMatrix Matrix( Copy, Graph );
165 Matrix.ReplaceMyValues( 0, 1, &val, &index );
168 Matrix.ReplaceMyValues( 1, 1, &val, &index );
171 Matrix.ReplaceMyValues( 2, 1, &val, &index);
173 vector<double> valA(3);
174 valA[0]=0; valA[1]=1; valA[2]=2;
175 Epetra_BlockMap & MapRef = Map;
176 Epetra_Vector LHS( Copy, MapRef, &valA[0] );
177 Epetra_Vector RHS( Copy, MapRef, &valA[0] );
179 Epetra_LinearProblem Prob( &Matrix, &LHS, &RHS );
181 Epetra_LinearProblem & NewProb = CompTrans( Prob );
Generates the symmetric RCM reordered version of a Epetra_CrsGraph.
std::string EpetraExt_Version()
Given an input Epetra_CrsGraph, a "overlapped" Epetra_CrsGraph is generated including rows associated...
EpetraExt::LinearProblem_GraphTrans: Adaptation of a Epetra_CrsGraph Transform to a Epetra_LinearProb...
Given and input Epetra_LinearProblem, a "reindexed" version will be returned using the given NewRowMa...
int main(int argc, char *argv[])