ESYS13  Revision_
Solver.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 
00015 #ifndef INC_SOLVER
00016 #define INC_SOLVER
00017 
00018 #include "SystemMatrix.h"
00019 #include "performance.h"
00020 #include "Functions.h"
00021 
00022 #define PASO_TRACE
00023 /* error codes used in the solver */
00024 #define SOLVER_NO_ERROR 0
00025 #define SOLVER_MAXITER_REACHED 1
00026 #define SOLVER_INPUT_ERROR -1
00027 #define SOLVER_MEMORY_ERROR -9
00028 #define SOLVER_BREAKDOWN -10
00029 #define SOLVER_NEGATIVE_NORM_ERROR -11
00030 #define SOLVER_DIVERGENCE -12
00031 
00032 #define TOLERANCE_FOR_SCALARS (double)(0.)
00033 
00034 PASO_DLL_API
00035 void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);
00036 
00037 PASO_DLL_API
00038 void Paso_Solver_free(Paso_SystemMatrix*);
00039 
00040 err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, Paso_Performance* pp);
00041 err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, Paso_Performance* pp);
00042 err_t Paso_Solver_TFQMR( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, Paso_Performance* pp);
00043 err_t Paso_Solver_MINRES( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, Paso_Performance* pp);
00044 err_t Paso_Solver_GMRES(Paso_SystemMatrix * A, double * r, double * x, dim_t *num_iter, double * tolerance,dim_t length_of_recursion,dim_t restart, Paso_Performance* pp);
00045 err_t Paso_Solver_GMRES2(Paso_Function * F, const double* f0, const double* x0, double * x, dim_t *iter, double* tolerance, Paso_Performance* pp);
00046 err_t Paso_Solver_NewtonGMRES(Paso_Function *F, double *x, Paso_Options* options, Paso_Performance* pp);
00047 
00048 Paso_Function * Paso_Function_LinearSystem_alloc(Paso_SystemMatrix* A, double* b, Paso_Options* options);
00049 err_t Paso_Function_LinearSystem_call(Paso_Function * F,double* value, const double* arg, Paso_Performance *pp);
00050 void Paso_Function_LinearSystem_free(Paso_Function * F);
00051 err_t Paso_Function_LinearSystem_setInitialGuess(Paso_SystemMatrix* A, double* x, Paso_Performance *pp);
00052 
00053 #endif /* #ifndef INC_SOLVER */
00054