1 /* -*- c++ -*- ----------------------------------------------------------
2    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3    https://www.lammps.org/, Sandia National Laboratories
4    Steve Plimpton, sjplimp@sandia.gov
5 
6    Copyright (2003) Sandia Corporation.  Under the terms of Contract
7    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
8    certain rights in this software.  This software is distributed under
9    the GNU General Public License.
10 
11    See the README file in the top-level LAMMPS directory.
12 ------------------------------------------------------------------------- */
13 
14 #ifdef PAIR_CLASS
15 // clang-format off
16 PairStyle(adp,PairADP);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_PAIR_ADP_H
21 #define LMP_PAIR_ADP_H
22 
23 #include "pair.h"
24 
25 namespace LAMMPS_NS {
26 
27 class PairADP : public Pair {
28  public:
29   PairADP(class LAMMPS *);
30   virtual ~PairADP();
31   virtual void compute(int, int);
32   void settings(int, char **);
33   void coeff(int, char **);
34   void init_style();
35   double init_one(int, int);
36 
37   int pack_forward_comm(int, int *, double *, int, int *);
38   void unpack_forward_comm(int, int, double *);
39   int pack_reverse_comm(int, int, double *);
40   void unpack_reverse_comm(int, int *, double *);
41   double memory_usage();
42 
43  protected:
44   int nmax;    // allocated size of per-atom arrays
45   double cutforcesq, cutmax;
46 
47   // per-atom arrays
48 
49   double *rho, *fp;
50   double **mu, **lambda;
51 
52   // potentials as array data
53 
54   int nrho, nr;
55   int nfrho, nrhor, nz2r;
56   int nu2r, nw2r;
57   double **frho, **rhor, **z2r;
58   double **u2r, **w2r;
59   int *type2frho, **type2rhor, **type2z2r;
60   int **type2u2r, **type2w2r;
61 
62   // potentials in spline form used for force computation
63 
64   double dr, rdr, drho, rdrho;
65   double ***rhor_spline, ***frho_spline, ***z2r_spline;
66   double ***u2r_spline, ***w2r_spline;
67 
68   // potentials as file data
69 
70   struct Setfl {
71     char **elements;
72     int nelements, nrho, nr;
73     double drho, dr, cut;
74     double *mass;
75     double **frho, **rhor, ***z2r;
76     double ***u2r, ***w2r;
77   };
78   Setfl *setfl;
79 
80   void allocate();
81   void array2spline();
82   void interpolate(int, double, double *, double **);
83 
84   void read_file(char *);
85   void file2array();
86 };
87 
88 }    // namespace LAMMPS_NS
89 
90 #endif
91 #endif
92 
93 /* ERROR/WARNING messages:
94 
95 E: Illegal ... command
96 
97 Self-explanatory.  Check the input script syntax and compare to the
98 documentation for the command.  You can use -echo screen as a
99 command-line option when running LAMMPS to see the offending line.
100 
101 E: Incorrect args for pair coefficients
102 
103 Self-explanatory.  Check the input script or data file.
104 
105 E: No matching element in ADP potential file
106 
107 The ADP potential file does not contain elements that match the
108 requested elements.
109 
110 E: Cannot open ADP potential file %s
111 
112 The specified ADP potential file cannot be opened.  Check that the
113 path and name are correct.
114 
115 E: Incorrect element names in ADP potential file
116 
117 The element names in the ADP file do not match those requested.
118 
119 */
120