escript
Revision_
|
00001 00002 /***************************************************************************** 00003 * 00004 * Copyright (c) 2003-2014 by University of Queensland 00005 * http://www.uq.edu.au 00006 * 00007 * Primary Business: Queensland, Australia 00008 * Licensed under the Open Software License version 3.0 00009 * http://www.opensource.org/licenses/osl-3.0.php 00010 * 00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC) 00012 * Development 2012-2013 by School of Earth Sciences 00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp) 00014 * 00015 *****************************************************************************/ 00016 00017 00018 #ifndef __PASO_SOLVER_H__ 00019 #define __PASO_SOLVER_H__ 00020 00021 #include "SystemMatrix.h" 00022 #include "performance.h" 00023 #include "Functions.h" 00024 00025 namespace paso { 00026 00027 // error codes used in the solver 00028 #define SOLVER_NO_ERROR 0 00029 #define SOLVER_MAXITER_REACHED 1 00030 #define SOLVER_INPUT_ERROR -1 00031 #define SOLVER_MEMORY_ERROR -9 00032 #define SOLVER_BREAKDOWN -10 00033 #define SOLVER_NEGATIVE_NORM_ERROR -11 00034 #define SOLVER_DIVERGENCE -12 00035 00036 #define TOLERANCE_FOR_SCALARS (double)(0.) 00037 00038 void solve(SystemMatrix_ptr A, double* out, double* in, Options* options); 00039 00040 void solve_free(SystemMatrix* A); 00041 00042 PASO_DLL_API 00043 void Solver(SystemMatrix_ptr, double*, double*, Options*, Performance*); 00044 00045 PASO_DLL_API 00046 void Solver_free(SystemMatrix*); 00047 00048 err_t Solver_BiCGStab(SystemMatrix_ptr A, double* B, double* X, dim_t* iter, 00049 double* tolerance, Performance* pp); 00050 00051 err_t Solver_PCG(SystemMatrix_ptr A, double* B, double* X, dim_t* iter, 00052 double* tolerance, Performance* pp); 00053 00054 err_t Solver_TFQMR(SystemMatrix_ptr A, double* B, double* X, dim_t* iter, 00055 double* tolerance, Performance* pp); 00056 00057 err_t Solver_MINRES(SystemMatrix_ptr A, double* B, double* X, dim_t* iter, 00058 double* tolerance, Performance* pp); 00059 00060 err_t Solver_GMRES(SystemMatrix_ptr A, double* r, double* x, dim_t* num_iter, 00061 double* tolerance, dim_t length_of_recursion, dim_t restart, 00062 Performance* pp); 00063 00064 err_t Solver_GMRES2(Function* F, const double* f0, const double* x0, double* x, 00065 dim_t* iter, double* tolerance, Performance* pp); 00066 00067 err_t Solver_NewtonGMRES(Function* F, double* x, Options* options, 00068 Performance* pp); 00069 00070 } // namespace paso 00071 00072 #endif // __PASO_SOLVER_H__ 00073