UCFD_SPARSE  v1.1
Documentation
Loading...
Searching...
No Matches
krylov.c File Reference

Source file of Krylov subspace methods. More...

#include "krylov.h"
#include "precon.h"
#include <math.h>
#include <omp.h>
Include dependency graph for krylov.c:

Go to the source code of this file.

Functions

ucfd_status_t serial_gmres (sparse_matrix_t op, ucfd_precon_type_t precon_type, int bn, int block, int m, int *iter, double tol, int *row_ptr, int *col_ind, int *diag_ind, double *precon_nnz_data, double *x, double *b, double *H, double *V, double *g, double *y, double *w, double *r)
 Serial GMRES routine. More...
 
ucfd_status_t step_gmres (sparse_matrix_t op, ucfd_precon_solve psolve, const struct matrix_descr descr, int bn, int m, int *flag, int *row_ptr, int *col_ind, int *diag_ind, double *precon_nnz_data, double *x, double *b, double *H, double *V, double *g, double *y, double *w, double *r)
 Single GMRES iteration routine. More...
 
ucfd_status_t serial_bicgstab (sparse_matrix_t op, ucfd_precon_type_t precon_type, int bn, int *iter, double tol, int *row_ptr, int *col_ind, int *diag_ind, double *precon_nnz_data, double *x, double *b, double *r, double *p, double *v, double *s, double *t)
 Serial BiCGstab routine. More...
 

Detailed Description

Source file of Krylov subspace methods.

======================================================================================================================

There are two Krylov subspace methods, GMRES and BiCGstab methods.

         (1) GMRES (Generalized Minimal RESidual)  
         GMRES method is introduced by Saad and Schultz, which is the one of the Krylov subspace methods.
         GMRES algorithm consists of sparse matrix-vector multiplication, vector-vector product, L-2 norm,
         and these BLAS functions are implemented by using `Intel MKL` library.
         Restart version is used.  

         (2) BiCGstab (Bi-Conjugate Gradient stabilized)  
         Bi-CGSTAB method is introduced by H.A. van der Vorst, which is one of the Krylov subspace methods.
         It takes for q_k a product of appropriate 1-step Minimal Residual polynomials so that can converge
         rather smoothly than bi-conjugate gradient (Bi-CG) method.
         However, its computation process is slightly more expensive than CGS.
Note
For system matrix A, any sparse matrix storage format (CSR, CSC, BSR) is available. However, Preconditioner arrays must be stored as Block Sparse Row(BSR) format.
Author
Date
Dec 2024
Version
1.0
Copyright
Copyright (c) 2024, Namhyoung Kim and Jin Seok Park, Inha University, All rights reserved.
License
This project is release under the terms of the MIT License (see LICENSE file).

Definition in file krylov.c.

Function Documentation

◆ serial_bicgstab()

ucfd_status_t serial_bicgstab ( sparse_matrix_t  op,
ucfd_precon_type_t  precon_type,
int  bn,
int *  iter,
double  tol,
int *  row_ptr,
int *  col_ind,
int *  diag_ind,
double *  precon_nnz_data,
double *  x,
double *  b,
double *  r,
double *  p,
double *  v,
double *  s,
double *  t 
)

Serial BiCGstab routine.

Overall process of BiCGstab routine. Outer iteration ends when solution is converged or reached in maximum iteration number. UCFD_STATUS_CONVERGED is returned when L-2 norm of the residual vector becomes smaller than tol, and UCFD_STATUS_NOT_CONVERGED is returned when maximum iteration finished.

Definition at line 286 of file krylov.c.

Here is the call graph for this function:

◆ serial_gmres()

ucfd_status_t serial_gmres ( sparse_matrix_t  op,
ucfd_precon_type_t  precon_type,
int  bn,
int  block,
int  m,
int *  iter,
double  tol,
int *  row_ptr,
int *  col_ind,
int *  diag_ind,
double *  precon_nnz_data,
double *  x,
double *  b,
double *  H,
double *  V,
double *  g,
double *  y,
double *  w,
double *  r 
)

Serial GMRES routine.

Overall process of GMRES routine. Outer iteration ends when solution is converged or reached in maximum iteration number. UCFD_STATUS_CONVERGED is returned when L-2 norm of the residual vector becomes smaller than tol, and UCFD_STATUS_NOT_CONVERGED is returned when maximum iteration finished.

Definition at line 46 of file krylov.c.

Here is the call graph for this function:

◆ step_gmres()

ucfd_status_t step_gmres ( sparse_matrix_t  op,
ucfd_precon_solve  psolve,
const struct matrix_descr  descr,
int  bn,
int  m,
int *  flag,
int *  row_ptr,
int *  col_ind,
int *  diag_ind,
double *  precon_nnz_data,
double *  x,
double *  b,
double *  H,
double *  V,
double *  g,
double *  y,
double *  w,
double *  r 
)

Single GMRES iteration routine.

Single iteration of GMRES.

Note
Residual array r must be initialized, r := b - A @ x.

Definition at line 185 of file krylov.c.