17#include "fasp_functs.h"
56 double *Ax = ptrA->
val;
57 void *Symbolic, *Numeric;
63 printf(
"### DEBUG: %s ...... [Start]\n", __FUNCTION__);
64 printf(
"### DEBUG: nr=%d, nc=%d, nnz=%d\n", m, n, nnz);
67 REAL start_time, end_time;
70 status = umfpack_di_symbolic(n, n, Ap, Ai, Ax, &Symbolic, NULL, NULL);
72 printf(
"### ERROR: %d, %s %d\n", status, __FUNCTION__, __LINE__);
73 printf(
"### ERROR: Symbolic factorization failed!\n");
77 status = umfpack_di_numeric(Ap, Ai, Ax, Symbolic, &Numeric, NULL, NULL);
79 printf(
"### ERROR: %d, %s %d\n", status, __FUNCTION__, __LINE__);
80 printf(
"### ERROR: Numerica factorization failed!\n");
83 umfpack_di_free_symbolic(&Symbolic);
85 status = umfpack_di_solve(UMFPACK_A, Ap, Ai, Ax, u->
val, b->
val, Numeric, NULL, NULL);
87 printf(
"### ERROR: %d, %s %d\n", status, __FUNCTION__, __LINE__);
88 printf(
"### ERROR: UMFPACK solver failed!\n");
91 umfpack_di_free_numeric(&Numeric);
99 printf(
"### DEBUG: %s ...... [Finish]\n", __FUNCTION__);
106 printf(
"### ERROR: UMFPACK is not available!\n");
124void* fasp_umfpack_factorize (
dCSRmat *ptrA,
131 double *Ax = ptrA->
val;
137 const INT nnz = ptrA->
nnz;
138 printf(
"### DEBUG: %s ...... [Start]\n", __FUNCTION__);
139 printf(
"### DEBUG: nr=%d, nc=%d, nnz=%d\n", m, n, nnz);
142 REAL start_time, end_time;
145 umfpack_di_symbolic (n, n, Ap, Ai, Ax, &Symbolic, NULL, NULL);
146 umfpack_di_numeric (Ap, Ai, Ax, Symbolic, &Numeric, NULL, NULL);
147 umfpack_di_free_symbolic (&Symbolic);
155 printf(
"### DEBUG: %s ...... [Finish]\n", __FUNCTION__);
183 double *Ax = ptrA->
val;
189 const INT nnz = ptrA->
nnz;
190 printf(
"### DEBUG: %s ...... [Start]\n", __FUNCTION__);
191 printf(
"### DEBUG: nr=%d, nc=%d, nnz=%d\n", m, n, nnz);
194 REAL start_time, end_time;
197 status = umfpack_di_solve (UMFPACK_A, Ap, Ai, Ax, u->
val, b->
val, Numeric, NULL, NULL);
205 printf(
"### DEBUG: %s ...... [Finish]\n", __FUNCTION__);
220INT fasp_umfpack_free_numeric (
void *Numeric)
225 printf(
"### DEBUG: %s ...... [Start]\n", __FUNCTION__);
228 umfpack_di_free_numeric (&Numeric);
231 printf(
"### DEBUG: %s ...... [Finish]\n", __FUNCTION__);
void fasp_cputime(const char *message, const REAL cputime)
Print CPU walltime.
void fasp_gettime(REAL *time)
Get system time.
INT fasp_solver_umfpack(dCSRmat *ptrA, dvector *b, dvector *u, const SHORT prtlvl)
Solve Au=b by UMFpack.
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
#define FASP_SUCCESS
Definition of return status and error messages.
#define ERROR_SOLVER_MISC
#define PRINT_NONE
Print level for all subroutines – not including DEBUG output.
#define ERROR_SOLVER_EXIT
Sparse matrix of REAL type in CSR format.
INT col
column of matrix A, n
REAL * val
nonzero entries of A
INT row
row number of matrix A, m
INT * IA
integer array of row pointers, the size is m+1
INT nnz
number of nonzero entries
INT * JA
integer array of column indexes, the size is nnz
Vector with n entries of REAL type.
REAL * val
actual vector entries