/[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 1278 by johnpye, Sun Feb 4 02:00:01 2007 UTC revision 1279 by johnpye, Sat Feb 10 09:31:55 2007 UTC
# Line 99  Line 99 
99  #define STATS_DEBUG  #define STATS_DEBUG
100  #define PREC_DEBUG  #define PREC_DEBUG
101  /* #define DIFFINDEX_DEBUG */  /* #define DIFFINDEX_DEBUG */
102  #define ANALYSE_DEBUG  /* #define ANALYSE_DEBUG */
103  /**  /**
104      Everthing that the outside world needs to know about IDA      Everthing that the outside world needs to know about IDA
105  */  */
# Line 287  IntegratorIdaData *integrator_ida_engine Line 287  IntegratorIdaData *integrator_ida_engine
287  enum ida_parameters{  enum ida_parameters{
288      IDA_PARAM_LINSOLVER      IDA_PARAM_LINSOLVER
289      ,IDA_PARAM_MAXL      ,IDA_PARAM_MAXL
290        ,IDA_PARAM_MAXORD
291      ,IDA_PARAM_AUTODIFF      ,IDA_PARAM_AUTODIFF
292      ,IDA_PARAM_CALCIC      ,IDA_PARAM_CALCIC
293      ,IDA_PARAM_SAFEEVAL      ,IDA_PARAM_SAFEEVAL
# Line 404  int integrator_ida_params_default(Integr Line 405  int integrator_ida_params_default(Integr
405          }, 0, 0, 20 }          }, 0, 0, 20 }
406      );      );
407    
408        slv_param_int(p,IDA_PARAM_MAXORD
409                ,(SlvParameterInitInt){{"maxord"
410                ,"Maximum order of linear multistep method",0
411                ,"The maximum order of the linear multistep method with IDA. See"
412                " IDA manual p 38."
413            }, 5, 1, 5 }
414        );
415    
416      slv_param_bool(p,IDA_PARAM_GSMODIFIED      slv_param_bool(p,IDA_PARAM_GSMODIFIED
417              ,(SlvParameterInitBool){{"gsmodified"              ,(SlvParameterInitBool){{"gsmodified"
418              ,"Gram-Schmidt Orthogonalisation Scheme", 2              ,"Gram-Schmidt Orthogonalisation Scheme", 2
# Line 488  int integrator_ida_solve( Line 497  int integrator_ida_solve(
497          return 1; /* failure */          return 1; /* failure */
498      }      }
499    
500    #ifdef SOLVE_DEBUG
501      integrator_ida_debug(blsys,stderr);      integrator_ida_debug(blsys,stderr);
502    #endif
503    
504      /* retrieve initial values from the system */      /* retrieve initial values from the system */
505    
# Line 562  int integrator_ida_solve( Line 572  int integrator_ida_solve(
572      CONSOLE_DEBUG("MAXNCF = %d",SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXNCF));      CONSOLE_DEBUG("MAXNCF = %d",SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXNCF));
573      IDASetMaxConvFails(ida_mem,SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXNCF));      IDASetMaxConvFails(ida_mem,SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXNCF));
574    
575        CONSOLE_DEBUG("MAXORD = %d",SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXORD));
576        IDASetMaxOrd(ida_mem,SLV_PARAM_INT(&blsys->params,IDA_PARAM_MAXORD));
577    
578      /* there's no capability for setting *minimum* step size in IDA */      /* there's no capability for setting *minimum* step size in IDA */
579    
580    
# Line 709  int integrator_ida_solve( Line 722  int integrator_ida_solve(
722          for(i=0; i < blsys->n_y; ++i){          for(i=0; i < blsys->n_y; ++i){
723              if(blsys->ydot[i] == NULL){              if(blsys->ydot[i] == NULL){
724                  NV_Ith_S(id,i) = 0.0;                  NV_Ith_S(id,i) = 0.0;
725    #ifdef SOLVE_DEBUG
726                  varname = var_make_name(blsys->system,blsys->y[i]);                  varname = var_make_name(blsys->system,blsys->y[i]);
727                  CONSOLE_DEBUG("y[%d] = '%s' is pure algebraic",i,varname);                  CONSOLE_DEBUG("y[%d] = '%s' is pure algebraic",i,varname);
728                  ASC_FREE(varname);                  ASC_FREE(varname);
729    #endif
730              }else{              }else{
731    #ifdef SOLVE_DEBUG
732                  CONSOLE_DEBUG("y[%d] is differential",i);                  CONSOLE_DEBUG("y[%d] is differential",i);
733    #endif
734                  NV_Ith_S(id,i) = 1.0;                  NV_Ith_S(id,i) = 1.0;
735              }              }
736          }          }

Legend:
Removed from v.1278  
changed lines
  Added in v.1279

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