Loading...
Searching...
No Matches
test.cpp
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#include <stdio.h>
13
15
16int main() {
17 EAM pot;
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");
35 pot.cleanMemory();
36 return 0;
37}
EAM (Embedded Atom Method) potential with cell list neighbor finding.
Definition EAM.h:27
void cleanMemory()
Definition EAM.cpp:24
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *fullbox) override
Definition EAM.cpp:28
int main()
Definition test.cpp:16