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) 2004, 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 * Bi-CGSTAB linear solver module, KINSPBCG. 00015 * ----------------------------------------------------------------- 00016 */ 00017 00018 #ifndef _KINSPBCG_H 00019 #define _KINSPBCG_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_spbcgs.h> 00027 00028 /* 00029 * ----------------------------------------------------------------- 00030 * Function : KINSpbcg 00031 * ----------------------------------------------------------------- 00032 * KINSpbcg links the main KINSOL solver module with the SPBCG 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 KINSpbcgInit, KINSpbcgSetup, KINSpbcgSolve, 00036 * and KINSpbcgFree, 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 * KINSPILS_MAXL (predefined constant) to be used) 00044 * 00045 * If successful, KINSpbcg returns KINSPILS_SUCCESS. If an error 00046 * occurs, then KINSpbcg returns an error code (negative integer 00047 * value). 00048 * 00049 * ----------------------------------------------------------------- 00050 * KINSpbcg Return Values 00051 * ----------------------------------------------------------------- 00052 * The possible return values for the KINSpbcg subroutine are the 00053 * following: 00054 * 00055 * KINSPILS_SUCCESS : means the KINSPBCG linear solver module 00056 * (implementation of the Bi-CGSTAB method) was 00057 * successfully initialized - allocated system 00058 * memory and set shared variables to default 00059 * values [0] 00060 * 00061 * KINSPILS_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 KINSpbcg) [-1] 00065 * 00066 * KINSPILS_MEM_FAIL : means either insufficient system resources 00067 * were available to allocate memory for the 00068 * main KINSPBCG data structure (type 00069 * KINSpbcgMemRec), or the SpbcgMalloc subroutine 00070 * failed (unable to allocate enough system 00071 * memory for vector storate and/or the main 00072 * SPBCG data structure (type SpbcgMemRec)) [-4] 00073 * 00074 * KINSPILS_ILL_INPUT : means either a supplied parameter was invalid, 00075 * or the NVECTOR implementation is NOT 00076 * compatible [-3] 00077 * 00078 * The above constants are defined in kinsol_spils.h 00079 * ----------------------------------------------------------------- 00080 */ 00081 00082 SUNDIALS_EXPORT int KINSpbcg(void *kinmem, int maxl); 00083 00084 00085 #ifdef __cplusplus 00086 } 00087 #endif 00088 00089 #endif