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

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

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

revision 3119 by gross, Fri Aug 20 04:59:12 2010 UTC revision 3120 by gross, Mon Aug 30 10:48:00 2010 UTC
# Line 30  Line 30 
30  #define SOLVER_DIVERGENCE -12  #define SOLVER_DIVERGENCE -12
31    
32  #define TOLERANCE_FOR_SCALARS (double)(0.)  #define TOLERANCE_FOR_SCALARS (double)(0.)
 #define PASO_ONE (double)(1.0)  
 #define PASO_ZERO (double)(0.0)  
   
 #define MAX_BLOCK_SIZE 3  
   
 /* static double ONE=1.; */  
 /* static double ZERO=0.;*/  
 /*static double TOLERANCE_FOR_SCALARS=0.;*/  
   
 /* jacobi  preconditioner */  
   
 typedef struct Paso_Solver_Jacobi {  
   double* values;  
   index_t* pivot;  
 } Paso_Solver_Jacobi;  
   
 /* GS preconditioner */  
 typedef struct Paso_Solver_LocalGS {  
    double* diag;  
    double* buffer;  
    index_t* pivot;  
    dim_t sweeps;  
 } Paso_Solver_LocalGS;  
   
 typedef struct Paso_Solver_GS {  
    Paso_Solver_LocalGS* localGS;  
    bool_t is_local;  
 } Paso_Solver_GS;  
   
   
   
 /*===============================================*/  
 /* ILU preconditioner */  
 struct Paso_Solver_ILU {  
   double* factors;  
 };  
 typedef struct Paso_Solver_ILU Paso_Solver_ILU;  
   
   
   
   
 /* RILU preconditioner */  
 struct Paso_Solver_RILU {  
   dim_t n;  
   dim_t n_block;  
   dim_t n_F;  
   dim_t n_C;  
   double* inv_A_FF;  
   index_t* A_FF_pivot;  
   Paso_SparseMatrix * A_FC;  
   Paso_SparseMatrix * A_CF;  
   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;  
   struct Paso_Solver_RILU * RILU_of_Schur;  
 };  
 typedef struct Paso_Solver_RILU Paso_Solver_RILU;  
   
 struct Paso_Solver_Smoother {  
   dim_t ID;    
   Paso_Solver_Jacobi* Jacobi;  
   Paso_Solver_LocalGS* GS;  
 };  
 typedef struct  Paso_Solver_Smoother  Paso_Solver_Smoother;  
   
 /* 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_Solver_Smoother* Smoother;  
   struct Paso_Solver_AMG * AMG_of_Coarse;  
 };  
 typedef struct Paso_Solver_AMG Paso_Solver_AMG;  
   
   
 /* AMLI preconditioner */  
 struct Paso_Solver_AMLI {  
   dim_t n;  
   dim_t level;  
   bool_t coarsest_level;  
   dim_t n_block;  
   dim_t n_F;  
   dim_t n_C;  
   double* inv_A_FF;  
   index_t* A_FF_pivot;  
   Paso_SparseMatrix * A_FC;  
   Paso_SparseMatrix * A_CF;  
   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;  
   void* solver;  
   Paso_Solver_Jacobi* GS;  
   struct Paso_Solver_AMLI * AMLI_of_Schur;  
 };  
 typedef struct Paso_Solver_AMLI Paso_Solver_AMLI;  
   
   
 /* AMLI preconditioner on blocks*/  
 struct Paso_Solver_AMLI_System {  
     dim_t block_size;  
     Paso_SparseMatrix *block[MAX_BLOCK_SIZE];  
     Paso_Solver_AMLI *amliblock[MAX_BLOCK_SIZE];  
 };  
 typedef struct Paso_Solver_AMLI_System Paso_Solver_AMLI_System;  
   
   
 /* AMG preconditioner on blocks*/  
 struct Paso_Solver_AMG_System {  
     dim_t block_size;  
     Paso_SparseMatrix *block[MAX_BLOCK_SIZE];  
     Paso_Solver_AMG *amgblock[MAX_BLOCK_SIZE];  
 };  
 typedef struct Paso_Solver_AMG_System Paso_Solver_AMG_System;  
   
 /* general preconditioner interface */  
   
 typedef struct Paso_Solver_Preconditioner {  
   dim_t type;  
   
   /* jacobi preconditioner */  
   Paso_Solver_Jacobi* jacobi;  
   /* Gauss-Seidel preconditioner */  
   Paso_Solver_GS* gs;  
     
   /* ilu preconditioner */  
   Paso_Solver_ILU* ilu;  
   /* rilu preconditioner */  
   Paso_Solver_RILU* rilu;  
   /* amg preconditioner */  
   Paso_Solver_AMG* amg;  
   /* amg on System */  
   Paso_Solver_AMG_System* amgSystem;  
   /* amg preconditioner */  
   Paso_Solver_AMLI* amli;  
   /* amg on System */  
   Paso_Solver_AMLI_System* amliSystem;  
     
 } Paso_Solver_Preconditioner;  
