00001 #if 0 // dead source
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 <EpetraExt_Dirichlet_CrsMatrix.h>
00031
00032 #include <Epetra_CrsMatrix.h>
00033 #include <Epetra_IntVector.h>
00034 #include <Epetra_Import.h>
00035 #include <Epetra_Map.h>
00036
00037 namespace EpetraExt {
00038
00039 bool
00040 CrsMatrix_Dirichlet::
00041 fwd()
00042 {
00043 Epetra_CrsMatrix & Matrix = *origObj_;
00044
00045 const Epetra_Map & RowMap = Matrix.RowMap();
00046 const Epetra_Map & ColMap = Matrix.ColMap();
00047
00048 int NumMyElements = RowMap.NumMyElements();
00049 int NumMyColElements = ColMap.NumMyElements();
00050
00051 if( symmetric_ && colSet_.empty() )
00052 {
00053 if( Matrix.IndicesAreGlobal() )
00054 {
00055 Epetra_Import Importer( ColMap, RowMap );
00056 Epetra_IntVector colLocations( ColMap );
00057 colLocations.Import( locations_, Importer, Insert );
00058 for( int i = 0; i < NumMyColElements; ++ i )
00059 if( colLocations[i] ) colSet_.insert(i);
00060 }
00061 else
00062 {
00063 for( int i = 0; i < NumMyElements; ++i )
00064 if( locations_[i] ) colSet_.insert(i);
00065 }
00066 }
00067
00068 for( int i = 0; i < NumMyElements; ++i )
00069 {
00070 int * Indices;
00071 double * Vals;
00072 int NumIndices;
00073 if( locations_[i] )
00074 {
00075 Matrix.ExtractMyRowView( i, NumIndices, Vals, Indices );
00076 for( int j = 0; j < NumIndices; ++j )
00077 {
00078 if( Indices[j] == i ) Vals[i] = 1.0;
00079 else Vals[i] = 0.0;
00080 }
00081 }
00082 else if( symmetric_ )
00083 {
00084 Matrix.ExtractMyRowView( i, NumIndices, Vals, Indices );
00085 for( int j = 0; j < NumIndices; ++j )
00086 if( colSet_.count( Indices[j] ) ) Vals[j] = 0.0;
00087 }
00088 }
00089
00090 return true;
00091 }
00092
00093 bool
00094 CrsMatrix_Dirichlet::
00095 rvs()
00096 {
00097 return true;
00098 }
00099
00100 }
00101
00102 #endif // if 0