Defines a coupled Conjugate Gradient method.
|
| type | cg_cpld_t |
| | CPU implementation of the coupled preconditioned conjugate gradient method. More...
|
| |
|
| subroutine | cg_cpld_init (this, n, max_iter, m, rel_tol, abs_tol, monitor) |
| | Initialise a coupled CPU PCG solver.
|
| |
| subroutine | cg_cpld_free (this) |
| | Free a coupled CPU PCG solver.
|
| |
| type(ksp_monitor_t) function | cg_cpld_nop (this, ax, x, f, n, coef, bc_projector, gs_h, niter) |
| | Reject scalar solves, which are not supported by this type.
|
| |
| type(ksp_monitor_t) function, dimension(3) | cg_cpld_solve (this, ax, x, y, z, fx, fy, fz, n, coef, bc_projector, gs_h, niter) |
| | Solve a three-component coupled system with the CPU PCG method.
|
| |
◆ cg_cpld_free()
◆ cg_cpld_init()
| subroutine cg_cpld::cg_cpld_init |
( |
class(cg_cpld_t), intent(inout), target |
this, |
|
|
integer, intent(in) |
n, |
|
|
integer, intent(in) |
max_iter, |
|
|
class(pc_t), intent(in), optional, target |
m, |
|
|
real(kind=rp), intent(in), optional |
rel_tol, |
|
|
real(kind=rp), intent(in), optional |
abs_tol, |
|
|
logical, intent(in), optional |
monitor |
|
) |
| |
- Parameters
-
| n | Number of degrees of freedom per component. |
| max_iter | Maximum number of iterations. |
| M | Optional preconditioner. An identity preconditioner is used if absent. |
| rel_tol | Optional relative convergence tolerance. |
| abs_tol | Optional absolute convergence tolerance. |
| monitor | Optional switch for logging the residual at each iteration. |
Definition at line 105 of file cg_coupled.f90.
◆ cg_cpld_nop()
| type(ksp_monitor_t) function cg_cpld::cg_cpld_nop |
( |
class(cg_cpld_t), intent(inout) |
this, |
|
|
class(ax_t), intent(in) |
ax, |
|
|
type(field_t), intent(inout) |
x, |
|
|
real(kind=rp), dimension(n), intent(in) |
f, |
|
|
integer, intent(in) |
n, |
|
|
type(coef_t), intent(inout) |
coef, |
|
|
class(scalar_bc_projector_t), intent(inout) |
bc_projector, |
|
|
type(gs_t), intent(inout) |
gs_h, |
|
|
integer, intent(in), optional |
niter |
|
) |
| |
|
private |
- Parameters
-
| Ax | Linear operator. |
| x | Solution field. |
| f | Right-hand side. |
| n | Number of degrees of freedom. |
| coef | Spectral element coefficients and multiplicity weights. |
| bc_projector | Projector for Dirichlet boundary nodes. |
| gs_h | Gather-scatter handle used to assemble the operator result. |
| niter | Optional maximum number of iterations. |
- Returns
- Unused convergence information.
Definition at line 165 of file cg_coupled.f90.
◆ cg_cpld_solve()
| type(ksp_monitor_t) function, dimension(3) cg_cpld::cg_cpld_solve |
( |
class(cg_cpld_t), intent(inout) |
this, |
|
|
class(ax_t), intent(in) |
ax, |
|
|
type(field_t), intent(inout) |
x, |
|
|
type(field_t), intent(inout) |
y, |
|
|
type(field_t), intent(inout) |
z, |
|
|
real(kind=rp), dimension(n), intent(in) |
fx, |
|
|
real(kind=rp), dimension(n), intent(in) |
fy, |
|
|
real(kind=rp), dimension(n), intent(in) |
fz, |
|
|
integer, intent(in) |
n, |
|
|
type(coef_t), intent(inout) |
coef, |
|
|
class(vector_bc_projector_t), intent(inout) |
bc_projector, |
|
|
type(gs_t), intent(inout) |
gs_h, |
|
|
integer, intent(in), optional |
niter |
|
) |
| |
|
private |
The initial guesses are discarded. All inner products combine the three components, so the method advances one Krylov recurrence for the complete coupled system.
- Parameters
-
| Ax | Coupled linear operator. |
| x | Solution field for the first component. |
| y | Solution field for the second component. |
| z | Solution field for the third component. |
| fx | Right-hand side for the first component. |
| fy | Right-hand side for the second component. |
| fz | Right-hand side for the third component. |
| n | Number of degrees of freedom per component. |
| coef | Spectral element coefficients and multiplicity weights. |
| bc_projector | Projector for vector boundary nodes. |
| gs_h | Gather-scatter handle used to assemble operator results. |
| niter | Optional maximum number of iterations, overriding the configured value. |
- Returns
- Identical combined convergence information for all components.
Definition at line 203 of file cg_coupled.f90.