Skip to content

Add coupled_bicgstab on the CPU - #2739

Open
timofeymukha wants to merge 15 commits into
ExtremeFLOW:developfrom
timofeymukha:feature/bcgstab
Open

Add coupled_bicgstab on the CPU#2739
timofeymukha wants to merge 15 commits into
ExtremeFLOW:developfrom
timofeymukha:feature/bcgstab

Conversation

@timofeymukha

Copy link
Copy Markdown
Collaborator

Adds the coupled version of bicgstab, which should be suitable for the full-stress formulation when the system is non-symmetric.

Implemented by Sol 5.6 High, but looks to me like a reasonable extenstion of the baseline version, similar to coupled_cg.

Timofey Mukha and others added 12 commits August 24, 2026 20:09
Corrected main Neko citation 🐈 and added TSFP14 paper to publications
I thought it would be nice to have ready-made templates for all the
possible user-injectable types. This way instead of "cleaning" up a
copied existing type in neko, one can start with a fresh, empty, but
compilable template.
The template compilation is added to the CI.

Co-authored-by: Timofey Mukha <timofey.mukha@fau.de>
@timofeymukha
timofeymukha requested review from njansson and pohm01 and a lite review from Copilot August 27, 2026 12:03
@timofeymukha timofeymukha added the enhancement New feature or request label Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new coupled (3-component) CPU BiCGStab Krylov solver intended for non-symmetric coupled momentum systems (e.g., full-stress formulation with variable viscosity), wires it into the Krylov solver factory, and updates user-facing documentation and the changelog accordingly.

Changes:

  • Added bicgstab_cpld_t (CPU-only) implementing a coupled 3-component right-preconditioned BiCGStab method.
  • Registered the new solver type string (coupled_bicgstab) in the Krylov factory and build system.
  • Updated the user guide and changelog to document the new solver.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Makefile.am Adds the new coupled BiCGStab CPU source file to the build.
src/krylov/krylov_fctry.f90 Registers coupled_bicgstab and allocates the coupled CPU implementation (errors out on device backend).
src/krylov/bcknd/cpu/bicgstab_coupled.f90 Implements the coupled (3-component) CPU BiCGStab solver (bicgstab_cpld_t).
src/.depends Updates build dependencies to include the new solver object.
doc/pages/user-guide/case-file.md Documents coupled_bicgstab and updates the solver-type table entry for velocity.
CHANGELOG.md Notes the addition of the coupled CPU BiCGStab solver.
Suppressed comments (1)

doc/pages/user-guide/case-file.md:1980

  • The case-file table uses velocity_solver.maxiter / pressure_solver.maxiter, but the implementation (and JSON schema naming elsewhere in this doc) uses max_iterations (e.g. case.fluid.velocity_solver.max_iterations). This mismatch will mislead users configuring solvers (including the newly documented coupled_bicgstab).
| `velocity_solver.type`                             | Linear solver for the momentum equation.                                                          | `cg`, `pipecg`, `bicgstab`, `coupled_bicgstab`, `coupled_cg`, `cacg`, `gmres` | -             |
| `velocity_solver.preconditioner.type`              | Linear solver preconditioner for the momentum equation.                                           | `ident`, `hsmg`, `jacobi`                                   | -             |
| `velocity_solver.absolute_tolerance`               | Linear solver convergence criterion for the momentum equation.                                    | Positive real                                               | -             |
| `velocity_solver.maxiter`                          | Linear solver max iteration count for the momentum equation.                                      | Positive real                                               | 800           |
| `velocity_solver.projection_space_size`            | Projection space size for the momentum equation.                                                  | Positive integer                                            | 0             |

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/krylov/bcknd/cpu/bicgstab_coupled.f90 Outdated
@njansson
njansson enabled auto-merge September 2, 2026 19:14
@njansson
njansson disabled auto-merge September 2, 2026 19:14
block
type(host_array_t), pointer :: p_tmp, p_hat_tmp, r_tmp
type(host_array_t), pointer :: s_hat_tmp, t_tmp, v_tmp
real(kind=rp), pointer :: p(:), p_hat(:), r(:), s_hat(:), t(:), v(:)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move these pointers up in the type. As we have done with the other ksp types. (to ease readability for linear solver people)

@njansson
njansson enabled auto-merge September 3, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants