1 /* ----------------------------------------------------------------------
2     This is the
3 
4     ██╗     ██╗ ██████╗  ██████╗  ██████╗ ██╗  ██╗████████╗███████╗
5     ██║     ██║██╔════╝ ██╔════╝ ██╔════╝ ██║  ██║╚══██╔══╝██╔════╝
6     ██║     ██║██║  ███╗██║  ███╗██║  ███╗███████║   ██║   ███████╗
7     ██║     ██║██║   ██║██║   ██║██║   ██║██╔══██║   ██║   ╚════██║
8     ███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║  ██║   ██║   ███████║
9     ╚══════╝╚═╝ ╚═════╝  ╚═════╝  ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝®
10 
11     DEM simulation engine, released by
12     DCS Computing Gmbh, Linz, Austria
13     http://www.dcs-computing.com, office@dcs-computing.com
14 
15     LIGGGHTS® is part of CFDEM®project:
16     http://www.liggghts.com | http://www.cfdem.com
17 
18     Core developer and main author:
19     Christoph Kloss, christoph.kloss@dcs-computing.com
20 
21     LIGGGHTS® is open-source, distributed under the terms of the GNU Public
22     License, version 2 or later. It is distributed in the hope that it will
23     be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
24     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have
25     received a copy of the GNU General Public License along with LIGGGHTS®.
26     If not, see http://www.gnu.org/licenses . See also top-level README
27     and LICENSE files.
28 
29     LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH,
30     the producer of the LIGGGHTS® software and the CFDEM®coupling software
31     See http://www.cfdem.com/terms-trademark-policy for details.
32 
33 -------------------------------------------------------------------------
34     Contributing author and copyright for this file:
35     This file is from LAMMPS
36     LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
37     http://lammps.sandia.gov, Sandia National Laboratories
38     Steve Plimpton, sjplimp@sandia.gov
39 
40     Copyright (2003) Sandia Corporation.  Under the terms of Contract
41     DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
42     certain rights in this software.  This software is distributed under
43     the GNU General Public License.
44 ------------------------------------------------------------------------- */
45 
46 #ifdef FIX_CLASS
47 
48 FixStyle(ave/time,FixAveTime)
49 
50 #else
51 
52 #ifndef LMP_FIX_AVE_TIME_H
53 #define LMP_FIX_AVE_TIME_H
54 
55 #include <stdio.h>
56 #include "fix.h"
57 
58 namespace LAMMPS_NS {
59 
60 class FixAveTime : public Fix {
61  public:
62   FixAveTime(class LAMMPS *, int, char **);
63   ~FixAveTime();
64   int setmask();
65   void init();
66   void setup(int);
67   void end_of_step();
68   double compute_scalar();
69   double compute_vector(int);
70   double compute_array(int,int);
71   void reset_timestep(bigint);
72 
73  private:
74   int me,nvalues;
75   int nrepeat,nfreq,irepeat;
76   bigint nvalid;
77   int *which,*argindex,*value2index,*offcol;
78   char **ids;
79   FILE *fp;
80   int nrows;
81 
82   int ave,nwindow,nsum,startstep,mode;
83   int noff,overwrite;
84   int *offlist;
85   char *title1,*title2,*title3;
86   long filepos;
87 
88   int norm,iwindow,window_limit;
89   double *vector;
90   double *vector_total;
91   double **vector_list;
92   double *column;
93   double **array;
94   double **array_total;
95   double ***array_list;
96 
97   void invoke_scalar(bigint);
98   void invoke_vector(bigint);
99   void options(int, char **);
100   void allocate_values(int);
101   bigint nextvalid();
102 };
103 
104 }
105 
106 #endif
107 #endif
108 
109 /* ERROR/WARNING messages:
110 
111 E: Illegal ... command
112 
113 Self-explanatory.  Check the input script syntax and compare to the
114 documentation for the command.  You can use -echo screen as a
115 command-line option when running LAMMPS to see the offending line.
116 
117 E: Compute ID for fix ave/time does not exist
118 
119 Self-explanatory.
120 
121 E: Fix ID for fix ave/time does not exist
122 
123 Self-explanatory.
124 
125 E: Invalid fix ave/time off column
126 
127 Self-explantory.
128 
129 E: Fix ave/time compute does not calculate a scalar
130 
131 Self-explantory.
132 
133 E: Fix ave/time compute does not calculate a vector
134 
135 Self-explantory.
136 
137 E: Fix ave/time compute vector is accessed out-of-range
138 
139 The index for the vector is out of bounds.
140 
141 E: Fix ave/time compute does not calculate an array
142 
143 Self-explanatory.
144 
145 E: Fix ave/time compute array is accessed out-of-range
146 
147 An index for the array is out of bounds.
148 
149 E: Fix ave/time fix does not calculate a scalar
150 
151 Self-explanatory.
152 
153 E: Fix ave/time fix does not calculate a vector
154 
155 Self-explanatory.
156 
157 E: Fix ave/time fix vector is accessed out-of-range
158 
159 The index for the vector is out of bounds.
160 
161 E: Fix for fix ave/time not computed at compatible time
162 
163 Fixes generate their values on specific timesteps.  Fix ave/time
164 is requesting a value on a non-allowed timestep.
165 
166 E: Fix ave/time fix does not calculate an array
167 
168 Self-explanatory.
169 
170 E: Fix ave/time fix array is accessed out-of-range
171 
172 An index for the array is out of bounds.
173 
174 E: Variable name for fix ave/time does not exist
175 
176 Self-explanatory.
177 
178 E: Fix ave/time variable is not equal-style variable
179 
180 Self-explanatory.
181 
182 E: Fix ave/time cannot use variable with vector mode
183 
184 Variables produce scalar values.
185 
186 E: Fix ave/time columns are inconsistent lengths
187 
188 Self-explanatory.
189 
190 E: Fix ave/time cannot set output array intensive/extensive from these inputs
191 
192 One of more of the vector inputs has individual elements which are
193 flagged as intensive or extensive.  Such an input cannot be flagged as
194 all intensive/extensive when turned into an array by fix ave/time.
195 
196 E: Cannot open fix ave/time file %s
197 
198 The specified file cannot be opened.  Check that the path and name are
199 correct.
200 
201 E: Fix ave/time missed timestep
202 
203 You cannot reset the timestep to a value beyond where the fix
204 expects to next perform averaging.
205 
206 */
207