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(store/state,FixStoreState);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_FIX_STORE_STATE_H
21 #define LMP_FIX_STORE_STATE_H
22 
23 #include "fix.h"
24 
25 namespace LAMMPS_NS {
26 
27 class FixStoreState : public Fix {
28  public:
29   FixStoreState(class LAMMPS *, int, char **);
30   ~FixStoreState();
31   int setmask();
32   void init();
33   void setup(int);
34   void end_of_step();
35 
36   double memory_usage();
37   void grow_arrays(int);
38   void copy_arrays(int, int, int);
39   int pack_exchange(int, double *);
40   int unpack_exchange(int, double *);
41   int pack_restart(int, double *);
42   void unpack_restart(int, int);
43   int size_restart(int);
44   int maxsize_restart();
45 
46  private:
47   int nvalues;
48   int *which, *argindex, *value2index;
49   char **ids;
50   double **values;    // archived atom properties
51   double *vbuf;       // 1d ptr to values
52 
53   int comflag;
54   double cm[3];    // center of mass
55 
56   int kflag, cfv_flag, firstflag;
57   int cfv_any;    // 1 if any compute/fix/variable specified
58 
59   typedef void (FixStoreState::*FnPtrPack)(int);
60   FnPtrPack *pack_choice;    // ptrs to pack functions
61 
62   void pack_id(int);
63   void pack_molecule(int);
64   void pack_type(int);
65   void pack_mass(int);
66 
67   void pack_x(int);
68   void pack_y(int);
69   void pack_z(int);
70   void pack_xs(int);
71   void pack_ys(int);
72   void pack_zs(int);
73   void pack_xs_triclinic(int);
74   void pack_ys_triclinic(int);
75   void pack_zs_triclinic(int);
76   void pack_xu(int);
77   void pack_yu(int);
78   void pack_zu(int);
79   void pack_xu_triclinic(int);
80   void pack_yu_triclinic(int);
81   void pack_zu_triclinic(int);
82   void pack_xsu(int);
83   void pack_ysu(int);
84   void pack_zsu(int);
85   void pack_xsu_triclinic(int);
86   void pack_ysu_triclinic(int);
87   void pack_zsu_triclinic(int);
88 
89   void pack_ix(int);
90   void pack_iy(int);
91   void pack_iz(int);
92 
93   void pack_vx(int);
94   void pack_vy(int);
95   void pack_vz(int);
96   void pack_fx(int);
97   void pack_fy(int);
98   void pack_fz(int);
99   void pack_q(int);
100   void pack_mux(int);
101   void pack_muy(int);
102   void pack_muz(int);
103   void pack_mu(int);
104   void pack_radius(int);
105   void pack_diameter(int);
106   void pack_omegax(int);
107   void pack_omegay(int);
108   void pack_omegaz(int);
109   void pack_angmomx(int);
110   void pack_angmomy(int);
111   void pack_angmomz(int);
112   void pack_tqx(int);
113   void pack_tqy(int);
114   void pack_tqz(int);
115 };
116 
117 }    // namespace LAMMPS_NS
118 
119 #endif
120 #endif
121 
122 /* ERROR/WARNING messages:
123 
124 E: Illegal ... command
125 
126 Self-explanatory.  Check the input script syntax and compare to the
127 documentation for the command.  You can use -echo screen as a
128 command-line option when running LAMMPS to see the offending line.
129 
130 E: Fix store/state for atom property that isn't allocated
131 
132 Self-explanatory.
133 
134 E: Compute ID for fix store/state does not exist
135 
136 Self-explanatory.
137 
138 E: Fix store/state compute does not calculate per-atom values
139 
140 Computes that calculate global or local quantities cannot be used
141 with fix store/state.
142 
143 E: Fix store/state compute does not calculate a per-atom vector
144 
145 The compute calculates a per-atom vector.
146 
147 E: Fix store/state compute does not calculate a per-atom array
148 
149 The compute calculates a per-atom vector.
150 
151 E: Fix store/state compute array is accessed out-of-range
152 
153 Self-explanatory.
154 
155 E: Custom integer vector for fix store/state does not exist
156 
157 The command is accessing a vector added by the fix property/atom
158 command, that does not exist.
159 
160 E: Custom floating point vector for fix store/state does not exist
161 
162 The command is accessing a vector added by the fix property/atom
163 command, that does not exist.
164 
165 E: Fix ID for fix store/state does not exist
166 
167 Self-explanatory
168 
169 E: Fix store/state fix does not calculate per-atom values
170 
171 Fixes that calculate global or local quantities cannot be used with
172 fix store/state.
173 
174 E: Fix store/state fix does not calculate a per-atom vector
175 
176 The fix calculates a per-atom array.
177 
178 E: Fix store/state fix does not calculate a per-atom array
179 
180 The fix calculates a per-atom vector.
181 
182 E: Fix store/state fix array is accessed out-of-range
183 
184 Self-explanatory.
185 
186 E: Fix for fix store/state not computed at compatible time
187 
188 Fixes generate their values on specific timesteps.  Fix store/state
189 is requesting a value on a non-allowed timestep.
190 
191 E: Variable name for fix store/state does not exist
192 
193 Self-explanatory.
194 
195 E: Fix store/state variable is not atom-style variable
196 
197 Only atom-style variables calculate per-atom quantities.
198 
199 */
200