132 "MueLu::BlockedDirectSolver::Apply(): Setup() has not been called");
134 RCP<MultiVector> rcpX = Teuchos::rcpFromRef(X);
135 RCP<const MultiVector> rcpB = Teuchos::rcpFromRef(B);
136 RCP<BlockedMultiVector> bX = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(rcpX);
137 RCP<const BlockedMultiVector> bB = Teuchos::rcp_dynamic_cast<const BlockedMultiVector>(rcpB);
139#ifdef HAVE_MUELU_DEBUG
140 RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A_);
141 if(bB.is_null() ==
false) {
144 TEUCHOS_TEST_FOR_EXCEPTION(bA->getFullRangeMap()->isSameAs(*(B.getMap())) ==
false,
Exceptions::RuntimeError,
"MueLu::BlockedDirectSolver::Apply(): The map of RHS vector B is not the same as range map of the blocked operator A. Please check the map of B and A.");
146 if(bX.is_null() ==
false) {
149 TEUCHOS_TEST_FOR_EXCEPTION(bA->getFullDomainMap()->isSameAs(*(X.getMap())) ==
false,
Exceptions::RuntimeError,
"MueLu::BlockedDirectSolver::Apply(): The map of the solution vector X is not the same as domain map of the blocked operator A. Please check the map of X and A.");
153 if (bB.is_null() ==
true && bX.is_null() ==
true) {
155 s_->Apply(X, B, InitialGuessIsZero);
156 }
else if(bB.is_null() ==
false && bX.is_null() ==
false) {
158 RCP<MultiVector> mergedX = bX->Merge();
159 RCP<const MultiVector> mergedB = bB->Merge();
160 s_->Apply(*mergedX, *mergedB, InitialGuessIsZero);
161 RCP<MultiVector> xx = Teuchos::rcp(
new BlockedMultiVector(bX->getBlockedMap(),mergedX));
162 SC zero = Teuchos::ScalarTraits<SC>::zero(), one = Teuchos::ScalarTraits<SC>::one();
163 X.update(one,*xx,zero);
164 }
else if (bB.is_null() ==
true && bX.is_null() ==
false) {
166 RCP<MultiVector> mergedX = bX->Merge();
167 s_->Apply(*mergedX, B, InitialGuessIsZero);
168 RCP<MultiVector> xx = Teuchos::rcp(
new BlockedMultiVector(bX->getBlockedMap(),mergedX));
169 SC zero = Teuchos::ScalarTraits<SC>::zero(), one = Teuchos::ScalarTraits<SC>::one();
170 X.update(one,*xx,zero);
171 }
else if (bB.is_null() ==
false && bX.is_null() ==
true) {
173 RCP<const MultiVector> mergedB = bB->Merge();
174 s_->Apply(X, *mergedB, InitialGuessIsZero);
179 RCP<MueLu::SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()