/[ascend]/trunk/base/generic/solver/ida.c
ViewVC logotype

Diff of /trunk/base/generic/solver/ida.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 912 by johnpye, Fri Oct 27 07:18:21 2006 UTC revision 913 by johnpye, Sat Oct 28 03:55:19 2006 UTC
# Line 54  Line 54 
54    
55  /* SUNDIALS includes */  /* SUNDIALS includes */
56  #ifdef ASC_WITH_IDA  #ifdef ASC_WITH_IDA
57    # include <sundials/sundials_config.h>
58  # include <ida/ida.h>  # include <ida/ida.h>
59  # include <nvector/nvector_serial.h>  # include <nvector/nvector_serial.h>
60  # include <ida/ida_spgmr.h>  # include <ida/ida_spgmr.h>
# Line 62  Line 63 
63  # endif  # endif
64  #endif  #endif
65    
66    /*
67        for the benefit of build tools that didn't sniff the SUNDIALS version, we
68        assume version 2.2.x (and thence possible errors)
69    */
70    #ifndef SUNDIALS_VERSION_MINOR
71    # warning "GUESSING SUNDIALS VERSION 2.2"
72    # define SUNDIALS_VERSION_MINOR 2
73    #endif
74    #ifndef SUNDIALS_VERSION_MAJOR
75    # define SUNDIALS_VERSION_MAJOR 2
76    #endif
77    
78  /* check that we've got what we expect now */  /* check that we've got what we expect now */
79  #ifndef ASC_IDA_H  #ifndef ASC_IDA_H
80  # error "Failed to include ASCEND IDA header file"  # error "Failed to include ASCEND IDA header file"
# Line 232  int integrator_ida_solve( Line 245  int integrator_ida_solve(
245      blsys->currentstep=0;      blsys->currentstep=0;
246      t_index=start_index+1;      t_index=start_index+1;
247      tout1 = samplelist_get(blsys->samples, t_index);      tout1 = samplelist_get(blsys->samples, t_index);
248    
249    #if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==3
250        flag = IDACalcIC(ida_mem, IDA_Y_INIT, tout1);
251    #else
252      flag = IDACalcIC(ida_mem, t0, y0, yp0, IDA_Y_INIT, tout1);      flag = IDACalcIC(ida_mem, t0, y0, yp0, IDA_Y_INIT, tout1);
253    #endif
254    
255      if(flag!=IDA_SUCCESS){      if(flag!=IDA_SUCCESS){
256          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Unable to solve initial values (IDACalcIC)");          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Unable to solve initial values (IDACalcIC)");
257          return 0;          return 0;

Legend:
Removed from v.912  
changed lines
  Added in v.913

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