--- trunk/paso/src/Solvers/Solver_preconditioner.c 2005/11/09 02:02:19 155 +++ trunk/paso/src/Solvers/Solver_preconditioner.c 2006/01/13 05:07:10 431 @@ -22,6 +22,7 @@ void Paso_Preconditioner_free(Paso_Solver_Preconditioner* in) { if (in!=NULL) { Paso_Solver_ILU_free(in->ilu); + Paso_Solver_RILU_free(in->rilu); Paso_Solver_Jacobi_free(in->jacobi); MEMFREE(in); } @@ -30,14 +31,15 @@ void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) { Paso_Solver_Preconditioner* prec=NULL; - if (A->iterative==NULL) { + if (A->solver==NULL) { /* allocate structure to hold preconditioner */ prec=MEMALLOC(1,Paso_Solver_Preconditioner); if (Paso_checkPtr(prec)) return; prec->type=UNKNOWN; + prec->rilu=NULL; prec->ilu=NULL; prec->jacobi=NULL; - A->iterative=prec; + A->solver=prec; switch (options->preconditioner) { default: case PASO_JACOBI: @@ -50,10 +52,15 @@ prec->ilu=Paso_Solver_getILU(A,options->verbose); prec->type=PASO_ILU0; break; + case PASO_RILU: + if (options->verbose) printf("RILU preconditioner is used.\n"); + prec->rilu=Paso_Solver_getRILU(A,options->verbose); + prec->type=PASO_RILU; + break; } if (! Paso_noError()) { Paso_Preconditioner_free(prec); - A->iterative=NULL; + A->solver=NULL; } } } @@ -62,7 +69,7 @@ /* has to be called within a parallel reqion */ /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */ void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){ - Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->iterative; + Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->solver; #pragma omp barrier switch (prec->type) { default: @@ -72,6 +79,9 @@ case PASO_ILU0: Paso_Solver_solveILU(prec->ilu,x,b); break; + case PASO_RILU: + Paso_Solver_solveRILU(prec->rilu,x,b); + break; } }