00001 /* 00002 * ----------------------------------------------------------------- 00003 * $Revision: 1.2 $ 00004 * $Date: 2006/11/29 00:05:07 $ 00005 * ----------------------------------------------------------------- 00006 * Programmer(s): Aaron Collier @ LLNL 00007 * ----------------------------------------------------------------- 00008 * Copyright (c) 2005, The Regents of the University of California. 00009 * Produced at the Lawrence Livermore National Laboratory. 00010 * All rights reserved. 00011 * For details, see the LICENSE file. 00012 * ----------------------------------------------------------------- 00013 * This is the public header file for the KINSOL scaled preconditioned 00014 * TFQMR linear solver module, KINSPTFQMR. 00015 * ----------------------------------------------------------------- 00016 */ 00017 00018 #ifndef _KINSPTFQMR_H 00019 #define _KINSPTFQMR_H 00020 00021 #ifdef __cplusplus /* wrapper to enable C++ usage */ 00022 extern "C" { 00023 #endif 00024 00025 #include <kinsol/kinsol_spils.h> 00026 #include <sundials/sundials_sptfqmr.h> 00027 00028 /* 00029 * ----------------------------------------------------------------- 00030 * Function : KINSptfqmr 00031 * ----------------------------------------------------------------- 00032 * KINSptfqmr links the main KINSOL solver module with the SPTFQMR 00033 * linear solver module. The routine establishes the inter-module 00034 * interface by setting the generic KINSOL pointers linit, lsetup, 00035 * lsolve, and lfree to KINSptfqmrInit, KINSptfqmrSetup, KINSptfqmrSolve, 00036 * and KINSptfqmrFree, respectively. 00037 * 00038 * kinmem pointer to an internal memory block allocated during a 00039 * prior call to KINCreate 00040 * 00041 * maxl maximum allowable dimension of Krylov subspace (passing 00042 * a value of 0 (zero) will cause the default value 00043 * KINSPTFQMR_MAXL (predefined constant) to be used) 00044 * 00045 * If successful, KINSptfqmr returns KINSPTFQMR_SUCCESS. If an error 00046 * occurs, then KINSptfqmr returns an error code (negative integer 00047 * value). 00048 * 00049 * ----------------------------------------------------------------- 00050 * KINSptfqmr Return Values 00051 * ----------------------------------------------------------------- 00052 * The possible return values for the KINSptfqmr subroutine are the 00053 * following: 00054 * 00055 * KINSPTFQMR_SUCCESS : means the KINSPTFQMR linear solver module 00056 * (implementation of the TFQMR method) was 00057 * successfully initialized - allocated system 00058 * memory and set shared variables to default 00059 * values [0] 00060 * 00061 * KINSPTFQMR_MEM_NULL : means a NULL KINSOL memory block pointer 00062 * was given (must call the KINCreate and 00063 * KINMalloc memory allocation subroutines 00064 * prior to calling KINSptfqmr) [-1] 00065 * 00066 * KINSPTFQMR_MEM_FAIL : means either insufficient system resources 00067 * were available to allocate memory for the 00068 * main KINSPTFQMR data structure (type 00069 * KINSptfqmrMemRec), or the SptfqmrMalloc 00070 * subroutine failed (unable to allocate enough 00071 * system memory for vector storate and/or the 00072 * main SPTFQMR data structure 00073 * (type SptfqmrMemRec)) [-4] 00074 * 00075 * KINSPTFQMR_ILL_INPUT : means either a supplied parameter was invalid, 00076 * or the NVECTOR implementation is NOT 00077 * compatible [-3] 00078 * 00079 * The above constants are defined in kinsol_spils.h 00080 * ----------------------------------------------------------------- 00081 */ 00082 00083 SUNDIALS_EXPORT int KINSptfqmr(void *kinmem, int maxl); 00084 00085 00086 #ifdef __cplusplus 00087 } 00088 #endif 00089 00090 #endif