Skip to content

Commit

Permalink
Fix broken test for PCSide
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangrimberg committed Jan 8, 2024
1 parent bfe70f0 commit 37672e3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions palace/linalg/ksp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,29 @@ std::unique_ptr<IterativeSolver<OperType>> ConfigureKrylovSolver(MPI_Comm comm,

// Configure preconditioning side (only for GMRES).
if (iodata.solver.linear.pc_side_type != config::LinearSolverData::SideType::DEFAULT &&
(type != config::LinearSolverData::KspType::GMRES ||
type != config::LinearSolverData::KspType::FGMRES))
type != config::LinearSolverData::KspType::GMRES)
{
Mpi::Warning(
comm,
"Preconditioner side will be ignored for non-GMRES/FGMRES iterative solvers!\n");
Mpi::Warning(comm,
"Preconditioner side will be ignored for non-GMRES iterative solvers!\n");
}
else if (type == config::LinearSolverData::KspType::GMRES ||
type == config::LinearSolverData::KspType::FGMRES)
else
{
// Because FGMRES inherits from GMRES, this is OK.
auto *gmres = static_cast<GmresSolver<OperType> *>(ksp.get());
switch (iodata.solver.linear.pc_side_type)
if (type == config::LinearSolverData::KspType::GMRES ||
type == config::LinearSolverData::KspType::FGMRES)
{
case config::LinearSolverData::SideType::LEFT:
gmres->SetPrecSide(GmresSolver<OperType>::PrecSide::LEFT);
break;
case config::LinearSolverData::SideType::RIGHT:
gmres->SetPrecSide(GmresSolver<OperType>::PrecSide::RIGHT);
break;
case config::LinearSolverData::SideType::DEFAULT:
// Do nothing
break;
auto *gmres = static_cast<GmresSolver<OperType> *>(ksp.get());
switch (iodata.solver.linear.pc_side_type)
{
case config::LinearSolverData::SideType::LEFT:
gmres->SetPrecSide(GmresSolver<OperType>::PrecSide::LEFT);
break;
case config::LinearSolverData::SideType::RIGHT:
gmres->SetPrecSide(GmresSolver<OperType>::PrecSide::RIGHT);
break;
case config::LinearSolverData::SideType::DEFAULT:
// Do nothing
break;
}
}
}

Expand Down

0 comments on commit 37672e3

Please sign in to comment.