24#include "neigh_list.h"
25#include "neigh_request.h"
44PairHDNNPDevelop::PairHDNNPDevelop(LAMMPS *lmp) :
PairHDNNP(lmp) {}
50 if(eflag || vflag) ev_setup(eflag,vflag);
51 else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
65 if(domain->nonperiodic == 0)
100 for (
int i = 0; i < atom->nlocal; ++i)
104 if (vflag_fdotr) virial_fdotr_compute();
115 if (comm->nprocs > 1) {
116 throw runtime_error(
"ERROR: Pair style \"nnp/develop\" can only be used "
117 "with a single MPI task.\n");
120 if(domain->dimension != 3)
121 throw runtime_error(
"ERROR: Only 3d systems can be used!");
123 if (!(domain->xperiodic == domain->yperiodic
124 && domain->yperiodic == domain->zperiodic))
125 throw runtime_error(
"ERROR: System must be either aperiodic or periodic "
126 "in all 3 dimmensions!");
129 if (atom->map_style == Atom::MAP_NONE)
130 throw runtime_error(
"ERROR: pair style requires atom map yes");
151 double rc2 = cutoffRadius * cutoffRadius;
154 #pragma omp parallel for
156 for (
int ii = 0; ii < list->inum; ++ii) {
157 int i = list->ilist[ii];
158 for (
int jj = 0; jj < list->numneigh[i]; ++jj) {
159 int j = list->firstneigh[i][jj];
161 double dx = atom->x[i][0] - atom->x[j][0];
162 double dy = atom->x[i][1] - atom->x[j][1];
163 double dz = atom->x[i][2] - atom->x[j][2];
164 double d2 = dx * dx + dy * dy + dz * dz;
184 utils::logmesg(lmp, fmt::format(
"WARNING: Cutoff too small, need at "
185 "least: {}\n", maxCutoffRadiusOverall));
double maxCutoffRadiusNeighborList
Keeps track of the maximum cutoff radius that was used for the neighbor list.
void updateNeighborlistCutoff()
Update neighborlist if maxCutoffRadiusNeighborList has changed.
void init_style() override
void compute(int, int) override
double init_one(int i, int j) override
void init_style() override
void handleExtrapolationWarnings()
void transferNeighborList()
nnp::InterfaceLammps * interface
void process()
Calculate symmetry functions, atomic neural networks and sum of local energy contributions.
void setLocalTags(int const *const atomTag)
Set atom tags (int version, -DLAMMPS_SMALLBIG).
void allocateNeighborlists(int const *const numneigh)
Allocate neighbor lists.
double getMaxCutoffRadiusOverall()
Get largest cutoff including structure specific cutoff and screening cutoff.
void setLocalAtomPositions(double const *const *const atomPos)
Set absolute atom positions from LAMMPS (nnp/develop only).
double getEnergy() const
Return sum of local energy contributions.
double getAtomicEnergy(int index) const
Return energy contribution of one atom.
void getForces(double *const *const &atomF) const
Calculate forces and add to LAMMPS atomic force arrays.
void setBoxVectors(double const *boxlo, double const *boxhi, double const xy, double const xz, double const yz)
Set box vectors of structure stored in LAMMPS (nnp/develop only).
bool getGlobalStructureStatus()
Check if n2p2 knows about global structure.
void setLocalAtoms(int numAtomsLocal, int const *const atomType)
(Re)set structure to contain only local LAMMPS atoms.
void getCharges(double *const &atomQ) const
Transfer charges (in units of e) to LAMMPS atomic charge vector.
void setGlobalStructureStatus(bool const status)
Specify whether n2p2 knows about global structure or only local structure.
void finalizeNeighborList()
Sorts neighbor list and creates cutoff map if necessary.
void addNeighbor(int i, int j, int64_t tag, int type, double dx, double dy, double dz, double d2)
Add one neighbor to atom (int64_t version, -DLAMMPS_BIGBIG).