45 #include <Epetra_CrsMatrix.h> 46 #include <Epetra_IntVector.h> 47 #include <Epetra_Import.h> 48 #include <Epetra_Map.h> 56 Epetra_CrsMatrix & Matrix = *
origObj_;
58 const Epetra_Map & RowMap = Matrix.RowMap();
59 const Epetra_Map & ColMap = Matrix.ColMap();
61 int NumMyElements = RowMap.NumMyElements();
62 int NumMyColElements = ColMap.NumMyElements();
64 if( symmetric_ && colSet_.empty() )
66 if( Matrix.IndicesAreGlobal() )
68 Epetra_Import Importer( ColMap, RowMap );
69 Epetra_IntVector colLocations( ColMap );
70 colLocations.Import( locations_, Importer, Insert );
71 for(
int i = 0; i < NumMyColElements; ++ i )
72 if( colLocations[i] ) colSet_.insert(i);
76 for(
int i = 0; i < NumMyElements; ++i )
77 if( locations_[i] ) colSet_.insert(i);
81 for(
int i = 0; i < NumMyElements; ++i )
88 Matrix.ExtractMyRowView( i, NumIndices, Vals, Indices );
89 for(
int j = 0; j < NumIndices; ++j )
91 if( Indices[j] == i ) Vals[i] = 1.0;
97 Matrix.ExtractMyRowView( i, NumIndices, Vals, Indices );
98 for(
int j = 0; j < NumIndices; ++j )
99 if( colSet_.count( Indices[j] ) ) Vals[j] = 0.0;
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
bool fwd()
Applies Dirichlet BC's.