Skip to content

Commit

Permalink
WIP Ifpack2 Hiptmair
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcgcg committed Apr 26, 2022
1 parent 916fe05 commit d2b4846
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/ifpack2/src/Ifpack2_Hiptmair_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ applyHiptmairSmoother(const Tpetra::MultiVector<typename MatrixType::scalar_type

const std::string timerName1 ("Ifpack2::Hiptmair::apply 1");
const std::string timerName2 ("Ifpack2::Hiptmair::apply 2");
const std::string timerNameTrans ("Ifpack2::Hiptmair::apply Trans");

Teuchos::RCP<Teuchos::Time> timer1 = Teuchos::TimeMonitor::lookupCounter (timerName1);
if (timer1.is_null ()) {
Expand All @@ -442,6 +443,11 @@ applyHiptmairSmoother(const Tpetra::MultiVector<typename MatrixType::scalar_type
timer2 = Teuchos::TimeMonitor::getNewCounter (timerName2);
}

Teuchos::RCP<Teuchos::Time> timerTrans = Teuchos::TimeMonitor::lookupCounter (timerNameTrans);
if (timerTrans.is_null ()) {
timerTrans = Teuchos::TimeMonitor::getNewCounter (timerNameTrans);
}

updateCachedMultiVectors (A_->getRowMap (),
PtAP_->getRowMap (),
X.getNumVectors ());
Expand All @@ -459,11 +465,15 @@ applyHiptmairSmoother(const Tpetra::MultiVector<typename MatrixType::scalar_type
// project to auxiliary space and smooth
Teuchos::TimeMonitor timeMon (*timer2);
Tpetra::Details::residual(*A_,Y,X,*cachedResidual1_);
P_->apply (*cachedResidual1_, *cachedResidual2_, Teuchos::TRANS);
{
Teuchos::TimeMonitor timeMonTrans (*timerTrans);
P_->apply (*cachedResidual1_, *cachedResidual2_, Teuchos::TRANS);
}
cachedSolution2_->putScalar (ZERO);
ifpack2_prec2_->apply (*cachedResidual2_, *cachedSolution2_);
P_->apply (*cachedSolution2_, *cachedSolution1_, Teuchos::NO_TRANS);
Y.update (ONE,*cachedSolution1_,ONE);
// P_->apply (*cachedSolution2_, *cachedSolution1_, Teuchos::NO_TRANS);
// Y.update (ONE,*cachedSolution1_,ONE);
P_->apply (*cachedSolution2_, Y, Teuchos::NO_TRANS, ONE, ONE);
}

if (preOrPost_ == "post" || preOrPost_ == "both") {
Expand Down

0 comments on commit d2b4846

Please sign in to comment.