int num_param_args; /* for INIT_MODEL() */
char **param_args; /* for INIT_MODEL() */
get_options(argc, argv, &env, NUM_TENSION_MODELS, tension_models, &model, &flags);
- setup(tension_handler);
+ setup();
if (flags & VFLAG) {
printf("#initializing model %s with parameters %s\n", model->name, model->params);
}
push(&tdata.group, params, 1);
tdata.env = &env;
tdata.persist = NULL;
- if (tension_handler[model->tg_group] == NULL) {
+ if (model->handler == NULL) {
printf("No tension function for model %s\n", model->name);
exit(0);
}
double dx=1e-10, x=0, F=0;
printf("#F (N)\tk (%% pop. per s)\n");
while (F >= 0 && F < 1e5 && x < 1e-6) {
- F = (*tension_handler[model->tg_group])(x, &tdata);
+ F = (*model->handler)(x, &tdata);
printf("%g\t%g\n", x, F);
x += dx;
}
case 'T': env->T = atof(optarg); break;
case 'C': env->T = atof(optarg)+273.15; break;
case 'm':
- parse_list_string(optarg, ',', NULL, NULL, &num_strings, string_array);
tension_model = index_tension_model(n_tension_models, tension_models, optarg);
*model = tension_models+tension_model;
break;