projects
/
physik
/
posic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52485a2
)
fixed tersoff virial calc
author
hackbard
<hackbard@sage.physik.uni-augsburg.de>
Wed, 28 May 2008 12:51:35 +0000
(14:51 +0200)
committer
hackbard
<hackbard@sage.physik.uni-augsburg.de>
Wed, 28 May 2008 12:51:35 +0000
(14:51 +0200)
potentials/tersoff.c
patch
|
blob
|
history
diff --git
a/potentials/tersoff.c
b/potentials/tersoff.c
index
3a0ed18
..
5039ff7
100644
(file)
--- a/
potentials/tersoff.c
+++ b/
potentials/tersoff.c
@@
-485,7
+485,8
@@
int tersoff_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
scale=-0.5*(f_c*(df_r+b*df_a)+df_c*(f_r+b*df_a));
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*df_a));
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
+ v3_scale(&force,&force,-1.0); // dri rij = - drj rij
+ v3_add(&(aj->f),&(aj->f),&force);
#ifdef DEBUG
if((ai==&(moldyn->atom[0]))|(aj==&(moldyn->atom[0]))) {
#ifdef DEBUG
if((ai==&(moldyn->atom[0]))|(aj==&(moldyn->atom[0]))) {
@@
-501,6
+502,9
@@
int tersoff_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
}
#endif
}
#endif
+ /* virial */
+ virial_calc(aj,&force,&(exchange->dist_ij));
+
/* dzeta prefactor = - 0.5 f_c f_a db */
exchange->pre_dzeta=-0.5*f_a*f_c*db;
/* dzeta prefactor = - 0.5 f_c f_a db */
exchange->pre_dzeta=-0.5*f_a*f_c*db;