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 |
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 |
|
|
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"); |
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; |
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 |
|
|