/[ascend]/branches/ksenija2/ascend/integrator/integrator.c
ViewVC logotype

Diff of /branches/ksenija2/ascend/integrator/integrator.c

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

revision 2856 by jpye, Thu Mar 19 07:34:22 2015 UTC revision 2857 by jpye, Sat Mar 21 13:13:27 2015 UTC
# Line 44  Line 44 
44  #include "samplelist.h"  #include "samplelist.h"
45    
46  #define ANALYSE_DEBUG  #define ANALYSE_DEBUG
47    /* #define REGISTER_DEBUG */
48  /* #define SOLVE_DEBUG */  /* #define SOLVE_DEBUG */
49  /* #define CLASSIFY_DEBUG */  /* #define CLASSIFY_DEBUG */
50  /* #define DESTROY_DEBUG */  /* #define DESTROY_DEBUG */
# Line 222  static struct gl_list_t *integrator_get_ Line 223  static struct gl_list_t *integrator_get_
223      int i, error;      int i, error;
224      /* standard integrators that we will register */      /* standard integrators that we will register */
225      static char *defaultintegrators[] = {      static char *defaultintegrators[] = {
226          "lsode"          "lsode",
227          ,"ida"          "ida",
228          ,NULL          NULL
229      };      };
230    
231      if(free_space){      if(free_space){
# Line 248  static struct gl_list_t *integrator_get_ Line 249  static struct gl_list_t *integrator_get_
249                      ,"Unable to register integrator '%s' (error %d)."                      ,"Unable to register integrator '%s' (error %d)."
250                      ,defaultintegrators[i],error                      ,defaultintegrators[i],error
251                  );                  );
252    #ifdef REGISTER_DEBUG
253              }else{              }else{
254                  CONSOLE_DEBUG("Integrator '%s' registered OK",defaultintegrators[i]);                  CONSOLE_DEBUG("Integrator '%s' registered OK",defaultintegrators[i]);
255    #endif
256              }              }
257          }          }
258      }      }
# Line 287  int integrator_set_engine(IntegratorSyst Line 290  int integrator_set_engine(IntegratorSyst
290      if(Ifound){      if(Ifound){
291          /** @TODO tests for applicability of this engine... */          /** @TODO tests for applicability of this engine... */
292    
293    #ifdef REGISTER_DEBUG
294          CONSOLE_DEBUG("Setting engine...");          CONSOLE_DEBUG("Setting engine...");
295    #endif
296          if(Ifound->engine == sys->engine){          if(Ifound->engine == sys->engine){
297              // already set...              // already set...
298              return 0;              return 0;
# Line 374  int integrator_register(const Integrator Line 379  int integrator_register(const Integrator
379      struct gl_list_t *L;      struct gl_list_t *L;
380      L = integrator_get_engines_growable();      L = integrator_get_engines_growable();
381    
382    #ifdef REGISTER_DEBUG
383      CONSOLE_DEBUG("REGISTERING INTEGRATOR");      CONSOLE_DEBUG("REGISTERING INTEGRATOR");
384      CONSOLE_DEBUG("There were %lu registered integrators", gl_length(integrator_get_list(0)));      CONSOLE_DEBUG("There were %lu registered integrators", gl_length(integrator_get_list(0)));
385    #endif
386    
387      int i;      int i;
388      IntegratorInternals *I;      IntegratorInternals *I;
# Line 391  int integrator_register(const Integrator Line 398  int integrator_register(const Integrator
398          }          }
399      }      }
400    
401    #ifdef REGISTER_DEBUG
402      CONSOLE_DEBUG("Adding engine '%s'",integ->name);      CONSOLE_DEBUG("Adding engine '%s'",integ->name);
403    #endif
404    
405      gl_append_ptr(L,(void *)integ);      gl_append_ptr(L,(void *)integ);
406    
407    #ifdef REGISTER_DEBUG
408      CONSOLE_DEBUG("There are now %lu registered integrators", gl_length(integrator_get_list(0)));      CONSOLE_DEBUG("There are now %lu registered integrators", gl_length(integrator_get_list(0)));
409    #endif
410      return 0;      return 0;
411  }  }
412    

Legend:
Removed from v.2856  
changed lines
  Added in v.2857

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