27 |
#if ITERATIVE_SOLVER == NO_LIB |
#if ITERATIVE_SOLVER == NO_LIB |
28 |
Finley_Solver_Preconditioner* prec=(Finley_Solver_Preconditioner*) (A_p->iterative); |
Finley_Solver_Preconditioner* prec=(Finley_Solver_Preconditioner*) (A_p->iterative); |
29 |
maybelong n=A_p->num_rows; |
maybelong n=A_p->num_rows; |
|
#ifdef FINLEY_SOLVER_TRACE |
|
|
printf("ILU(0) preconditioner is used.\n"); |
|
|
#endif |
|
30 |
/* allocate arrays */ |
/* allocate arrays */ |
31 |
prec->mainDiag = (maybelong *) MEMALLOC(sizeof(maybelong) * n); |
prec->mainDiag =MEMALLOC(n,maybelong); |
32 |
prec->color = (maybelong *) MEMALLOC(sizeof(maybelong) * n); |
prec->color = MEMALLOC(n,maybelong); |
33 |
prec->values = (double *) MEMALLOC(sizeof(double) * (A_p->lenOfVal)); |
prec->values = MEMALLOC((A_p->len)*(size_t) n,double); |
34 |
if (! (Finley_checkPtr(prec->mainDiag) || Finley_checkPtr(prec->color) || Finley_checkPtr(prec->values))) { |
if (! (Finley_checkPtr(prec->mainDiag) || Finley_checkPtr(prec->color) || Finley_checkPtr(prec->values))) { |
35 |
/* find the main diagonal: */ |
/* find the main diagonal: */ |
36 |
Finley_Solver_getMainDiagonal(A_p,prec->mainDiag); |
Finley_Solver_getMainDiagonal(A_p,prec->mainDiag); |
37 |
/* color the rows : */ |
/* color the rows : */ |
38 |
Finley_Solver_coloring(A_p,&(prec->numColors),prec->color); |
Finley_Solver_coloring(A_p->pattern,&(prec->numColors),prec->color); |
39 |
if (Finley_ErrorCode==NO_ERROR) { |
if (Finley_ErrorCode==NO_ERROR) { |
40 |
/* allocate vector to hold main diagonal entries: */ |
/* allocate vector to hold main diagonal entries: */ |
41 |
Finley_SystemMatrix_copy(A_p,prec->values); |
Finley_SystemMatrix_copy(A_p,prec->values); |
45 |
sprintf(Finley_ErrorMsg, "ILU preconditioner requires block size =1 ."); |
sprintf(Finley_ErrorMsg, "ILU preconditioner requires block size =1 ."); |
46 |
return; |
return; |
47 |
} else { |
} else { |
48 |
Finley_Solver_setILU0_1(n,A_p->ptr,A_p->index,prec->values,prec->numColors,prec->color,prec->mainDiag); |
Finley_Solver_setILU0_1(n,A_p->pattern->ptr,A_p->pattern->index,prec->values,prec->numColors,prec->color,prec->mainDiag); |
49 |
} |
} |
50 |
} |
} |
51 |
} |
} |
69 |
#pragma omp for private(i) |
#pragma omp for private(i) |
70 |
for (i=0;i<n*A_p->row_block_size;i++) x[i]=b[i]; |
for (i=0;i<n*A_p->row_block_size;i++) x[i]=b[i]; |
71 |
if (A_p->row_block_size > 1) { |
if (A_p->row_block_size > 1) { |
72 |
/* Finley_Solver_solveILU0_blk(n,x,A_p->ptr,A_p->index,prec->values,prec->numColors,prec->color,prec->mainDiag); */ |
/* Finley_Solver_solveILU0_blk(n,x,A_p->pattern->ptr,A_p->pattern->index,prec->values,prec->numColors,prec->color,prec->mainDiag); */ |
73 |
} else { |
} else { |
74 |
Finley_Solver_solveILU0_1(n,x,A_p->ptr,A_p->index,prec->values,prec->numColors,prec->color,prec->mainDiag); |
Finley_Solver_solveILU0_1(n,x,A_p->pattern->ptr,A_p->pattern->index,prec->values,prec->numColors,prec->color,prec->mainDiag); |
75 |
} |
} |
76 |
return; |
return; |
77 |
#endif |
#endif |
175 |
|
|
176 |
/* |
/* |
177 |
* $Log$ |
* $Log$ |
178 |
* Revision 1.1 2004/10/26 06:53:58 jgs |
* Revision 1.2 2004/12/14 05:39:32 jgs |
179 |
* Initial revision |
* *** empty log message *** |
180 |
|
* |
181 |
|
* Revision 1.1.1.1.2.2 2004/11/24 01:37:17 gross |
182 |
|
* some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now |
183 |
|
* |
184 |
|
* Revision 1.1.1.1.2.1 2004/11/12 06:58:21 gross |
185 |
|
* a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry |
186 |
|
* |
187 |
|
* Revision 1.1.1.1 2004/10/26 06:53:58 jgs |
188 |
|
* initial import of project esys2 |
189 |
* |
* |
190 |
* Revision 1.1 2004/07/02 04:21:14 gross |
* Revision 1.1 2004/07/02 04:21:14 gross |
191 |
* Finley C code has been included |
* Finley C code has been included |