+/* potential */
+#include "potentials/harmonic_oscillator.h"
+#include "potentials/lennard_jones.h"
+#include "potentials/albe.h"
+
+#ifdef TERSOFF_ORIG
+#include "potentials/tersoff_orig.h"
+#else
+#include "potentials/tersoff.h"
+#endif
+
+#define INJECT 1
+#define NR_ATOMS 4
+
+int hook(void *moldyn,void *hook_params) {
+
+ t_moldyn *md;
+ t_3dvec r,v,dist;
+ double d;
+ unsigned char run;
+ int i,j;
+ t_atom *atom;
+
+ md=moldyn;
+
+// vortrag
+set_temperature(moldyn,(4-md->schedule.count)*1000.0);
+set_pt_scale(md,0,0,T_SCALE_BERENDSEN,100.0);
+
+return 0;
+
+ printf("\nschedule hook: ");
+
+ if(!(md->schedule.count%2)) {
+ /* add carbon at random place, and enable t scaling */
+ for(j=0;j<NR_ATOMS;j++) {
+ run=1;
+ while(run) {
+ r.x=rand_get_double(&(md->random))*md->dim.x;
+ r.y=rand_get_double(&(md->random))*md->dim.y;
+ r.z=rand_get_double(&(md->random))*md->dim.z;
+ for(i=0;i<md->count;i++) {
+ atom=&(md->atom[i]);
+ v3_sub(&dist,&(atom->r),&r);
+ d=v3_absolute_square(&dist);
+ if(d>TM_R_C)
+ run=0;
+ }
+ }
+ v.x=0; v.y=0; v.z=0;
+ add_atom(md,C,M_C,1,
+ ATOM_ATTR_1BP|ATOM_ATTR_2BP|ATOM_ATTR_3BP|ATOM_ATTR_HB,
+ &r,&v);
+ }
+ printf("adding atoms & enable t scaling\n");
+ set_pt_scale(md,0,0,T_SCALE_BERENDSEN,100.0);
+ }
+ else {
+ /* disable t scaling */
+ printf("disabling t scaling\n");
+ set_pt_scale(md,0,0,0,0);
+ }
+
+ return 0;
+}
+