Add single2 method to Pair that can compute and return the Hessian matrix

This commit is contained in:
Andrew Schultz
2018-11-08 12:03:24 -05:00
parent 5196fa37e0
commit 3367a408b2
4 changed files with 49 additions and 7 deletions

View File

@ -301,7 +301,7 @@ void Pair::init_style()
specific pair style can override this function
------------------------------------------------------------------------- */
void Pair::init_list(int /*which*/, NeighList *ptr)
void Pair::init_list(int which, NeighList *ptr)
{
list = ptr;
}
@ -1740,6 +1740,18 @@ void Pair::init_bitmap(double inner, double outer, int ntablebits,
/* ---------------------------------------------------------------------- */
void Pair::pairTensor(double fforce, double dfac, double delr[3], double phiTensor[6]) {
int m = 0;
for (int k=0; k<3; k++) {
phiTensor[m] = fforce;
for (int l=k; l<3; l++) {
if (l>k) phiTensor[m] = 0;
phiTensor[m++] += delr[k]*delr[l] * dfac;
}
}
}
/* ---------------------------------------------------------------------- */
double Pair::memory_usage()
{
double bytes = comm->nthreads*maxeatom * sizeof(double);