Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
cg_cpld Module Reference

Defines a coupled Conjugate Gradient method.

Data Types

type  cg_cpld_t
 CPU implementation of the coupled preconditioned conjugate gradient method. More...
 

Functions/Subroutines

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.
 

Function/Subroutine Documentation

◆ cg_cpld_free()

subroutine cg_cpld::cg_cpld_free ( class(cg_cpld_t), intent(inout)  this)
private

Definition at line 141 of file cg_coupled.f90.

◆ 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
nNumber of degrees of freedom per component.
max_iterMaximum number of iterations.
MOptional preconditioner. An identity preconditioner is used if absent.
rel_tolOptional relative convergence tolerance.
abs_tolOptional absolute convergence tolerance.
monitorOptional 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
AxLinear operator.
xSolution field.
fRight-hand side.
nNumber of degrees of freedom.
coefSpectral element coefficients and multiplicity weights.
bc_projectorProjector for Dirichlet boundary nodes.
gs_hGather-scatter handle used to assemble the operator result.
niterOptional 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
AxCoupled linear operator.
xSolution field for the first component.
ySolution field for the second component.
zSolution field for the third component.
fxRight-hand side for the first component.
fyRight-hand side for the second component.
fzRight-hand side for the third component.
nNumber of degrees of freedom per component.
coefSpectral element coefficients and multiplicity weights.
bc_projectorProjector for vector boundary nodes.
gs_hGather-scatter handle used to assemble operator results.
niterOptional 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.