Skip to content

Commit

Permalink
Update documentation and throw and error for unsupported backends
Browse files Browse the repository at this point in the history
  • Loading branch information
njansson committed Dec 10, 2024
1 parent 31f8900 commit 2742c88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/pages/user-guide/case-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ The following keywords are used, with the corresponding options.
- `jacobi`, a Jacobi preconditioner. Typically used for velocity.
- `hsmg`, a hybrid-Schwarz multigrid preconditioner. Typically used for
pressure.
- `phmg`, a hybrid ph multigrid preconditioner. Typically used for pressure.
- `ident`, an identity matrix (no preconditioner).
* `absolute_tolerance`, tolerance criterion for convergence.
* `max_iterations`, maximum number of iterations before giving up.
Expand Down
8 changes: 7 additions & 1 deletion src/krylov/pc_hsmg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,14 @@ subroutine hsmg_init(this, msh, Xh, coef, dof, gs_h, bclst, crs_pctype)
! Create a backend specific krylov solver
if (present(crs_pctype)) then
if (trim(crs_pctype) .eq. 'tamg') then
if (NEKO_BCKND_DEVICE .eq. 1) then
call neko_error('Tree-amg only supported for CPU')
end if

allocate(this%amg_solver)
call this%amg_solver%init(this%ax, this%grids(1)%e%Xh, this%grids(1)%coef, this%msh, this%grids(1)%gs_h, 4, &

call this%amg_solver%init(this%ax, this%grids(1)%e%Xh, &
this%grids(1)%coef, this%msh, this%grids(1)%gs_h, 4, &
this%grids(1)%bclst, 1)
else
call krylov_solver_factory(this%crs_solver, &
Expand Down
3 changes: 3 additions & 0 deletions src/krylov/precon_fctry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ module subroutine precon_factory(pc, type_name)
else if (type_name(1:4) .eq. 'hsmg') then
allocate(hsmg_t::pc)
else if (type_name(1:4) .eq. 'phmg') then
if (NEKO_BCKND_DEVICE .eq. 1) then
call neko_error('Hybrid ph multigrid only supported for CPU')
end if
allocate(phmg_t::pc)
else if(trim(type_name) .eq. 'ident') then
if (NEKO_BCKND_DEVICE .eq. 1) then
Expand Down

0 comments on commit 2742c88

Please sign in to comment.