diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6bf4e4ef64..6e940ad7fa79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - [[PR 1172]](https://github.com/parthenon-hpc-lab/parthenon/pull/1172) Make parthenon manager robust against external MPI init and finalize calls ### Fixed (not changing behavior/API/variables/...) +- [[PR 1178]](https://github.com/parthenon-hpc-lab/parthenon/pull/1178) Fix issue with mesh pointer when using relative residual tolerance in BiCGSTAB solver. - [[PR1173]](https://github.com/parthenon-hpc-lab/parthenon/pull/1173) Make debugging easier by making parthenon throw an error if ParameterInput is different on multiple MPI ranks. ### Infrastructure (changes irrelevant to downstream codes) diff --git a/src/solvers/bicgstab_solver.hpp b/src/solvers/bicgstab_solver.hpp index dcc74165451e..3d7d3f604c6f 100644 --- a/src/solvers/bicgstab_solver.hpp +++ b/src/solvers/bicgstab_solver.hpp @@ -144,13 +144,12 @@ class BiCGSTABSolver { this); tl.AddTask( TaskQualifier::once_per_region, initialize, "print to screen", - [&](BiCGSTABSolver *solver, std::shared_ptr res_tol, - bool relative_residual, Mesh *pm) { + [&](BiCGSTABSolver *solver, std::shared_ptr res_tol, bool relative_residual, + Mesh *pm) { if (Globals::my_rank == 0 && params_.print_per_step) { - Real tol = - relative_residual - ? *res_tol * std::sqrt(solver->rhs2.val / pm->GetTotalCells()) - : *res_tol; + Real tol = relative_residual + ? *res_tol * std::sqrt(solver->rhs2.val / pm->GetTotalCells()) + : *res_tol; printf("# [0] v-cycle\n# [1] rms-residual (tol = %e) \n# [2] rms-error\n", tol); }