00001 /* 00002 * ----------------------------------------------------------------- 00003 * $Revision: 1.2 $ 00004 * $Date: 2006/11/29 00:05:07 $ 00005 * ----------------------------------------------------------------- 00006 * Programmer(s): Allan Taylor, Alan Hindmarsh, Radu Serban, and 00007 * Aaron Collier @ LLNL 00008 * ----------------------------------------------------------------- 00009 * Copyright (c) 2002, The Regents of the University of California. 00010 * Produced at the Lawrence Livermore National Laboratory. 00011 * All rights reserved. 00012 * For details, see the LICENSE file. 00013 * ----------------------------------------------------------------- 00014 * This is the header file for the KINSOL Scaled Preconditioned GMRES 00015 * linear solver module, KINSPGMR. 00016 * ----------------------------------------------------------------- 00017 */ 00018 00019 #ifndef _KINSPGMR_H 00020 #define _KINSPGMR_H 00021 00022 #ifdef __cplusplus /* wrapper to enable C++ usage */ 00023 extern "C" { 00024 #endif 00025 00026 #include <kinsol/kinsol_spils.h> 00027 #include <sundials/sundials_spgmr.h> 00028 00029 /* 00030 * ----------------------------------------------------------------- 00031 * Function : KINSpgmr 00032 * ----------------------------------------------------------------- 00033 * KINSpgmr links the main KINSOL solver module with the SPGMR 00034 * linear solver module. The routine establishes the inter-module 00035 * interface by setting the generic KINSOL pointers linit, lsetup, 00036 * lsolve, and lfree to KINSpgmrInit, KINSpgmrSetup, KINSpgmrSolve, 00037 * and KINSpgmrFree, respectively. 00038 * 00039 * kinmem pointer to an internal memory block allocated during a 00040 * prior call to KINCreate 00041 * 00042 * maxl maximum allowable dimension of Krylov subspace (passing 00043 * a value of 0 (zero) will cause the default value 00044 * KINSPILS_MAXL (predefined constant) to be used) 00045 * 00046 * ----------------------------------------------------------------- 00047 * KINSpgmr Return Values 00048 * ----------------------------------------------------------------- 00049 * 00050 * The possible return values for the KINSpgmr subroutine are the 00051 * following: 00052 * 00053 * KINSPILS_SUCCESS : means the KINSPGMR linear solver module 00054 * (implementation of the GMRES method) was 00055 * successfully initialized - allocated system 00056 * memory and set shared variables to default 00057 * values [0] 00058 * 00059 * KINSPILS_MEM_NULL : means a NULL KINSOL memory block pointer was 00060 * given (must call the KINCreate and KINMalloc 00061 * memory allocation subroutines prior to 00062 * calling KINSpgmr) [-1] 00063 * 00064 * KINSPILS_MEM_FAIL : means either insufficient system resources 00065 * were available to allocate memory for the main 00066 * KINSPGMR data structure (type KINSpgmrMemRec), 00067 * or the SpgmrMalloc subroutine failed (unable 00068 * to allocate enough system memory for vector 00069 * storage and/or the main SPGMR data structure 00070 * (type SpgmrMemRec)) [-4] 00071 * 00072 * KINSPILS_ILL_INPUT : means a supplied parameter was invalid 00073 * (check error message) [-3] 00074 * 00075 * The above constants are defined in kinsol_spils.h 00076 * ----------------------------------------------------------------- 00077 */ 00078 00079 SUNDIALS_EXPORT int KINSpgmr(void *kinmem, int maxl); 00080 00081 00082 #ifdef __cplusplus 00083 } 00084 #endif 00085 00086 #endif