Add single2 method to Pair that can compute and return the Hessian matrix
This commit is contained in:
14
src/pair.cpp
14
src/pair.cpp
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user