new SNAP potential for W
This commit is contained in:
@ -14,10 +14,12 @@
|
||||
#include <math.h>
|
||||
#include "npair.h"
|
||||
#include "neighbor.h"
|
||||
#include "neigh_request.h"
|
||||
#include "nbin.h"
|
||||
#include "nstencil.h"
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -28,11 +30,28 @@ NPair::NPair(LAMMPS *lmp)
|
||||
: Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL)
|
||||
{
|
||||
last_build = -1;
|
||||
mycutneighsq = NULL;
|
||||
molecular = atom->molecular;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
NPair::~NPair()
|
||||
{
|
||||
memory->destroy(mycutneighsq);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void NPair::post_constructor(NeighRequest *nrq)
|
||||
{
|
||||
cutoff_custom = 0.0;
|
||||
if (nrq->cut) cutoff_custom = nrq->cutoff;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
copy needed info from Neighbor class to this build class
|
||||
done once per run
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void NPair::copy_neighbor_info()
|
||||
@ -71,6 +90,20 @@ void NPair::copy_neighbor_info()
|
||||
// special info
|
||||
|
||||
special_flag = neighbor->special_flag;
|
||||
|
||||
// overwrite per-type Neighbor cutoffs with custom value set by requestor
|
||||
// only works for style = BIN (checked by Neighbor class)
|
||||
|
||||
if (cutoff_custom > 0.0) {
|
||||
memory->destroy(mycutneighsq);
|
||||
int n = atom->ntypes;
|
||||
memory->create(mycutneighsq,n+1,n+1,"npair:cutneighsq");
|
||||
int i,j;
|
||||
for (i = 1; i <= n; i++)
|
||||
for (j = 1; j <= n; j++)
|
||||
mycutneighsq[i][j] = cutoff_custom * cutoff_custom;
|
||||
cutneighsq = mycutneighsq;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user