/[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 984 by johnpye, Wed Dec 20 23:23:50 2006 UTC revision 985 by johnpye, Thu Dec 21 04:06:02 2006 UTC
# Line 294  int integrator_ida_params_default(Integr Line 294  int integrator_ida_params_default(Integr
294    MAIN IDA SOLVER ROUTINE, see IDA manual, sec 5.4, p. 27 ff.    MAIN IDA SOLVER ROUTINE, see IDA manual, sec 5.4, p. 27 ff.
295  */  */
296    
297    typedef int IdaFlagFn(void *,int *);
298    typedef const char *IdaFlagNameFn(int);
299    
300  /* return 1 on success */  /* return 1 on success */
301  int integrator_ida_solve(  int integrator_ida_solve(
302          IntegratorSystem *blsys          IntegratorSystem *blsys
# Line 307  int integrator_ida_solve( Line 310  int integrator_ida_solve(
310      IntegratorIdaData *enginedata;      IntegratorIdaData *enginedata;
311      char *linsolver;      char *linsolver;
312      int maxl;      int maxl;
313        IdaFlagFn *flagfn;
314        IdaFlagNameFn *flagnamefn;
315    
316      CONSOLE_DEBUG("STARTING IDA...");      CONSOLE_DEBUG("STARTING IDA...");
317    
# Line 420  int integrator_ida_solve( Line 425  int integrator_ida_solve(
425          }else{          }else{
426              CONSOLE_DEBUG("USING NUMERICAL DIFF");              CONSOLE_DEBUG("USING NUMERICAL DIFF");
427          }          }
428    
429            flagfn = &IDADenseGetLastFlag;
430            flagnamefn = &IDADenseGetReturnFlagName;
431    
432      }else{      }else{
433          /* remaining methods are all SPILS */          /* remaining methods are all SPILS */
434          CONSOLE_DEBUG("IDA SPILS");          CONSOLE_DEBUG("IDA SPILS");
# Line 441  int integrator_ida_solve( Line 450  int integrator_ida_solve(
450              return 0;              return 0;
451          }          }
452    
453            flagfn = &IDASpilsGetLastFlag;
454            flagnamefn = &IDASpilsGetReturnFlagName;
455    
456          if(flag==IDASPILS_MEM_NULL){          if(flag==IDASPILS_MEM_NULL){
457              ERROR_REPORTER_HERE(ASC_PROG_ERR,"ida_mem is NULL");              ERROR_REPORTER_HERE(ASC_PROG_ERR,"ida_mem is NULL");
458              return 0;              return 0;
# Line 507  int integrator_ida_solve( Line 519  int integrator_ida_solve(
519      # endif      # endif
520    
521          if(flag!=IDA_SUCCESS){          if(flag!=IDA_SUCCESS){
522              ERROR_REPORTER_HERE(ASC_PROG_ERR,"Unable to solve initial values (IDACalcIC)");              (flagfn)(ida_mem,&flag);
523                ERROR_REPORTER_HERE(ASC_PROG_ERR,"Unable to solve initial values (IDACalcIC: %s)",(flagnamefn)(flag));
524              return 0;              return 0;
525          }/* else success */          }/* else success */
526    

Legend:
Removed from v.984  
changed lines
  Added in v.985

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