/[ascend]/trunk/solvers/ida/idalinear.h
ViewVC logotype

Annotation of /trunk/solvers/ida/idalinear.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1507 - (hide annotations) (download) (as text)
Wed Jun 27 11:25:37 2007 UTC (16 years, 10 months ago) by jpye
File MIME type: text/x-chdr
File size: 2989 byte(s)
Moving integrators to own directory, about to make them self-contained shared libraries.
1 johnpye 1012 /* ASCEND modelling environment
2     Copyright (C) 2006 Carnegie Mellon University
3    
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2, or (at your option)
7     any later version.
8    
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12     GNU General Public License for more details.
13    
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 59 Temple Place - Suite 330,
17     Boston, MA 02111-1307, USA.
18     *//** @file
19     This file presents a linear solver interface that can be utilised by the
20     IDA integrator from the SUNDIALS suite by LLNL. The linear solver uses the
21     ASCEND linsolqr routines internally, and takes advantage of the block
22     decomposition functionality available in ASCEND.
23    
24     EXPERIMENTAL -- INCOMPLETE -- UNDER DEVELOPMENT
25    
26     This file and idalinear.c are modelled fairly closely on ida_dense.c from
27     the SUNDIALS distribution, which maps out the expected use of ida_lmem
28     data structure, etc.
29    
30     @see http://www.llnl.gov/casc/sundials/
31     */
32     #ifndef ASC_IDALINEAR_H
33     #define ASC_IDALINEAR_H
34    
35 johnpye 1066 /** @addtogroup integrator Integrator
36     @{
37     */
38    
39 jpye 1403 #if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==2
40     # include <sundials/sundials_config.h>
41     # include <sundials/sundials_nvector.h>
42     # include <ida.h>
43     # include <ida/ida_spgmr.h>
44     #else
45     # include <sundials/sundials_config.h>
46     # include <nvector/nvector_serial.h>
47     # include <ida/ida.h>
48     #endif
49    
50 johnpye 1183 #include <linear/mtx.h>
51 johnpye 1012
52     /**
53     Function prototype for sparse jacobian evaluation as required by this linear solver
54     */
55     typedef int IntegratorSparseJacFn(long int Neq, realtype tt
56     , N_Vector yy, N_Vector yp, N_Vector rr
57     , realtype c_j, void *jac_data, mtx_matrix_t Jac
58     , N_Vector tmp1, N_Vector tmp2, N_Vector tmp3
59     );
60    
61     #define IDAASCEND_SUCCESS 0
62    
63 johnpye 1013 #define IDAASCEND_JACFN_RECVR 1
64 johnpye 1012
65     #define IDAASCEND_MEM_NULL -1
66     #define IDAASCEND_LMEM_NULL -2
67     #define IDAASCEND_MEM_FAIL -4
68     #define IDAASCEND_JACFN_UNDEF -5
69 johnpye 1013 #define IDAASCEND_JACFN_UNRECVR -6
70    
71 johnpye 1012 /*------------------------------------
72     User functions (called from ida.c in this directory)
73     */
74    
75     /**
76     Configure IDA to use the ASCEND linear solver
77    
78     @param size IDA problem size (number of equations)
79     */
80     int IDAASCEND(void *ida_mem, long size);
81    
82     /**
83     Register a (sparse mtx) Jacobian evaluation function with the linear solver (required)
84     */
85     int IDAASCENDSetJacFn(void *ida_mem, IntegratorSparseJacFn *jacfn, void *jac_data);
86    
87     /**
88     @param flag variable into which the last flag is returned
89     @return non-zero if unable to retrieve the last flag successfully (eg if ida_mem is NULL)
90     */
91     int IDAASCENDGetLastFlag(void *ida_mem, int *flag);
92    
93     /**
94     You need to free the returned string here.
95     */
96     char *IDAASCENDGetReturnFlagName(int flag);
97    
98 johnpye 1066 /* @} */
99    
100 johnpye 1012 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22