]> hackdaworld.org Git - physik/posic.git/commitdiff
added MATTONI force field (left parameters by now)
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Thu, 30 Oct 2008 12:32:51 +0000 (13:32 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Thu, 30 Oct 2008 12:32:51 +0000 (13:32 +0100)
potentials/albe_fast.c

index 0db5f66ea3c1596a3115dc62bbf862947e9d18b0..9fc362ed140c7b48126b91d43d1467d719d3a192 100644 (file)
@@ -452,7 +452,11 @@ int albe_potential_force_calc(t_moldyn *moldyn) {
        }
 
        /* force contribution for atom i */
+#ifdef MATTONI
+       scale=-0.5*(f_c*(df_r-b*df_a)); // - in albe formalism
+#else
        scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_a)); // - in albe formalism
+#endif
        v3_scale(&force,&(dist_ij),scale);
        v3_add(&(ai->f),&(ai->f),&force);
 
@@ -604,10 +608,15 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
        v3_add(&(ai->f),&(ai->f),&force);
 
        /* derivative wrt k */
+#ifdef MATTONI
+       v3_scale(&tmp,&dcosdrk,fcdg);
+       v3_scale(&force,&tmp,pre_dzeta);
+#else
        v3_scale(&force,&dist_ik,-1.0*dfcg); // dri rik = - drk rik
        v3_scale(&tmp,&dcosdrk,fcdg);
        v3_add(&force,&force,&tmp);
        v3_scale(&force,&force,pre_dzeta);
+#endif
 
        /* force contribution */
        v3_add(&(ktom->f),&(ktom->f),&force);
@@ -1083,7 +1092,11 @@ void *potential_force_thread(void *ptr) {
        }
 
        /* force contribution for atom i */
+#ifdef MATTONI
+       scale=-0.5*(f_c*(df_r-b*df_a)); // - in albe formalism
+#else
        scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_a)); // - in albe formalism
+#endif
        v3_scale(&force,&(dist_ij),scale);
        pthread_mutex_lock(&(amutex[ai->tag])); 
        v3_add(&(ai->f),&(ai->f),&force);
@@ -1249,10 +1262,15 @@ if(moldyn->time>DSTART&&moldyn->time<DEND) {
        pthread_mutex_unlock(&(amutex[ai->tag]));       
 
        /* derivative wrt k */
+#ifdef MATTONI
+       v3_scale(&tmp,&dcosdrk,fcdg);
+       v3_scale(&force,&tmp,pre_dzeta);
+#else
        v3_scale(&force,&dist_ik,-1.0*dfcg); // dri rik = - drk rik
        v3_scale(&tmp,&dcosdrk,fcdg);
        v3_add(&force,&force,&tmp);
        v3_scale(&force,&force,pre_dzeta);
+#endif
 
        /* force contribution */
        pthread_mutex_lock(&(amutex[ktom->tag]));