add suport for centroid virial to hybrid angle/dihedral/improper styles

This commit is contained in:
Donatas Surblys
2019-10-11 18:10:06 +09:00
parent 3e49aab521
commit e47090d931
3 changed files with 27 additions and 0 deletions

View File

@ -129,6 +129,14 @@ void ImproperHybrid::compute(int eflag, int vflag)
for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][j];
}
if (cvflag_atom) {
n = atom->nlocal;
if (force->newton_bond) n += atom->nghost;
double **cvatom_substyle = styles[m]->cvatom;
for (i = 0; i < n; i++)
for (j = 0; j < 9; j++)
cvatom[i][j] += cvatom_substyle[i][j];
}
}
// restore ptrs to original improperlist
@ -344,6 +352,7 @@ double ImproperHybrid::memory_usage()
{
double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double);
bytes += maxcvatom*9 * sizeof(double);
for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int);
for (int m = 0; m < nstyles; m++)
if (styles[m]) bytes += styles[m]->memory_usage();