136 |
|
|
137 |
/*------------------------------------*/ |
/*------------------------------------*/ |
138 |
/** |
/** |
139 |
Initial value problem description struct. Anyone making a copy of |
Initial Value Problem description struct. Anyone making a copy of |
140 |
the y, ydot, or obs pointers who plans to free that pointer later |
the y, ydot, or obs pointers who plans to free that pointer later |
141 |
should increment the reference count for that pointer so if blsys |
should increment the reference count for that pointer so if blsys |
142 |
is destroyed later we don't end up double freeing it. Note this |
is destroyed later we don't end up double freeing it. Note this |
150 |
struct Instance *instance; /**< not sure if this one is really necessary... -- JP */ |
struct Instance *instance; /**< not sure if this one is really necessary... -- JP */ |
151 |
slv_system_t system; /**< the system that we're integrating in ASCEND */ |
slv_system_t system; /**< the system that we're integrating in ASCEND */ |
152 |
IntegratorEngine engine; /**< enum containing the ID of the integrator engine we're using */ |
IntegratorEngine engine; /**< enum containing the ID of the integrator engine we're using */ |
153 |
IntegratorReporter *reporter;/**< functions for reporting integration results */ |
IntegratorReporter *reporter;/**< functions for reporting integration results */ |
154 |
SampleList *samples; /**< pointer to the list of samples. we *don't own* this **/ |
SampleList *samples; /**< pointer to the list of samples. we *don't own* this **/ |
155 |
void *enginedata; /**< space where the integrator engine can store stuff */ |
void *enginedata; /**< space where the integrator engine can store stuff */ |
156 |
void *clientdata; /**< any stuff that the GUI/CLI needs to associate with this */ |
void *clientdata; /**< any stuff that the GUI/CLI needs to associate with this */ |
157 |
|
|
158 |
|
slv_parameters_t params; /**< structure containing parameters applicable to this Integrator */ |
159 |
|
|
160 |
int nstates; /**< was a local global in integrator.c, moved it here. */ |
int nstates; /**< was a local global in integrator.c, moved it here. */ |
161 |
int nderivs; /**< ditto, as for nstates */ |
int nderivs; /**< ditto, as for nstates */ |
162 |
|
|
177 |
long n_y; |
long n_y; |
178 |
long n_obs; |
long n_obs; |
179 |
long currentstep; /**< current step number (also @see integrator_getnsamples) */ |
long currentstep; /**< current step number (also @see integrator_getnsamples) */ |
180 |
|
|
181 |
int ycount; /**< number of external references to y */ |
int ycount; /**< number of external references to y */ |
182 |
int ydotcount; /**< number of external references to ydot */ |
int ydotcount; /**< number of external references to ydot */ |
183 |
int obscount; /**< number of external references to obs */ |
int obscount; /**< number of external references to obs */ |
184 |
|
|
185 |
|
/** @TODO move the following to the 'params' structure? Or maybe better not to? */ |
186 |
int maxsubsteps; /**< most steps between mesh poins */ |
int maxsubsteps; /**< most steps between mesh poins */ |
187 |
double stepzero; /**< initial step length, SI units. */ |
double stepzero; /**< initial step length, SI units. */ |
188 |
double minstep; /**< shortest step length, SI units. */ |
double minstep; /**< shortest step length, SI units. */ |
213 |
*/ |
*/ |
214 |
|
|
215 |
ASC_DLLSPEC(int) integrator_set_engine(IntegratorSystem *blsys, IntegratorEngine engine); |
ASC_DLLSPEC(int) integrator_set_engine(IntegratorSystem *blsys, IntegratorEngine engine); |
216 |
/** |
/**< |
217 |
Sets the engine for this integrator. Checks that the integrator can be used |
Sets the engine for this integrator. Checks that the integrator can be used |
218 |
on the given system. |
on the given system. |
219 |
|
|
223 |
*/ |
*/ |
224 |
|
|
225 |
ASC_DLLSPEC(IntegratorEngine) integrator_get_engine(const IntegratorSystem *blsys); |
ASC_DLLSPEC(IntegratorEngine) integrator_get_engine(const IntegratorSystem *blsys); |
226 |
/** |
/**< |
227 |
Returns the engine (ID) selected for use in this IntegratorSystem (may return |
Returns the engine (ID) selected for use in this IntegratorSystem (may return |
228 |
INTEG_UNKNOWN if none or invalid setting). |
INTEG_UNKNOWN if none or invalid setting). |
229 |
*/ |
*/ |
230 |
|
|
231 |
|
typedef int IntegratorParamsDefaultFn(IntegratorSystem *blsys); |
232 |
|
/**< |
233 |
|
Integrators must provide a function like this that can be used to retrieve |
234 |
|
the default set of parameters. |
235 |
|
*/ |
236 |
|
|
237 |
|
ASC_DLLSPEC(int) integrator_params_get(const IntegratorSystem *blsys, slv_parameters_t *parameters); |
238 |
|
/**< |
239 |
|
Copies the current set of Integrator parameters into the indicated parameter set, 'parameters'. |
240 |
|
|
241 |
|
@TODO test these, not sure if the memory copy stuff is right or not. |
242 |
|
|
243 |
|
@return 0 on success |
244 |
|
*/ |
245 |
|
|
246 |
|
ASC_DLLSPEC(int) integrator_params_set(IntegratorSystem *blsys, const slv_parameters_t *parameters); |
247 |
|
/**< |
248 |
|
Copies the the given parameter set into the Integrator's data structure, |
249 |
|
which immediately makes the new values available to the integrator engine. |
250 |
|
|
251 |
|
@TODO test these, not sure if the memory copy stuff is right or not. |
252 |
|
|
253 |
|
@return 0 on success |
254 |
|
*/ |
255 |
|
|
256 |
ASC_DLLSPEC(int) integrator_set_reporter(IntegratorSystem *blsys |
ASC_DLLSPEC(int) integrator_set_reporter(IntegratorSystem *blsys |
257 |
, IntegratorReporter *r); |
, IntegratorReporter *r); |
258 |
/**< |
/**< |