/[escript]/trunk/esys2/finley/src/finleyC/Solvers/Solver.c
ViewVC logotype

Diff of /trunk/esys2/finley/src/finleyC/Solvers/Solver.c

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

revision 114 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 115 by jgs, Fri Mar 4 07:12:47 2005 UTC
# Line 15  Line 15 
15  #include "System.h"  #include "System.h"
16  #include "Solver.h"  #include "Solver.h"
17  #include "Common.h"  #include "Common.h"
 #if ITERATIVE_SOLVER == NO_LIB  
18  #if PTR_OFFSET !=0 || INDEX_OFFSET!=0  #if PTR_OFFSET !=0 || INDEX_OFFSET!=0
19  #error Finley library usage requires PTR_OFFSET=0 and INDEX_OFFSET=0  #error Finley library usage requires PTR_OFFSET=0 and INDEX_OFFSET=0
20  #endif  #endif
 #endif  
21    
22    
23  /***********************************************************************************/  /***********************************************************************************/
# Line 27  Line 25 
25  /*  free space */  /*  free space */
26    
27  void Finley_Solver_free(Finley_SystemMatrix* A) {  void Finley_Solver_free(Finley_SystemMatrix* A) {
 #if ITERATIVE_SOLVER == NO_LIB  
28      Finley_Preconditioner_free(A->iterative);      Finley_Preconditioner_free(A->iterative);
29      A->iterative=NULL;      A->iterative=NULL;
 #endif  
30  }  }
31  /*  call the iterative solver: */  /*  call the iterative solver: */
32    
33  void Finley_Solver(Finley_SystemMatrix* A,double* x,double* b,Finley_SolverOptions* options) {  void Finley_Solver(Finley_SystemMatrix* A,double* x,double* b,Finley_SolverOptions* options) {
 #if ITERATIVE_SOLVER == NO_LIB  
34      double norm2OfB,tol,tolerance,time_iter,time_prec,*r=NULL,norm_of_residual,last_norm_of_residual;      double norm2OfB,tol,tolerance,time_iter,time_prec,*r=NULL,norm_of_residual,last_norm_of_residual;
35      int i,totIter,cntIter,finalizeIteration,errorCode,method;      int i,totIter,cntIter,finalizeIteration,errorCode,method;
36      int n_col = A->num_cols * A-> col_block_size;      int n_col = A->num_cols * A-> col_block_size;
# Line 216  void Finley_Solver(Finley_SystemMatrix* Line 211  void Finley_Solver(Finley_SystemMatrix*
211         printf("timing: preconditioner: %.4e sec\n",time_prec);         printf("timing: preconditioner: %.4e sec\n",time_prec);
212         if (totIter>0) printf("timing: per iteration step: %.4e sec\n",time_iter/totIter);         if (totIter>0) printf("timing: per iteration step: %.4e sec\n",time_iter/totIter);
213      }      }
 #else  
     Finley_ErrorCode=SYSTEM_ERROR;  
     sprintf(Finley_ErrorMsg,"No native Finley solver available.");  
 #endif  
214  }  }

Legend:
Removed from v.114  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26