44 #include <Epetra_CrsMatrix.h>
45 #include <Epetra_Map.h>
46 #include <Epetra_Import.h>
47 #include <Epetra_IntSerialDenseVector.h>
66 assert( orig.Filled() );
69 const Epetra_Map & oRowMap = orig.RowMap();
70 const Epetra_Map & oColMap = orig.ColMap();
72 int oNumRows = oRowMap.NumMyElements();
74 int oNumCols = oColMap.NumMyElements();
75 int nNumRows = newRowMap_.NumMyElements();
76 int nNumDomain = newDomainMap_.NumMyElements();
81 for(
int i = 0; i < nNumRows; ++i )
82 matched = matched && ( oRowMap.MyGID(newRowMap_.GID(i)) );
83 if( !matched ) cerr <<
"EDT_CrsMatrix_SubCopy: Bad new_row_Map. GIDs of new row map must be GIDs of the original row map on the same processor.\n";
86 if( !newRangeMap_.SameAs(newDomainMap_) ) {
87 Epetra_IntSerialDenseVector pidList(nNumDomain);
88 oColMap.RemoteIDList(newDomainMap_.NumMyElements(), newDomainMap_.MyGlobalElements(), pidList.Values(), 0);
89 for(
int i = 0; i < nNumDomain; ++i )
90 matched = matched && ( pidList[i]>=0 );
93 if( !matched ) cout <<
"EDT_CrsMatrix_SubCopy: Bad newDomainMap. One or more GIDs in new domain map are not part of original domain map.\n";
98 Epetra_IntSerialDenseVector pidList(oNumCols);
99 Epetra_IntSerialDenseVector lidList(oNumCols);
100 Epetra_IntSerialDenseVector sizeList(oNumCols);
101 newDomainMap_.RemoteIDList(oColMap.NumMyElements(), oColMap.MyGlobalElements(), pidList.Values(), 0);
103 Epetra_IntSerialDenseVector newColMapGidList(oNumCols);
104 int * origColGidList = oColMap.MyGlobalElements();
105 for(
int i = 0; i < oNumCols; ++i )
107 newColMapGidList[numNewCols++]= origColGidList[i];
108 newColMap_ = Epetra_Map(-1, numNewCols, newColMapGidList.Values(), 0, oColMap.Comm());
110 importer_ =
new Epetra_Import(newRowMap_, oRowMap);
112 Epetra_CrsMatrix * newMatrix =
new Epetra_CrsMatrix(Copy, newRowMap_, newColMap_, 0);
140 if (!
newObj_->Filled())
return(
false);
bool rvs()
Reverse transfer of data from new object created in the operator() method call to the orig object inp...
bool fwd()
Forward transfer of data from orig object input in the operator() method call to the new object creat...
~CrsMatrix_SubCopy()
Destructor.
NewTypeRef operator()(OriginalTypeRef orig)
Transformation Operator.