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

@ -128,6 +128,14 @@ void AngleHybrid::compute(int eflag, int vflag)
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][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 anglelist // restore ptrs to original anglelist
@ -370,6 +378,7 @@ double AngleHybrid::memory_usage()
{ {
double bytes = maxeatom * sizeof(double); double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double); bytes += maxvatom*6 * sizeof(double);
bytes += maxcvatom*9 * sizeof(double);
for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int); for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int);
for (int m = 0; m < nstyles; m++) for (int m = 0; m < nstyles; m++)
if (styles[m]) bytes += styles[m]->memory_usage(); if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -130,6 +130,14 @@ void DihedralHybrid::compute(int eflag, int vflag)
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][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 dihedrallist // restore ptrs to original dihedrallist
@ -348,6 +356,7 @@ double DihedralHybrid::memory_usage()
{ {
double bytes = maxeatom * sizeof(double); double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * sizeof(double); bytes += maxvatom*6 * sizeof(double);
bytes += maxcvatom*9 * sizeof(double);
for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int); for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int);
for (int m = 0; m < nstyles; m++) for (int m = 0; m < nstyles; m++)
if (styles[m]) bytes += styles[m]->memory_usage(); if (styles[m]) bytes += styles[m]->memory_usage();

View File

@ -129,6 +129,14 @@ void ImproperHybrid::compute(int eflag, int vflag)
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
vatom[i][j] += vatom_substyle[i][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 // restore ptrs to original improperlist
@ -344,6 +352,7 @@ double ImproperHybrid::memory_usage()
{ {
double bytes = maxeatom * sizeof(double); double bytes = maxeatom * sizeof(double);
bytes += maxvatom*6 * 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++) bytes += maximproper[m]*5 * sizeof(int);
for (int m = 0; m < nstyles; m++) for (int m = 0; m < nstyles; m++)
if (styles[m]) bytes += styles[m]->memory_usage(); if (styles[m]) bytes += styles[m]->memory_usage();