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(ave/chunk,FixAveChunk);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_FIX_AVE_CHUNK_H
21 #define LMP_FIX_AVE_CHUNK_H
22 
23 #include "fix.h"
24 
25 namespace LAMMPS_NS {
26 
27 class FixAveChunk : public Fix {
28  public:
29   FixAveChunk(class LAMMPS *, int, char **);
30   ~FixAveChunk();
31   int setmask();
32   void init();
33   void setup(int);
34   void end_of_step();
35   double compute_array(int, int);
36   double memory_usage();
37 
38  private:
39   int nvalues;
40   int nrepeat, nfreq, irepeat;
41   int normflag, scaleflag, overwrite, biasflag, colextra;
42   bigint nvalid, nvalid_last;
43   double adof, cdof;
44   char *format, *format_user;
45   char *tstring, *sstring, *id_bias;
46   int *which, *argindex, *value2index;
47   char **ids;
48   class Compute *tbias;    // ptr to additional bias compute
49   FILE *fp;
50 
51   int densityflag;    // 1 if density/number or density/mass requested
52   int volflag;        // SCALAR/VECTOR for density normalization by volume
53   double chunk_volume_scalar;
54   double *chunk_volume_vec;
55 
56   int ave, nwindow;
57   int normcount, iwindow, window_limit;
58 
59   int nchunk, maxchunk;
60   char *idchunk;
61   class ComputeChunkAtom *cchunk;
62   int lockforever;
63 
64   long filepos;
65 
66   int maxvar;
67   double *varatom;
68 
69   // one,many,sum vecs/arrays are used with a single Nfreq epoch
70   // total,list vecs/arrays are used across epochs
71 
72   double *count_one, *count_many, *count_sum;
73   double **values_one, **values_many, **values_sum;
74   double *count_total, **count_list;
75   double **values_total, ***values_list;
76 
77   void allocate();
78   bigint nextvalid();
79 };
80 
81 }    // namespace LAMMPS_NS
82 
83 #endif
84 #endif
85 
86 /* ERROR/WARNING messages:
87 
88 E: Illegal ... command
89 
90 Self-explanatory.  Check the input script syntax and compare to the
91 documentation for the command.  You can use -echo screen as a
92 command-line option when running LAMMPS to see the offending line.
93 
94 E: No values in fix ave/chunk command
95 
96 Self-explanatory.
97 
98 E: Cannot open fix ave/chunk file %s
99 
100 The specified file cannot be opened.  Check that the path and name are
101 correct.
102 
103 E: Could not find compute ID for temperature bias
104 
105 Self-explanatory.
106 
107 E: Bias compute does not calculate temperature
108 
109 The specified compute must compute temperature.
110 
111 E: Bias compute does not calculate a velocity bias
112 
113 The specified compute must compute a bias for temperature.
114 
115 E: Compute ID for fix ave/chunk does not exist
116 
117 Self-explanatory.
118 
119 E: Fix ave/chunk compute does not calculate per-atom values
120 
121 Self-explanatory.
122 
123 E: Fix ave/chunk compute does not calculate a per-atom vector
124 
125 Self-explanatory.
126 
127 E: Fix ave/chunk compute does not calculate a per-atom array
128 
129 Self-explanatory.
130 
131 E: Fix ave/chunk compute vector is accessed out-of-range
132 
133 Self-explanatory.
134 
135 E: Fix ID for fix ave/chunk does not exist
136 
137 Self-explanatory.
138 
139 E: Fix ave/chunk fix does not calculate per-atom values
140 
141 Self-explanatory.
142 
143 E: Fix ave/chunk fix does not calculate a per-atom vector
144 
145 Self-explanatory.
146 
147 E: Fix ave/chunk fix does not calculate a per-atom array
148 
149 Self-explanatory.
150 
151 E: Fix ave/chunk fix vector is accessed out-of-range
152 
153 Self-explanatory.
154 
155 E: Variable name for fix ave/chunk does not exist
156 
157 Self-explanatory.
158 
159 E: Fix ave/chunk variable is not atom-style variable
160 
161 Self-explanatory.
162 
163 E: Chunk/atom compute does not exist for fix ave/chunk
164 
165 Self-explanatory.
166 
167 E: Fix ave/chunk does not use chunk/atom compute
168 
169 The specified compute is not for a compute chunk/atom command.
170 
171 E: Error writing file header
172 
173 Something in the output to the file triggered an error.
174 
175 E: Fix for fix ave/chunk not computed at compatible time
176 
177 Fixes generate their values on specific timesteps.  Fix ave/chunk is
178 requesting a value on a non-allowed timestep.
179 
180 E: Invalid timestep reset for fix ave/chunk
181 
182 Resetting the timestep has invalidated the sequence of timesteps this
183 fix needs to process.
184 
185 E: Error writing averaged chunk data
186 
187 Something in the output to the file triggered an error.
188 
189 */
190