projects
/
physik
/
posic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented basic p ctrl stuff + video with 13 fps
[physik/posic.git]
/
potentials
/
albe.c
diff --git
a/potentials/albe.c
b/potentials/albe.c
index
677d6e3
..
d157bae
100644
(file)
--- a/
potentials/albe.c
+++ b/
potentials/albe.c
@@
-275,11
+275,17
@@
int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
db=-0.5*b/(1.0+exchange->zeta_ij);
}
db=-0.5*b/(1.0+exchange->zeta_ij);
}
- /* force contribution */
+ /* force contribution
for atom i
*/
scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_a)); // - in albe formalism
v3_scale(&force,&(exchange->dist_ij),scale);
v3_add(&(ai->f),&(ai->f),&force);
scale=-0.5*(f_c*(df_r-b*df_a)+df_c*(f_r-b*f_a)); // - in albe formalism
v3_scale(&force,&(exchange->dist_ij),scale);
v3_add(&(ai->f),&(ai->f),&force);
- v3_sub(&(aj->f),&(aj->f),&force); // dri rij = - drj rij
+
+ /* force contribution for atom j */
+ v3_scale(&force,&force,-1.0); // dri rij = - drj rij
+ v3_add(&(aj->f),&(aj->f),&force);
+
+ /* virial */
+ virial_calc(aj,&force,&(exchange->dist_ij));
#ifdef DEBUG
if(moldyn->time>DSTART&&moldyn->time<DEND) {
#ifdef DEBUG
if(moldyn->time>DSTART&&moldyn->time<DEND) {
@@
-297,9
+303,6
@@
if(moldyn->time>DSTART&&moldyn->time<DEND) {
}
#endif
}
#endif
- /* virial */
- virial_calc(ai,&force,&(exchange->dist_ij));
-
/* dzeta prefactor = - f_c f_a db, (* -0.5 due to force calc) */
exchange->pre_dzeta=0.5*f_a*f_c*db;
/* dzeta prefactor = - f_c f_a db, (* -0.5 due to force calc) */
exchange->pre_dzeta=0.5*f_a*f_c*db;