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(coul/streitz,PairCoulStreitz);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_PAIR_COUL_Streitz_H
21 #define LMP_PAIR_COUL_Streitz_H
22 
23 #include "pair.h"
24 
25 namespace LAMMPS_NS {
26 
27 class PairCoulStreitz : public Pair {
28  public:
29   PairCoulStreitz(class LAMMPS *);
30   virtual ~PairCoulStreitz();
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   double memory_usage();
37   virtual void *extract(const char *, int &);
38 
39   static constexpr int NPARAMS_PER_LINE = 6;
40 
41  protected:
42   struct Param {
43     double chi, eta, gamma, zeta, zcore;
44     int ielement;
45   };
46 
47   int nmax;
48   double precision;
49   Param *params;    // parameter sets for elements
50 
51   // Kspace parameters
52   int kspacetype;
53   double cut_coul, cut_coulsq;
54   double **scale;
55 
56   // Wolf
57   double g_wolf, woself, dwoself;
58 
59   // Ewald
60   double g_ewald;
61 
62   // QEq
63   double *qeq_x, *qeq_j, *qeq_g, *qeq_z, *qeq_c;
64 
65   void allocate();
66   virtual void read_file(char *);
67   void setup_params();
68   double self(Param *, double);
69   void coulomb_integral_wolf(double, double, double, double &, double &, double &, double &);
70   void wolf_sum(double, double, double, double, double, double, double, double, double &, double &);
71   void coulomb_integral_ewald(double, double, double, double &, double &, double &, double &);
72   void ewald_sum(double, double, double, double, double, double, double, double, double &, double &,
73                  double);
74 };
75 
76 }    // namespace LAMMPS_NS
77 
78 #endif
79 #endif
80 
81 /* ERROR/WARNING messages:
82 
83 E: Illegal ... command
84 
85 Self-explanatory.  Check the input script syntax and compare to the
86 documentation for the command.  You can use -echo screen as a
87 command-line option when running LAMMPS to see the offending line.
88 
89 E: Incorrect args for pair coefficients
90 
91 Self-explanatory.  Check the input script or data file.
92 
93 E: Pair style coul/streitz requires atom attribute q
94 
95 Self-explanatory.
96 
97 E: Pair style requires a KSpace style
98 
99 No kspace style is defined.
100 
101 E: All pair coeffs are not set
102 
103 All pair coefficients must be set in the data file or by the
104 pair_coeff command before running a simulation.
105 
106 E: Cannot open coul/streitz potential file %s
107 
108 The specified coul/streitz potential file cannot be opened.  Check
109 that the path and name are correct.
110 
111 E: Incorrect format in coul/streitz potential file
112 
113 Incorrect number of words per line in the potential file.
114 
115 E: Illegal coul/streitz parameter
116 
117 One or more of the coefficients defined in the potential file is
118 invalid.
119 
120 E: Potential file has duplicate entry
121 
122 The potential file has more than one entry for the same element.
123 
124 E: Potential file is missing an entry
125 
126 The potential file does not have a needed entry.
127 
128 */
129