Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

cvodedata.h

Go to the documentation of this file.
00001 /*
00002   Last changed Time-stamp: <2005-12-21 18:09:54 raim>
00003   $Id: cvodedata.h,v 1.27 2005/12/21 17:02:53 raimc Exp $
00004 */
00005 /* 
00006  *
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published
00009  * by the Free Software Foundation; either version 2.1 of the License, or
00010  * any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
00014  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
00015  * documentation provided hereunder is on an "as is" basis, and the
00016  * authors have no obligations to provide maintenance, support,
00017  * updates, enhancements or modifications.  In no event shall the
00018  * authors be liable to any party for direct, indirect, special,
00019  * incidental or consequential damages, including lost profits, arising
00020  * out of the use of this software and its documentation, even if the
00021  * authors have been advised of the possibility of such damage.  See
00022  * the GNU Lesser General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this library; if not, write to the Free Software Foundation,
00026  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00027  *
00028  * The original code contained here was initially developed by:
00029  *
00030  *     Rainer Machne
00031  *
00032  * Contributor(s):
00033  *     Andrew Finney
00034  *     
00035  */
00036 
00037 #ifndef _CVODEDATA_H_
00038 #define _CVODEDATA_H_
00039 
00040 /* Header Files for CVODE: required only for realtype *p  */
00041 #include "nvector_serial.h"
00042 
00043 #include <stdio.h>
00044 #include <sbml/SBMLTypes.h>
00045 
00046 #include "sbmlsolver/cvodedatatype.h"
00047 #include "sbmlsolver/odemodeldatatype.h"
00048 #include "sbmlsolver/integratorSettings.h"
00049 #include "sbmlsolver/exportdefs.h"
00050 #include "sbmlsolver/odeModel.h"
00051 
00052 
00055 struct cvodeResults {
00056   int nout;        
00060   double *time;    
00063   int nvalues;     
00066   double **value;
00067 
00068   /* number of variables x(t) for which sensitivities are calculated */
00069   int neq;
00071   int nsens;
00073   double ***sensitivity;
00074 
00075 } ;
00076 
00090 struct cvodeData {
00091 
00092   odeModel_t *model;
00093   
00094   /* ODEs f(x,p,t) = dx/dt and values x. The ODEs are usually
00095      optimized versions of the same array in odeModel */
00096   int neq;         
00097   ASTNode_t **ode; 
00100   int nvalues; 
00104   double *value; 
00105 
00107   float currenttime;
00108 
00109   /* current sensitivities: dx(t)/dp */
00110   int nsens;            
00111   double **sensitivity; 
00114   realtype *p;
00115   
00118   cvodeSettings_t *opt;
00119   
00122   int *trigger;
00124   int steadystate; 
00125 
00128   cvodeResults_t *results;
00129 
00131   int run;
00132 
00133 } ;
00134 
00135 #ifdef __cplusplus
00136 extern "C" {
00137 #endif
00138   /* create data for formula evaluation */
00139   SBML_ODESOLVER_API cvodeData_t *CvodeData_create(odeModel_t *);
00140   SBML_ODESOLVER_API void CvodeData_initializeValues(cvodeData_t *);
00141   SBML_ODESOLVER_API void CvodeData_free(cvodeData_t *);
00142   /* get values from cvodeResults */
00143   SBML_ODESOLVER_API double CvodeResults_getTime(cvodeResults_t *, int);
00144   SBML_ODESOLVER_API double CvodeResults_getValue(cvodeResults_t *, variableIndex_t *, int);
00145   SBML_ODESOLVER_API int CvodeResults_getNout(cvodeResults_t *);
00146   SBML_ODESOLVER_API void CvodeData_free(cvodeData_t *);
00147   SBML_ODESOLVER_API cvodeData_t *CvodeData_create(odeModel_t *);
00148   SBML_ODESOLVER_API double CvodeResults_getSensitivityByNum(cvodeResults_t *,  int value, int parameter, int timestep);
00149   SBML_ODESOLVER_API double CvodeResults_getSensitivity(cvodeResults_t *,  variableIndex_t *y,  variableIndex_t *p, int timestep);
00150   SBML_ODESOLVER_API void CvodeResults_free(cvodeResults_t *);
00151 #ifdef __cplusplus
00152 }
00153 #endif
00154 
00155 
00156 /* internal functions used by integratorInstance.c */
00157 int CvodeData_initialize(cvodeData_t *, cvodeSettings_t *, odeModel_t *);
00158 cvodeResults_t *CvodeResults_create(cvodeData_t *, int);
00159 int CvodeResults_allocateSens(cvodeResults_t *, int neq, int nsens, int nout);
00160 
00161 
00162 #endif
00163 
00164 /* End of file */

Generated on Wed Dec 21 18:10:07 2005 for SBML ODE Solver Library API by  doxygen 1.4.4