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

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

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

revision 943 by johnpye, Sat Nov 25 05:26:47 2006 UTC revision 944 by johnpye, Sat Nov 25 10:46:13 2006 UTC
# Line 30  Line 30 
30  #include "lsode.h"  #include "lsode.h"
31  #include "ida.h"  #include "ida.h"
32  #include "slv_common.h"  #include "slv_common.h"
33    #include "slv_client.h"
34  #include <utilities/ascPanic.h>  #include <utilities/ascPanic.h>
35    
36  #include "samplelist.h"  #include "samplelist.h"
# Line 59  Line 60 
60   * These should be supported directly in a future solveratominst.   * These should be supported directly in a future solveratominst.
61   */   */
62    
63  static symchar *g_symbols[4];  static symchar *g_symbols[3];
64    
65  #define STATEFLAG g_symbols[0]  #define STATEFLAG g_symbols[0]
66  /*  /*
# Line 80  static symchar *g_symbols[4]; Line 81  static symchar *g_symbols[4];
81   * the blsode output file. Tis someone else's job to grok this output.   * the blsode output file. Tis someone else's job to grok this output.
82   */   */
83    
 #define FIXEDSYMBOL g_symbols[3]  
84    
85  /** Temporary catcher of dynamic variable and observation variable data */  /** Temporary catcher of dynamic variable and observation variable data */
86  struct Integ_var_t {  struct Integ_var_t {
# Line 194  static void IntegInitSymbols(void){ Line 194  static void IntegInitSymbols(void){
194    STATEFLAG = AddSymbol("ode_type");    STATEFLAG = AddSymbol("ode_type");
195    STATEINDEX = AddSymbol("ode_id");    STATEINDEX = AddSymbol("ode_id");
196    OBSINDEX = AddSymbol("obs_id");    OBSINDEX = AddSymbol("obs_id");
   FIXEDSYMBOL = AddSymbol("fixed");  
197  }  }
198    
199  /*------------------------------------------------------------------------------  /*------------------------------------------------------------------------------
# Line 1239  void integrator_set_ydot(IntegratorSyste Line 1238  void integrator_set_ydot(IntegratorSyste
1238      }      }
1239  }  }
1240    
1241    /**
1242        Retrieve the values of 'ode_atol' properties of each of y-variables,
1243        for use in setting absolute error tolerances for the Integrator.
1244    
1245        If the pointer 'atol' is NULL, the necessary space is allocated (and
1246        must be freed somewhere else).
1247    */
1248    double *integrator_get_atol(IntegratorSystem *sys, double *atol){
1249        long i;
1250        char *varname;
1251    
1252        if (atol==NULL) {
1253            atol = ASC_NEW_ARRAY_CLEAR(double, sys->n_y);
1254        }
1255    
1256        for (i=0; i< sys->n_y; i++) {
1257            assert(sys->y[i]!=NULL);
1258            atol[i] = var_odeatol(sys->y[i]);
1259            assert(atol[i]!=-1);
1260            varname = var_make_name(sys->system,sys->y[i]);
1261            CONSOLE_DEBUG("%s.ode_atol = %8.2e",varname,atol[i]);
1262            ASC_FREE(varname);
1263        }
1264        return atol;
1265    }
1266    
1267  /*-------------------------------------------------------------  /*-------------------------------------------------------------
1268    RETRIEVING OBSERVATION DATA    RETRIEVING OBSERVATION DATA
1269  */  */

Legend:
Removed from v.943  
changed lines
  Added in v.944

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