33    
34  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);
35  void Paso_Solver_free(Paso_SystemMatrix*);  void Paso_Solver_free(Paso_SystemMatrix*);
# Line 229  err_t Paso_Function_LinearSystem_call(Pa Line 46  err_t Paso_Function_LinearSystem_call(Pa
46  void Paso_Function_LinearSystem_free(Paso_Function * F);  void Paso_Function_LinearSystem_free(Paso_Function * F);
47  err_t Paso_Function_LinearSystem_setInitialGuess(Paso_SystemMatrix* A, double* x, Paso_Performance *pp);  err_t Paso_Function_LinearSystem_setInitialGuess(Paso_SystemMatrix* A, double* x, Paso_Performance *pp);
48    
 void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);  
 void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);  
 void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);  
 void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);  
   
 Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);  
 void Paso_Solver_solveJacobi(Paso_SystemMatrix * A_p, Paso_Solver_Jacobi * prec, double * x, double * b);  
 void Paso_Solver_solveLocalJacobi(Paso_SparseMatrix * A_p, Paso_Solver_Jacobi * prec, double * x, double * b);  
 void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);  
 Paso_Solver_Jacobi* Paso_Solver_getLocalJacobi(Paso_SparseMatrix * A_p);  
   
 void Paso_Solver_GS_free(Paso_Solver_GS * in);  
 void Paso_Solver_LocalGS_free(Paso_Solver_LocalGS * in);  
 Paso_Solver_GS* Paso_Solver_getGS(Paso_SystemMatrix * A_p, dim_t sweeps, bool_t is_local, bool_t verbose);  
 Paso_Solver_LocalGS* Paso_Solver_getLocalGS(Paso_SparseMatrix * A_p, dim_t sweeps, bool_t verbose);  
 void Paso_Solver_solveGS(Paso_SystemMatrix* A, Paso_Solver_GS * gs, double * x, const double * b);  
 void Paso_Solver_solveLocalGS(Paso_SparseMatrix* A, Paso_Solver_LocalGS * gs, double * x, const double * b);  
   
 void Paso_Solver_localGSSweep(Paso_SparseMatrix* A, Paso_Solver_LocalGS * gs, double * x);  
 void Paso_Solver_localGSSweep_sequential(Paso_SparseMatrix* A, Paso_Solver_LocalGS * gs, double * x);  
 void Paso_Solver_localGSSweep_tiled(Paso_SparseMatrix* A, Paso_Solver_LocalGS * gs, double * x);  
 void Paso_Solver_localGSSweep_colored(Paso_SparseMatrix* A, Paso_Solver_LocalGS * gs, double * x);  
   
 /*******************************************/  
 void Paso_Solver_ILU_free(Paso_Solver_ILU * in);  
 Paso_Solver_ILU* Paso_Solver_getILU(Paso_SparseMatrix * A_p,bool_t verbose);  
 void Paso_Solver_solveILU(Paso_SparseMatrix * A, Paso_Solver_ILU * ilu, double * x, const double * b);  
   
 void Paso_Solver_RILU_free(Paso_Solver_RILU * in);  
 Paso_Solver_RILU* Paso_Solver_getRILU(Paso_SparseMatrix * A_p,bool_t verbose);  
 void Paso_Solver_solveRILU(Paso_Solver_RILU * rilu, double * x, double * b);  
   
 void Paso_Solver_AMG_System_free(Paso_Solver_AMG_System * in);  
 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);  
   
 void Paso_Solver_AMLI_System_free(Paso_Solver_AMLI_System * in);  
 void Paso_Solver_AMLI_free(Paso_Solver_AMLI * in);  
 Paso_Solver_AMLI* Paso_Solver_getAMLI(Paso_SparseMatrix * A_p,dim_t level,Paso_Options* options);  
 void Paso_Solver_solveAMLI(Paso_Solver_AMLI * amli, double * x, double * b);  
   
 void Paso_Solver_updateIncompleteSchurComplement(Paso_SparseMatrix* A_CC, Paso_SparseMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot, Paso_SparseMatrix *A_FC);  
   
   
   
   
   
   
49  #endif /* #ifndef INC_SOLVER */  #endif /* #ifndef INC_SOLVER */

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

  ViewVC Help
Powered by ViewVC 1.1.26