49 #ifdef HAVE_XPETRA_THYRA
58 #ifdef HAVE_XPETRA_EPETRA
60 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
66 int nRows = mat->Rows();
67 int nCols = mat->Cols();
75 #ifdef HAVE_XPETRA_TPETRA
77 #if ((defined(EPETRA_HAVE_OMP) && defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_INT) && defined(HAVE_TPETRA_INST_DOUBLE)) || \
78 (!defined(EPETRA_HAVE_OMP) && defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_INT) && defined(HAVE_TPETRA_INST_DOUBLE)))
80 if(tpetraMat!=Teuchos::null) bTpetra =
true;
86 #ifdef HAVE_XPETRA_EPETRA
88 if(epetraMat!=Teuchos::null) bEpetra =
true;
95 Thyra::defaultBlockedLinearOp<Scalar>();
97 blockMat->beginBlockFill(nRows,nCols);
99 for (
int r=0; r<nRows; ++r) {
100 for (
int c=0; c<nCols; ++c) {
103 if(xpmat == Teuchos::null)
continue;
109 if(xpblock != Teuchos::null) {
110 if(xpblock->
Rows() == 1 && xpblock->
Cols() == 1) {
114 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpwrap->
getCrsMatrix());
117 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpblock);
123 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpwrap->
getCrsMatrix());
126 blockMat->setBlock(r,c,thBlock);
130 blockMat->endBlockFill();
134 # endif //#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
136 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
142 int nRows = mat->Rows();
143 int nCols = mat->Cols();
149 bool bTpetra =
false;
150 bool bEpetra =
false;
151 #ifdef HAVE_XPETRA_TPETRA
153 #if ((defined(EPETRA_HAVE_OMP) && defined(HAVE_TPETRA_INST_OPENMP) && defined(HAVE_TPETRA_INST_INT_LONG_LONG) && defined(HAVE_TPETRA_INST_DOUBLE)) || \
154 (!defined(EPETRA_HAVE_OMP) && defined(HAVE_TPETRA_INST_SERIAL) && defined(HAVE_TPETRA_INST_INT_LONG_LONG) && defined(HAVE_TPETRA_INST_DOUBLE)))
156 if(tpetraMat!=Teuchos::null) bTpetra =
true;
162 #ifdef HAVE_XPETRA_EPETRA
164 if(epetraMat!=Teuchos::null) bEpetra =
true;
171 Thyra::defaultBlockedLinearOp<Scalar>();
173 blockMat->beginBlockFill(nRows,nCols);
175 for (
int r=0; r<nRows; ++r) {
176 for (
int c=0; c<nCols; ++c) {
179 if(xpmat == Teuchos::null)
continue;
185 if(xpblock != Teuchos::null) {
186 if(xpblock->
Rows() == 1 && xpblock->
Cols() == 1) {
190 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpwrap->
getCrsMatrix());
193 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpblock);
199 thBlock = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(xpwrap->
getCrsMatrix());
202 blockMat->setBlock(r,c,thBlock);
206 blockMat->endBlockFill();
210 #endif // #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
216 #endif // HAVE_XPETRA_THYRA
RCP< CrsMatrix > getCrsMatrix() const
Teuchos::RCP< Matrix > getCrsMatrix() const
return unwrap 1x1 blocked operators
virtual size_t Cols() const
number of column blocks
Concrete implementation of Xpetra::Matrix.
virtual size_t Rows() const
number of row blocks
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)