foo
[physik/posic.git] / moldyn.c
index 8b80242..c7243e0 100644 (file)
--- a/moldyn.c
+++ b/moldyn.c
@@ -547,6 +547,18 @@ int link_cell_shutdown(t_moldyn *moldyn) {
        return 0;
 }
 
+int moldyn_add_schedule(t_moldyn *moldyn,) {
+
+
+       return 0;
+}
+
+int moldyn_set_schedule_hook(t_moldyn *moldyn,void *hook,void *hook_params) {
+
+       
+       return 0;
+}
+
 /*
  *
  * 'integration of newtons equation' - algorithms
@@ -587,10 +599,13 @@ int moldyn_integrate(t_moldyn *moldyn) {
        moldyn->potential_force_function(moldyn);
 
        for(sched=0;sched<moldyn->schedule.content_count;sched++) {
-               moldyn->tau=;
-               moldyn->tau_square=;
 
-       // hier weiter ...
+               /* setting amont of runs and finite time step size */
+               moldyn->tau=schedule->tau[sched];
+               moldyn->tau_square=moldyn->tau*moldyn->tau;
+               moldyn->timesteps=schedule->runs[sched];
+
+       /* integration according to schedule */
 
        for(i=0;i<moldyn->time_steps;i++) {
 
@@ -636,6 +651,10 @@ int moldyn_integrate(t_moldyn *moldyn) {
                }
        }
 
+               /* check for hooks */
+               if(schedule->hook)
+                       schedule->hook(moldyn,schedule->hook_params);
+
        return 0;
 }