/[escript]/trunk/paso/src/UMFPACK.c
ViewVC logotype

Diff of /trunk/paso/src/UMFPACK.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 806 by gross, Thu Aug 10 11:58:52 2006 UTC revision 1149 by gross, Thu May 17 00:30:15 2007 UTC
# Line 54  void Paso_UMFPACK(Paso_SystemMatrix* A, Line 54  void Paso_UMFPACK(Paso_SystemMatrix* A,
54       double time0;       double time0;
55       double control[UMFPACK_CONTROL], info[UMFPACK_INFO];       double control[UMFPACK_CONTROL], info[UMFPACK_INFO];
56       int error = UMFPACK_OK;       int error = UMFPACK_OK;
57         Paso_UMFPACK_Handler* pt = NULL;
58    
59       if (! (A->type & (MATRIX_FORMAT_OFFSET1 + MATRIX_FORMAT_BLK1)) ) {       if (! (A->type & (MATRIX_FORMAT_OFFSET1 + MATRIX_FORMAT_BLK1)) ) {
60          Paso_setError(TYPE_ERROR,"Paso_UMFPACK: UMFPACK requires CSR format with index offset 1 and block size 1.");          Paso_setError(TYPE_ERROR,"Paso_UMFPACK: UMFPACK requires CSR format with index offset 1 and block size 1.");
61          return;          return;
62       }       }
63       Performance_startMonitor(pp,PERFORMANCE_ALL);       Performance_startMonitor(pp,PERFORMANCE_ALL);
64       Paso_UMFPACK_Handler* pt = (Paso_UMFPACK_Handler *)(A->solver);       pt = (Paso_UMFPACK_Handler *)(A->solver);
65       umfpack_di_defaults(control);       umfpack_di_defaults(control);
66    
67       if (pt==NULL) {       if (pt==NULL) {
# Line 69  void Paso_UMFPACK(Paso_SystemMatrix* A, Line 70  void Paso_UMFPACK(Paso_SystemMatrix* A,
70          if (Paso_checkPtr(pt)) return;          if (Paso_checkPtr(pt)) return;
71          A->solver=(void*) pt;          A->solver=(void*) pt;
72          time0=Paso_timer();          time0=Paso_timer();
73          // call LDU symbolic factorization: //          /* call LDU symbolic factorization: */
74          error=umfpack_di_symbolic(n,n,A->pattern->ptr,A->pattern->index,A->val,&(pt->symbolic),control,info);          error=umfpack_di_symbolic(n,n,A->pattern->ptr,A->pattern->index,A->val,&(pt->symbolic),control,info);
75          if (error != UMFPACK_OK) {          if (error != UMFPACK_OK) {
76               Paso_setError(VALUE_ERROR,"symbolic factorization failed.");               Paso_setError(VALUE_ERROR,"symbolic factorization failed.");
77               Paso_UMFPACK_free(A);               Paso_UMFPACK_free(A);
78          } else {          } else {
79              // call LDU factorization: //              /* call LDU factorization: */
80              error= umfpack_di_numeric(A->pattern->ptr,A->pattern->index,A->val,pt->symbolic,&(pt->numeric),control,info);              error= umfpack_di_numeric(A->pattern->ptr,A->pattern->index,A->val,pt->symbolic,&(pt->numeric),control,info);
81             if (error != UMFPACK_OK) {             if (error != UMFPACK_OK) {
82               Paso_setError(ZERO_DIVISION_ERROR,"factorization failed. Most likely the matrix is singular.");               Paso_setError(ZERO_DIVISION_ERROR,"factorization failed. Most likely the matrix is singular.");
# Line 86  void Paso_UMFPACK(Paso_SystemMatrix* A, Line 87  void Paso_UMFPACK(Paso_SystemMatrix* A,
87       }       }
88       if (Paso_noError())  {       if (Paso_noError())  {
89          time0=Paso_timer();          time0=Paso_timer();
90          // call forward backward substitution: //          /* call forward backward substitution: */
91          control[UMFPACK_IRSTEP]=2; /* number of refinement steps */          control[UMFPACK_IRSTEP]=2; /* number of refinement steps */
92          error=umfpack_di_solve(UMFPACK_A,A->pattern->ptr,A->pattern->index,A->val,out,in,pt->numeric,control,info);          error=umfpack_di_solve(UMFPACK_A,A->pattern->ptr,A->pattern->index,A->val,out,in,pt->numeric,control,info);
93          if (options->verbose) printf("timing UMFPACK: solve: %.4e sec\n",Paso_timer()-time0);          if (options->verbose) printf("timing UMFPACK: solve: %.4e sec\n",Paso_timer()-time0);

Legend:
Removed from v.806  
changed lines
  Added in v.1149

  ViewVC Help
Powered by ViewVC 1.1.26