Skip to content

Commit

Permalink
Merge branch 'develop' into lroberts36/add-cg-solver
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 authored Sep 25, 2024
2 parents 843a264 + e0c85cc commit fbc07fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 6 additions & 7 deletions src/solvers/bicgstab_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,18 @@ class BiCGSTABSolver {
this);
tl.AddTask(
TaskQualifier::once_per_region, initialize, "print to screen",
[&](BiCGSTABSolver *solver, std::shared_ptr<Real> res_tol,
bool relative_residual) {
[&](BiCGSTABSolver *solver, std::shared_ptr<Real> 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 / pmesh->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);
}
return TaskStatus::complete;
},
this, params_.residual_tolerance, params_.relative_residual);
this, params_.residual_tolerance, params_.relative_residual, pmesh);

// BEGIN ITERATIVE TASKS
auto [itl, solver_id] = tl.AddSublist(initialize, {1, params_.max_iters});
Expand Down

0 comments on commit fbc07fe

Please sign in to comment.