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

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

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

revision 3008 by gross, Thu Apr 22 10:19:20 2010 UTC revision 3120 by gross, Mon Aug 30 10:48:00 2010 UTC
# Line 23  Line 23 
23  /**************************************************************/  /**************************************************************/
24    
25  #include "SystemMatrix.h"  #include "SystemMatrix.h"
26    #include "Preconditioner.h"
27    
28  /**************************************************************/  /**************************************************************/
29    
# Line 308  void Paso_SystemMatrix_copyToMainDiagona Line 309  void Paso_SystemMatrix_copyToMainDiagona
309  {  {
310      Paso_SparseMatrix_copyToMainDiagonal(A_p->mainBlock, in);      Paso_SparseMatrix_copyToMainDiagonal(A_p->mainBlock, in);
311      return;      return;
312    }
313    
314    void Paso_SystemMatrix_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) {
315       if (A->solver==NULL) {
316          A->solver=Paso_Preconditioner_alloc(A,options);
317       }
318    }
319    
320    /* applies the preconditioner */
321    /* has to be called within a parallel reqion */
322    /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */
323    void Paso_SystemMatrix_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){
324       Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->solver;
325       Paso_Preconditioner_solve(prec, A,x,b);
326    }
327    void Paso_SystemMatrix_freePreconditioner(Paso_SystemMatrix* A) {
328       Paso_Solver_Preconditioner* prec=NULL;
329       if (A!=NULL) {
330          prec=(Paso_Solver_Preconditioner*) A->solver;
331          Paso_Preconditioner_free(prec);
332          A->solver=NULL;
333       }
334  }  }

Legend:
Removed from v.3008  
changed lines
  Added in v.3120

  ViewVC Help
Powered by ViewVC 1.1.26