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

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

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

revision 1253 by johnpye, Sat Jan 27 05:04:49 2007 UTC revision 1254 by johnpye, Sat Jan 27 10:50:40 2007 UTC
# Line 95  Line 95 
95  /* #define FEX_DEBUG */  /* #define FEX_DEBUG */
96  #define JEX_DEBUG  #define JEX_DEBUG
97  /* #define DJEX_DEBUG */  /* #define DJEX_DEBUG */
98  #define SOLVE_DEBUG  /* #define SOLVE_DEBUG */
99  #define STATS_DEBUG  #define STATS_DEBUG
100  #define PREC_DEBUG  #define PREC_DEBUG
101  /* #define DIFFINDEX_DEBUG */  /* #define DIFFINDEX_DEBUG */
# Line 745  int integrator_ida_solve( Line 745  int integrator_ida_solve(
745          }          }
746          if (setjmp(g_fpe_env)==0) {          if (setjmp(g_fpe_env)==0) {
747  #endif  #endif
   
             //CONSOLE_DEBUG("Raising signal...");  
             //CONSOLE_DEBUG("1/0 = %f", div1(1.0,0.0));  
             //CONSOLE_DEBUG("Still here...");  
748                    
             /* correct initial values, given derivatives */  
749  # if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==3  # if SUNDIALS_VERSION_MAJOR==2 && SUNDIALS_VERSION_MINOR==3
750              /* note the new API from version 2.3 and onwards */          flag = IDACalcIC(ida_mem, icopt, tout1);/* new API from v2.3  */
             flag = IDACalcIC(ida_mem, icopt, tout1);  
751  # else  # else
752              flag = IDACalcIC(ida_mem, t0, y0, yp0, icopt, tout1);          flag = IDACalcIC(ida_mem, t0, y0, yp0, icopt, tout1);
753  # endif  # endif
754            /* check flags and output status */
755              switch(flag){          switch(flag){
756                  case IDA_SUCCESS:              case IDA_SUCCESS:
757                      CONSOLE_DEBUG("Initial conditions solved OK");                  CONSOLE_DEBUG("Initial conditions solved OK");
758                      break;                  break;
759    
760                  case IDA_LSETUP_FAIL:              case IDA_LSETUP_FAIL:
761                  case IDA_LINIT_FAIL:              case IDA_LINIT_FAIL:
762                  case IDA_LSOLVE_FAIL:              case IDA_LSOLVE_FAIL:
763                  case IDA_NO_RECOVERY:              case IDA_NO_RECOVERY:
764                      flag1 = -999;                  flag1 = -999;
765                      flag = (flagfn)(ida_mem,&flag1);                  flag = (flagfn)(ida_mem,&flag1);
766                      if(flag){                  if(flag){
767                          ERROR_REPORTER_HERE(ASC_PROG_ERR,"Unable to retrieve error code from %s (err %d)",flagfntype,flag);                      ERROR_REPORTER_HERE(ASC_PROG_ERR
768                          return 12;                          ,"Unable to retrieve error code from %s (err %d)"
769                      }                          ,flagfntype,flag
770                      ERROR_REPORTER_HERE(ASC_PROG_ERR,"%s returned flag '%s' (value = %d)",flagfntype,(flagnamefn)(flag1),flag1);                      );
                     return 12;  
   
                 default:  
                     ERROR_REPORTER_HERE(ASC_PROG_ERR,"Failed to solve initial condition (IDACalcIC)");  
771                      return 12;                      return 12;
772              }                  }
773                    ERROR_REPORTER_HERE(ASC_PROG_ERR
774                        ,"%s returned flag '%s' (value = %d)"
775                        ,flagfntype,(flagnamefn)(flag1),flag1
776                    );
777                    return 12;
778    
779                default:
780                    ERROR_REPORTER_HERE(ASC_PROG_ERR,"Failed to solve initial condition (IDACalcIC)");
781                    return 12;
782            }
783  #ifdef ASC_SIGNAL_TRAPS  #ifdef ASC_SIGNAL_TRAPS
784          }else{          }else{
785              ERROR_REPORTER_HERE(ASC_PROG_ERR,"Floating point error while solving initial conditions");              ERROR_REPORTER_HERE(ASC_PROG_ERR,"Floating point error while solving initial conditions");
# Line 794  int integrator_ida_solve( Line 794  int integrator_ida_solve(
794              CONSOLE_DEBUG("...pop");              CONSOLE_DEBUG("...pop");
795          }          }
796  #endif  #endif
797        }/* icopt */
     }  
798    
799      /* optionally, specify ROO-FINDING PROBLEM */      /* optionally, specify ROO-FINDING PROBLEM */
800    

Legend:
Removed from v.1253  
changed lines
  Added in v.1254

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