/[escript]/trunk/paso/src/Preconditioner.h
ViewVC logotype

Diff of /trunk/paso/src/Preconditioner.h

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

revision 3159 by gross, Mon Sep 6 06:59:31 2010 UTC revision 3193 by gross, Tue Sep 21 06:56:44 2010 UTC
# Line 47  void Paso_Preconditioner_LocalSmoother_S Line 47  void Paso_Preconditioner_LocalSmoother_S
47  void Paso_Preconditioner_LocalSmoother_Sweep_tiled(Paso_SparseMatrix* A, Paso_Preconditioner_LocalSmoother * gs, double * x);  void Paso_Preconditioner_LocalSmoother_Sweep_tiled(Paso_SparseMatrix* A, Paso_Preconditioner_LocalSmoother * gs, double * x);
48  void Paso_Preconditioner_LocalSmoother_Sweep_colored(Paso_SparseMatrix* A, Paso_Preconditioner_LocalSmoother * gs, double * x);  void Paso_Preconditioner_LocalSmoother_Sweep_colored(Paso_SparseMatrix* A, Paso_Preconditioner_LocalSmoother * gs, double * x);
49    
50    
51    /* AMG preconditioner */
52    struct Paso_Preconditioner_LocalAMG {
53       dim_t n;
54       dim_t level;
55      
56       /* ====================== */
57       bool_t coarsest_level;
58       dim_t n_block;
59       dim_t n_F;
60       dim_t n_C;
61      
62       Paso_SparseMatrix * A_FF;
63       Paso_SparseMatrix * A_FC;
64       Paso_SparseMatrix * A_CF;
65       Paso_SparseMatrix * W_FC;
66      
67       Paso_SparseMatrix * P;
68       Paso_SparseMatrix * R;
69      
70       index_t* rows_in_F;
71       index_t* rows_in_C;
72       index_t* mask_F;
73       index_t* mask_C;
74       double* x_F;
75       double* b_F;
76       double* x_C;
77       double* b_C;
78      
79       dim_t post_sweeps;
80       dim_t pre_sweeps;
81      
82       Paso_SparseMatrix * A;
83       Paso_SparseMatrix * AOffset1;
84       Paso_SparseMatrix * AUnrolled;
85       void* solver;
86       /*=================================*/
87      
88       Paso_Preconditioner_LocalSmoother* Smoother;
89       struct Paso_Preconditioner_LocalAMG * AMG_of_Coarse;
90    };
91    typedef struct Paso_Preconditioner_LocalAMG Paso_Preconditioner_LocalAMG;
92    
93    void Paso_Preconditioner_LocalAMG_free(Paso_Preconditioner_LocalAMG * in);
94    Paso_Preconditioner_LocalAMG* Paso_Preconditioner_LocalAMG_alloc(Paso_SparseMatrix * A_p,dim_t level,Paso_Options* options);
95    void Paso_Preconditioner_LocalAMG_solve(Paso_Preconditioner_LocalAMG * amg, double * x, double * b);
96    
97    
98    
99  /*===============================================*/  /*===============================================*/
100  /* ILU preconditioner */  /* ILU preconditioner */
101  struct Paso_Solver_ILU {  struct Paso_Solver_ILU {
# Line 56  typedef struct Paso_Solver_ILU Paso_Solv Line 105  typedef struct Paso_Solver_ILU Paso_Solv
105    
106    
107    
   
108  /* RILU preconditioner */  /* RILU preconditioner */
109  struct Paso_Solver_RILU {  struct Paso_Solver_RILU {
110    dim_t n;    dim_t n;
# Line 80  struct Paso_Solver_RILU { Line 128  struct Paso_Solver_RILU {
128  typedef struct Paso_Solver_RILU Paso_Solver_RILU;  typedef struct Paso_Solver_RILU Paso_Solver_RILU;
129    
130    
 /* AMG preconditioner */  
 struct Paso_Solver_AMG {  
   dim_t n;  
   dim_t level;  
   bool_t coarsest_level;  
   dim_t n_block;  
   dim_t n_F;  
   dim_t n_C;  
     
   Paso_SparseMatrix * A_FF;  
   Paso_SparseMatrix * A_FC;  
   Paso_SparseMatrix * A_CF;  
   Paso_SparseMatrix * W_FC;  
     
   Paso_SparseMatrix * P;  
   Paso_SparseMatrix * R;  
     
   index_t* rows_in_F;  
   index_t* rows_in_C;  
   index_t* mask_F;  
   index_t* mask_C;  
   double* x_F;  
   double* b_F;  
   double* x_C;  
   double* b_C;  
     
   dim_t post_sweeps;  
   dim_t pre_sweeps;  
     
   Paso_SparseMatrix * A;  
   Paso_SparseMatrix * AOffset1;  
   Paso_SparseMatrix * AUnrolled;  
   void* solver;  
   Paso_Preconditioner_LocalSmoother* Smoother;  
   struct Paso_Solver_AMG * AMG_of_Coarse;  
 };  
 typedef struct Paso_Solver_AMG Paso_Solver_AMG;  
131    
132    
133  /* AMLI preconditioner */  /* AMLI preconditioner */
# Line 162  typedef struct Paso_Solver_AMLI_System P Line 173  typedef struct Paso_Solver_AMLI_System P
173    
174  /* general preconditioner interface */  /* general preconditioner interface */
175    
176  typedef struct Paso_Solver_Preconditioner {  typedef struct Paso_Preconditioner {
177    dim_t type;    dim_t type;
178    dim_t sweeps;    dim_t sweeps;
179    /* jacobi preconditioner */    /* jacobi preconditioner */
180    Paso_Preconditioner_Smoother* jacobi;    Paso_Preconditioner_Smoother* jacobi;
181    /* Gauss-Seidel preconditioner */    /* Gauss-Seidel preconditioner */
182    Paso_Preconditioner_Smoother* gs;    Paso_Preconditioner_Smoother* gs;  
183      /* amg preconditioner */
184      Paso_Preconditioner_LocalAMG* localamg;
185      
186        
187    /* ilu preconditioner */    /* ilu preconditioner */
188    Paso_Solver_ILU* ilu;    Paso_Solver_ILU* ilu;
189    /* rilu preconditioner */    /* rilu preconditioner */
190    Paso_Solver_RILU* rilu;    Paso_Solver_RILU* rilu;
191    /* amg preconditioner */  
   Paso_Solver_AMG* amg;  
192    /* amg preconditioner */    /* amg preconditioner */
193    Paso_Solver_AMLI* amli;    Paso_Solver_AMLI* amli;
194    /* amg on System */    /* amg on System */
195    Paso_Solver_AMLI_System* amliSystem;    Paso_Solver_AMLI_System* amliSystem;
196        
197  } Paso_Solver_Preconditioner;  } Paso_Preconditioner;
198    
199    void Paso_Preconditioner_free(Paso_Preconditioner*);
200    Paso_Preconditioner* Paso_Preconditioner_alloc(Paso_SystemMatrix* A,Paso_Options* options);
201    void Paso_Preconditioner_solve(Paso_Preconditioner* prec, Paso_SystemMatrix* A,double*,double*);
202    
 void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);  
 Paso_Solver_Preconditioner* Paso_Preconditioner_alloc(Paso_SystemMatrix* A,Paso_Options* options);  
 void Paso_Preconditioner_solve(Paso_Solver_Preconditioner* prec, Paso_SystemMatrix* A,double*,double*);  
203    
204    
205    
206    
 /* AMG: */  
 void Paso_Solver_AMG_free(Paso_Solver_AMG * in);  
 Paso_Solver_AMG* Paso_Solver_getAMG(Paso_SparseMatrix * A_p,dim_t level,Paso_Options* options);  
 void Paso_Solver_solveAMG(Paso_Solver_AMG * amg, double * x, double * b);  
207    
208  /*******************************************/  /*******************************************/
209  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);

Legend:
Removed from v.3159  
changed lines
  Added in v.3193

  ViewVC Help
Powered by ViewVC 1.1.26