/[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 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3283 by gross, Mon Oct 18 22:39:28 2010 UTC
# Line 79  Paso_SystemMatrix* Paso_SystemMatrix_all Line 79  Paso_SystemMatrix* Paso_SystemMatrix_all
79       out->normalizer_is_valid=FALSE;       out->normalizer_is_valid=FALSE;
80       out->normalizer=NULL;       out->normalizer=NULL;
81       out->solver_package=PASO_PASO;         out->solver_package=PASO_PASO;  
82       out->solver=NULL;         out->solver_p=NULL;  
83       out->trilinos_data=NULL;       out->trilinos_data=NULL;
84       out->reference_counter=1;       out->reference_counter=1;
85       out->logical_row_block_size=row_block_size;       out->logical_row_block_size=row_block_size;
# Line 176  void Paso_SystemMatrix_free(Paso_SystemM Line 176  void Paso_SystemMatrix_free(Paso_SystemM
176    if (in!=NULL) {    if (in!=NULL) {
177       in->reference_counter--;       in->reference_counter--;
178       if (in->reference_counter<=0) {       if (in->reference_counter<=0) {
179        Paso_solve_free(in);
180          Paso_SystemMatrixPattern_free(in->pattern);          Paso_SystemMatrixPattern_free(in->pattern);
181          Paso_Distribution_free(in->row_distribution);          Paso_Distribution_free(in->row_distribution);
182          Paso_Distribution_free(in->col_distribution);          Paso_Distribution_free(in->col_distribution);
# Line 312  void Paso_SystemMatrix_copyToMainDiagona Line 313  void Paso_SystemMatrix_copyToMainDiagona
313  }  }
314    
315  void Paso_SystemMatrix_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) {  void Paso_SystemMatrix_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) {
316     if (A->solver==NULL) {     if (A->solver_p==NULL) {
317        A->solver=Paso_Preconditioner_alloc(A,options);        A->solver_p=Paso_Preconditioner_alloc(A,options);
318     }     }
319  }  }
320    
# Line 321  void Paso_SystemMatrix_setPreconditioner Line 322  void Paso_SystemMatrix_setPreconditioner
322  /* has to be called within a parallel reqion */  /* has to be called within a parallel reqion */
323  /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */  /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */
324  void Paso_SystemMatrix_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){  void Paso_SystemMatrix_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){
325     Paso_Preconditioner* prec=(Paso_Preconditioner*) A->solver;     Paso_Preconditioner* prec=(Paso_Preconditioner*) A->solver_p;
326     Paso_Preconditioner_solve(prec, A,x,b);     Paso_Preconditioner_solve(prec, A,x,b);
327  }  }
328  void Paso_SystemMatrix_freePreconditioner(Paso_SystemMatrix* A) {  void Paso_SystemMatrix_freePreconditioner(Paso_SystemMatrix* A) {
329     Paso_Preconditioner* prec=NULL;     Paso_Preconditioner* prec=NULL;
330     if (A!=NULL) {     if (A!=NULL) {
331        prec=(Paso_Preconditioner*) A->solver;        prec=(Paso_Preconditioner*) A->solver_p;
332        Paso_Preconditioner_free(prec);        Paso_Preconditioner_free(prec);
333        A->solver=NULL;        A->solver_p=NULL;
334     }     }
335  }  }

Legend:
Removed from v.3259  
changed lines
  Added in v.3283

  ViewVC Help
Powered by ViewVC 1.1.26