From: W. Trevor King Date: Tue, 22 Jul 2008 17:04:21 +0000 (+0000) Subject: Fixed some other tension model bugs in tension_model_handler. X-Git-Tag: v0.5~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ef9f41ce8b244bc8c34e4e1cffb77814a860f3b;p=sawsim.git Fixed some other tension model bugs in tension_model_handler. git-svn-id: svn://abax.physics.drexel.edu/sawsim/trunk@13 865a22a6-13cc-4084-8aa6-876098d8aa20 --- diff --git a/sawsim.nw b/sawsim.nw index 17db3d8..4746ded 100644 --- a/sawsim.nw +++ b/sawsim.nw @@ -3629,7 +3629,7 @@ int main(int argc, char **argv) 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); } @@ -3638,7 +3638,7 @@ int main(int argc, char **argv) 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); } @@ -3646,7 +3646,7 @@ int main(int argc, char **argv) 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; } @@ -3746,7 +3746,6 @@ void get_options(int argc, char **argv, environment_t *env, 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;