Skip to content

Commit

Permalink
Print intermediate mg iterations (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrum authored Aug 27, 2024
1 parent 867397a commit 498363b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/solvers/fluid_dynamics_matrix_free.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class MFNavierStokesPreconditionGMG
std::shared_ptr<TrilinosWrappers::SolverDirect> precondition_direct;

/// Solver control for the coarse grid solver
std::shared_ptr<ReductionControl> coarse_grid_solver_control;
std::shared_ptr<SolverControl> coarse_grid_solver_control;

/// Solver control for the direct solver
std::shared_ptr<SolverControl> direct_solver_control;
Expand Down
12 changes: 6 additions & 6 deletions source/solvers/fluid_dynamics_matrix_free.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1771,20 +1771,20 @@ MFNavierStokesPreconditionGMG<dim>::vmult(VectorType &dst,
AssertThrow(false, ExcNotImplemented());

// Save number of coarse grid iterations needed in one vmult
if (this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics)
.mg_coarse_grid_solver ==
Parameters::LinearSolver::CoarseGridSolverType::gmres)
if (this->coarse_grid_solver_control)
this->coarse_grid_iterations.emplace_back(
this->coarse_grid_solver_control->last_step());
if (this->coarse_grid_solver_control_intermediate)
this->coarse_grid_iterations.emplace_back(
this->coarse_grid_solver_control_intermediate->last_step());
}

template <int dim>
void
MFNavierStokesPreconditionGMG<dim>::print_relevant_info() const
{
if (this->simulation_parameters.linear_solver.at(PhysicsID::fluid_dynamics)
.mg_coarse_grid_solver ==
Parameters::LinearSolver::CoarseGridSolverType::gmres)
if (this->coarse_grid_solver_control ||
this->coarse_grid_solver_control_intermediate)
{
if (this->coarse_grid_iterations.empty())
this->pcout << " -Coarse grid solver took: 0 iterations" << std::endl;
Expand Down

0 comments on commit 498363b

Please sign in to comment.