00001 /* 00002 * ----------------------------------------------------------------- 00003 * $Revision: 1.2 $ 00004 * $Date: 2006/11/29 00:05:06 $ 00005 * ----------------------------------------------------------------- 00006 * Programmer(s): Aaron Collier and Radu Serban @ 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 header file for the CVODES scaled preconditioned TFQMR 00014 * linear solver, CVSPTFQMR. 00015 * 00016 * Part I contains function prototypes for using CVSPTFQMR on forward 00017 * problems (IVP integration and/or FSA) 00018 * 00019 * Part II contains function prototypes for using CVSPTFQMR on adjoint 00020 * (backward) problems 00021 * ----------------------------------------------------------------- 00022 */ 00023 00024 #ifndef _CVSSPTFQMR_H 00025 #define _CVSSPTFQMR_H 00026 00027 #ifdef __cplusplus /* wrapper to enable C++ usage */ 00028 extern "C" { 00029 #endif 00030 00031 #include <cvodes/cvodes_spils.h> 00032 #include <sundials/sundials_sptfqmr.h> 00033 00034 /* 00035 * ----------------------------------------------------------------- 00036 * PART I - forward problems 00037 * ----------------------------------------------------------------- 00038 */ 00039 00040 /* 00041 * ----------------------------------------------------------------- 00042 * Function : CVSptfqmr 00043 * ----------------------------------------------------------------- 00044 * A call to the CVSptfqmr function links the main CVODE integrator 00045 * with the CVSPTFQMR linear solver. 00046 * 00047 * cvode_mem is the pointer to the integrator memory returned by 00048 * CVodeCreate. 00049 * 00050 * pretype is the type of user preconditioning to be done. 00051 * This must be one of the four enumeration constants 00052 * PREC_NONE, PREC_LEFT, PREC_RIGHT, or PREC_BOTH defined 00053 * in iterative.h. These correspond to no preconditioning, 00054 * left preconditioning only, right preconditioning 00055 * only, and both left and right preconditioning, 00056 * respectively. 00057 * 00058 * maxl is the maximum Krylov dimension. This is an 00059 * optional input to the CVSPTFQMR solver. Pass 0 to 00060 * use the default value CVSPILS_MAXL=5. 00061 * 00062 * The return value of CVSptfqmr is one of: 00063 * CVSPILS_SUCCESS if successful 00064 * CVSPILS_MEM_NULL if the cvode memory was NULL 00065 * CVSPILS_MEM_FAIL if there was a memory allocation failure 00066 * CVSPILS_ILL_INPUT if a required vector operation is missing 00067 * The above constants are defined in cvodes_spils.h 00068 * ----------------------------------------------------------------- 00069 */ 00070 00071 SUNDIALS_EXPORT int CVSptfqmr(void *cvode_mem, int pretype, int maxl); 00072 00073 00074 /* 00075 * ----------------------------------------------------------------- 00076 * PART II - backward problems 00077 * ----------------------------------------------------------------- 00078 */ 00079 00080 SUNDIALS_EXPORT int CVSptfqmrB(void *cvadj_mem, int pretypeB, int maxlB); 00081 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif