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 FIX_CLASS
15 // clang-format off
16 FixStyle(efield,FixEfield);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_FIX_EFIELD_H
21 #define LMP_FIX_EFIELD_H
22 
23 #include "fix.h"
24 
25 namespace LAMMPS_NS {
26 
27 class FixEfield : public Fix {
28  public:
29   FixEfield(class LAMMPS *, int, char **);
30   ~FixEfield();
31   int setmask();
32   void init();
33   void setup(int);
34   void min_setup(int);
35   void post_force(int);
36   void post_force_respa(int, int, int);
37   void min_post_force(int);
38   double memory_usage();
39   double compute_scalar();
40   double compute_vector(int);
41 
42  private:
43   double ex, ey, ez;
44   int varflag, iregion;
45   char *xstr, *ystr, *zstr, *estr;
46   char *idregion;
47   int xvar, yvar, zvar, evar, xstyle, ystyle, zstyle, estyle;
48   int ilevel_respa;
49   double qe2f;
50   int qflag, muflag;
51 
52   int maxatom;
53   double **efield;
54 
55   int force_flag;
56   double fsum[4], fsum_all[4];
57 };
58 
59 }    // namespace LAMMPS_NS
60 
61 #endif
62 #endif
63 
64 /* ERROR/WARNING messages:
65 
66 E: Illegal ... command
67 
68 Self-explanatory.  Check the input script syntax and compare to the
69 documentation for the command.  You can use -echo screen as a
70 command-line option when running LAMMPS to see the offending line.
71 
72 E: Region ID for fix efield does not exist
73 
74 Self-explanatory.
75 
76 E: Fix efield requires atom attribute q or mu
77 
78 The atom style defined does not have this attribute.
79 
80 E: Variable name for fix efield does not exist
81 
82 Self-explanatory.
83 
84 E: Variable for fix efield is invalid style
85 
86 The variable must be an equal- or atom-style variable.
87 
88 E: Region ID for fix aveforce does not exist
89 
90 Self-explanatory.
91 
92 E: Fix efield with dipoles cannot use atom-style variables
93 
94 This option is not supported.
95 
96 W: The minimizer does not re-orient dipoles when using fix efield
97 
98 This means that only the atom coordinates will be minimized,
99 not the orientation of the dipoles.
100 
101 E: Cannot use variable energy with constant efield in fix efield
102 
103 LAMMPS computes the energy itself when the E-field is constant.
104 
105 E: Must use variable energy with fix efield
106 
107 You must define an energy when performing a minimization with a
108 variable E-field.
109 
110 */
111