16 {
18 pot.initialize();
19
20 long N = 2;
21 const double R[] = {0.0, 0.0, 0.0, 5.0, 5.0, 5.0};
22 const long atomicNrs[] = {13, 13};
23 double *F = new double[3 * N];
24 double U = 0;
25 const double box[] = {10.0, 10.0, 10.0};
26 pot.
force(N, R, atomicNrs, F, &U, box);
27 printf("Energy: %10.4g\n", U);
28 printf("Forces: ");
29 for (int i = 0; i < 3 * N; i++) {
30 if (i % 3 == 0)
31 printf("\n");
32 printf("%10.4g ", F[i]);
33 }
34 printf("\n");
36 return 0;
37}
EAM (Embedded Atom Method) potential with cell list neighbor finding.
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *fullbox) override