Removed forgotten neighbor->ago condition in compute_born_matrix. Rewritten compute_pair loop so that newton condition does not affect results.

This commit is contained in:
Germain Clavier
2022-04-22 16:59:52 +02:00
parent 0b6a689f3c
commit a6f2f04664

View File

@ -349,12 +349,11 @@ void ComputeBornMatrix::compute_vector()
// compute Born contribution // compute Born contribution
if (neighbor->ago > 0) {
if (pairflag) compute_pairs(); if (pairflag) compute_pairs();
if (bondflag) compute_bonds(); if (bondflag) compute_bonds();
if (angleflag) compute_angles(); if (angleflag) compute_angles();
if (dihedflag) compute_dihedrals(); if (dihedflag) compute_dihedrals();
}
// sum Born contributions over all procs // sum Born contributions over all procs
@ -451,12 +450,11 @@ void ComputeBornMatrix::compute_pairs()
if (rsq >= cutsq[itype][jtype]) continue; if (rsq >= cutsq[itype][jtype]) continue;
if (newton_pair || j < nlocal) {
// Add contribution to Born tensor // Add contribution to Born tensor
pair_pref = dupair = du2pair = 0.0;
pair->born_matrix(i, j, itype, jtype, rsq, factor_coul, factor_lj, dupair, du2pair); pair->born_matrix(i, j, itype, jtype, rsq, factor_coul, factor_lj, dupair, du2pair);
pair_pref = du2pair - dupair * rinv; pair_pref = 0.5*du2pair - dupair * rinv;
// See albemunu in compute_born_matrix.h for indices order. // See albemunu in compute_born_matrix.h for indices order.
@ -471,7 +469,6 @@ void ComputeBornMatrix::compute_pairs()
} }
} }
} }
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
compute Born matrix using virial stress finite differences compute Born matrix using virial stress finite differences