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

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

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

revision 114 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 115 by jgs, Fri Mar 4 07:12:47 2005 UTC
# Line 3  Line 3 
3  #ifndef INC_SOLVER  #ifndef INC_SOLVER
4  #define INC_SOLVER  #define INC_SOLVER
5    
6    #include "System.h"
7    
8  #define FINLEY_SOLVER_TRACE  #define FINLEY_SOLVER_TRACE
9  /* error codes used in the solver */  /* error codes used in the solver */
10  #define SOLVER_NO_ERROR 0  #define SOLVER_NO_ERROR 0
# Line 11  Line 13 
13  #define SOLVER_MEMORY_ERROR -9  #define SOLVER_MEMORY_ERROR -9
14  #define SOLVER_BREAKDOWN -10  #define SOLVER_BREAKDOWN -10
15    
16    /* ILU preconditioner */
17    struct Finley_Solver_ILU {
18      int n;
19      int n_block;
20      int n_F;
21      int n_C;
22      double* inv_A_FF;
23      maybelong* A_FF_pivot;
24      Finley_SystemMatrix * A_FC;
25      Finley_SystemMatrix * A_CF;
26      maybelong* rows_in_F;
27      maybelong* rows_in_C;
28      maybelong* mask_F;
29      maybelong* mask_C;
30      double* x_F;
31      double* b_F;
32      double* x_C;
33      double* b_C;
34      struct Finley_Solver_ILU * ILU_of_Schur;
35    };
36    typedef struct Finley_Solver_ILU Finley_Solver_ILU;
37    
38    
39    /* jacobi  preconditioner */
40    
41    typedef struct Finley_Solver_Jacobi {
42      int n_block;
43      int n;
44      double* values;
45      maybelong* pivot;
46    } Finley_Solver_Jacobi;
47    
48    /* general preconditioner interface */
49    
50  typedef struct Finley_Solver_Preconditioner {  typedef struct Finley_Solver_Preconditioner {
51    int type;    int type;
52    double* values;    /* jacobi preconditioner */
53    int numColors;    Finley_Solver_Jacobi* jacobi;
54    maybelong *mainDiag;    /* ilu preconditioner */
55    maybelong *color;    Finley_Solver_ILU* ilu;
   int *pivot;  
56  } Finley_Solver_Preconditioner;  } Finley_Solver_Preconditioner;
57    
   
   
58  void Finley_Solver(Finley_SystemMatrix*,double*,double*,Finley_SolverOptions*);  void Finley_Solver(Finley_SystemMatrix*,double*,double*,Finley_SolverOptions*);
59  void Finley_Solver_free(Finley_SystemMatrix*);  void Finley_Solver_free(Finley_SystemMatrix*);
60  int Finley_Solver_BiCGStab( Finley_SystemMatrix * A, double* B, double * X, int *iter, double * tolerance);  int Finley_Solver_BiCGStab( Finley_SystemMatrix * A, double* B, double * X, int *iter, double * tolerance);
61  int Finley_Solver_PCG( Finley_SystemMatrix * A, double* B, double * X, int *iter, double * tolerance);  int Finley_Solver_PCG( Finley_SystemMatrix * A, double* B, double * X, int *iter, double * tolerance);
62  int Finley_Solver_GMRES(Finley_SystemMatrix * A, double * r, double * x, int *num_iter, double * tolerance,int length_of_recursion,int restart);  int Finley_Solver_GMRES(Finley_SystemMatrix * A, double * r, double * x, int *num_iter, double * tolerance,int length_of_recursion,int restart);
63  void Finley_Preconditioner_free(void* in);  void Finley_Preconditioner_free(Finley_Solver_Preconditioner*);
64  void Finley_Solver_setPreconditioner(Finley_SystemMatrix* A,Finley_SolverOptions* options);  void Finley_Solver_setPreconditioner(Finley_SystemMatrix* A,Finley_SolverOptions* options);
65  void Finley_Solver_solvePreconditioner(Finley_SystemMatrix* A,double*,double*);  void Finley_Solver_solvePreconditioner(Finley_SystemMatrix* A,double*,double*);
66    void Finley_Solver_applyBlockDiagonalMatrix(int n_block,int n,double* D,maybelong* pivot,double* x,double* b);
67    void Finley_Solver_ILU_free(Finley_Solver_ILU * in);
68    Finley_Solver_ILU* Finley_Solver_getILU(Finley_SystemMatrix * A_p,int verbose);
69    void Finley_Solver_solveILU(Finley_Solver_ILU * ilu, double * x, double * b);
70    void Finley_Solver_updateIncompleteSchurComplement(Finley_SystemMatrix* A_CC,Finley_SystemMatrix *A_CF,double* invA_FF,maybelong* A_FF_pivot,Finley_SystemMatrix *A_FC);
71    Finley_Solver_Jacobi* Finley_Solver_getJacobi(Finley_SystemMatrix * A_p);
72    void Finley_Solver_solveJacobi(Finley_Solver_Jacobi * prec, double * x, double * b);
73    void Finley_Solver_Jacobi_free(Finley_Solver_Jacobi * in);
74    
 void Finley_Solver_setJacobi(Finley_SystemMatrix*);  
 void Finley_Solver_solveJacobi(Finley_SystemMatrix*, double*, double*);  
 void Finley_Solver_setILU0(Finley_SystemMatrix*);  
 void Finley_Solver_solveILU0(Finley_SystemMatrix*, double*, double*);  
   
 void Finley_Solver_getMainDiagonal(Finley_SystemMatrix*,maybelong*);  
 void Finley_Solver_mis(Finley_SystemMatrixPattern* pattern_p, maybelong* mis_marker);  
75    
 void Finley_Solver_coloring(Finley_SystemMatrixPattern*,maybelong*,maybelong*);  
76    
77  #endif /* #ifndef INC_SOLVER */  #endif /* #ifndef INC_SOLVER */

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

  ViewVC Help
Powered by ViewVC 1.1.26