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 /****************************************************************************/ 00019 00020 /* Paso: interface to HYPRE, a software library of high performance 00021 * preconditioners and solvers. We use the BoomerAMG part provided 00022 * in this library 00023 */ 00024 00025 /****************************************************************************/ 00026 00027 /* Author: Lin Gao, l.gao@uq.edu.au */ 00028 00029 /****************************************************************************/ 00030 00031 #ifndef __PASO_BOOMERAMG_H__ 00032 #define __PASO_BOOMERAMG_H__ 00033 00034 #include "SystemMatrix.h" 00035 00036 #ifdef BOOMERAMG 00037 #include <HYPRE_krylov.h> 00038 #include <HYPRE.h> 00039 #include <HYPRE_parcsr_ls.h> 00040 #endif 00041 00042 namespace paso { 00043 00044 struct Preconditioner_BoomerAMG 00045 { 00046 #ifdef BOOMERAMG 00047 HYPRE_IJMatrix A; 00048 HYPRE_ParCSRMatrix parcsr_A; 00049 HYPRE_IJVector b; 00050 HYPRE_ParVector par_b; 00051 HYPRE_IJVector x; 00052 HYPRE_ParVector par_x; 00053 HYPRE_Solver solver; 00054 #else 00055 void* n; 00056 #endif 00057 }; 00058 00059 void Preconditioner_BoomerAMG_free(Preconditioner_BoomerAMG* in); 00060 Preconditioner_BoomerAMG* Preconditioner_BoomerAMG_alloc(SystemMatrix_ptr A, 00061 Options* options); 00062 00063 void Preconditioner_BoomerAMG_solve(SystemMatrix_ptr A, 00064 Preconditioner_BoomerAMG* amg, 00065 double* x, double * b); 00066 00067 00068 } // namespace paso 00069 00070 #endif // __PASO_BOOMERAMG_H__ 00071