7#ifndef BELOSLINEARPROBLEM_HH_
8#define BELOSLINEARPROBLEM_HH_
13#include <BelosLinearProblem.hpp>
14#include <Tpetra_CrsMatrix.hpp>
24 template<
class T,
class MV = Tpetra::MultiVector<T,
int>,
25 class OP = Tpetra::Operator<T> >
49 BelosLinProb(Teuchos::RCP<
const Teuchos::Comm<int> > comm);
62 Teuchos::RCP<
const Teuchos::Comm<int> > comm);
75 Teuchos::RCP<
const Teuchos::Comm<int> > comm);
96 Teuchos::RCP<
const Teuchos::Comm<int> > comm);
106 void writeSolution(Teuchos::RCP<
const Teuchos::Comm<int> > comm);
109 Teuchos::RCP<Tpetra::CrsMatrix<T, int, int> >
getCrsMat() {
114 void setCrsMat(Teuchos::RCP<Tpetra::CrsMatrix<T, int, int> > A) {
122 Teuchos::RCP<Tpetra::CrsMatrix<T, int, int> > A_;
125 template<
class T,
class MV,
class OP>
127 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
165 for(
int i = 0; i <
NumProc; ++i)
173 for (
int i = 1; i <
NumProc; ++i) {
280 Teuchos::RCP<const Tpetra::Map<int, int> >
mapStiffRow =
284 A_ = Teuchos::RCP<Tpetra::CrsMatrix<T, int, int> >(
285 new Tpetra::CrsMatrix<T, int, int>(
mapStiffRow, max_));
287 Teuchos::RCP<Tpetra::MultiVector<T, int> > sol(
289 Teuchos::RCP<Tpetra::MultiVector<T, int> >
rhs2(
322 template<
class T,
class MV,
class OP>
324 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
332 throw std::logic_error(
"The first thread needs a Matrix");
357 for(
int i = 0; i <
NumProc; ++i)
387 Teuchos::RCP<const Tpetra::Map<int, int> >
mapStiffRow =
391 A_ = Teuchos::RCP<Tpetra::CrsMatrix<T, int, int> >(
392 new Tpetra::CrsMatrix<T, int, int>(
mapStiffRow, max_));
424 template<
class T,
class MV,
class OP>
426 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
443 for(
int i = 0; i <
NumProc; ++i)
450 for (
int i = 1; i <
NumProc; ++i) {
472 Teuchos::RCP<Tpetra::MultiVector<T, int> >
rhs2(
473 new Tpetra::MultiVector<T, int>(A_->getRowMap(), 1));
475 Teuchos::RCP<Tpetra::MultiVector<T, int> > sol(
476 new Tpetra::MultiVector<T, int>(A_->getRowMap(), 1));
480 sol->replaceGlobalValue((A_->getRowMap())->getGlobalElement(k), 0,
482 rhs2->replaceGlobalValue((A_->getRowMap())->getGlobalElement(k), 0,
493 template<
class T,
class MV,
class OP>
495 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
511 for(
int i = 0; i <
NumProc; ++i)
521 Teuchos::RCP<Tpetra::MultiVector<T, int> >
rhs2(
522 new Tpetra::MultiVector<T, int>(A_->getRowMap(), 1));
524 Teuchos::RCP<Tpetra::MultiVector<T, int> > sol(
525 new Tpetra::MultiVector<T, int>(A_->getRowMap(), 1));
529 sol->replaceGlobalValue((A_->getRowMap())->getGlobalElement(k), 0,
531 rhs2->replaceGlobalValue((A_->getRowMap())->getGlobalElement(k), 0,
542 template<
class T,
class MV,
class OP>
544 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
553 for(
int i = 0; i <
NumProc; ++i)
567 for (
int i = 1; i <
NumProc; ++i) {
574 for (
int i = 0; i < sol.size(); ++i) {
580 template<
class T,
class MV,
class OP>
582 Teuchos::RCP<
const Teuchos::Comm<int> >
Comm) {
586 int globalSize = A_->getRowMap()->getGlobalNumElements();
591 for(
int i = 0; i <
NumProc; ++i)
Teuchos::RCP< Tpetra::CrsMatrix< T, int, int > > getCrsMat()
Getter for CRS matrix used for preconditoner.
void writeSolution(Vector< T > &vec, Teuchos::RCP< const Teuchos::Comm< int > > comm)
void setConceptsRHS(const Vector< T > &rhs, Teuchos::RCP< const Teuchos::Comm< int > > comm)
virtual ~BelosLinProb()
Default Destructor.
BelosLinProb()
Default Constructor.
void setCrsMat(Teuchos::RCP< Tpetra::CrsMatrix< T, int, int > > A)
Setter for CRS matrix.
#define DEBUGL(doit, msg)
Set< F > makeSet(uint n, const F &first,...)