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 DUMP_CLASS
15 // clang-format off
16 DumpStyle(image,DumpImage);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_DUMP_IMAGE_H
21 #define LMP_DUMP_IMAGE_H
22 
23 #include "dump_custom.h"
24 
25 namespace LAMMPS_NS {
26 
27 class DumpImage : public DumpCustom {
28  public:
29   int multifile_override;    // used by write_dump command
30 
31   DumpImage(class LAMMPS *, int, char **);
32   virtual ~DumpImage();
33   int pack_forward_comm(int, int *, double *, int, int *);
34   void unpack_forward_comm(int, int, double *);
35 
36  protected:
37   int filetype;
38   enum { PPM, JPG, PNG };
39 
40   int atomflag;         // 0/1 for draw atoms
41   int acolor, adiam;    // what determines color/diam of atoms
42   double adiamvalue;    // atom diameter value
43 
44   int lineflag;                   // 0/1 for draw atoms as lines
45   int lcolor, ldiam;              // what determines color/diam of lines
46   double ldiamvalue;              // line diameter value
47   int triflag;                    // 0/1 for draw atoms as triangles
48   int tcolor, tstyle;             // what determines color/style of tris
49   double tdiamvalue;              // tri edge diameter value
50   int bodyflag;                   // 0/1 for draw atoms as bodies
51   int bodycolor;                  // what determines color of bodies
52   double bodyflag1, bodyflag2;    // user-specified params for drawing bodies
53   int fixflag;                    // 0/1 to draw what fix provides
54   int fixcolor;                   // what determines color of fix objects
55   double fixflag1, fixflag2;      // user-specified params for fix objects
56 
57   int bondflag;         // 0/1 for draw bonds
58   int bcolor, bdiam;    // what determines color/diam of bonds
59   double bdiamvalue;    // bond diameter value
60 
61   int extraflag;                        // 0/1 for any of line/tri/body flag set
62   char *thetastr, *phistr;              // variables for view theta,phi
63   int thetavar, phivar;                 // index to theta,phi vars
64   int cflag;                            // static/dynamic box center
65   double cx, cy, cz;                    // fractional box center
66   char *cxstr, *cystr, *czstr;          // variables for box center
67   int cxvar, cyvar, czvar;              // index to box center vars
68   char *upxstr, *upystr, *upzstr;       // view up vector variables
69   int upxvar, upyvar, upzvar;           // index to up vector vars
70   char *zoomstr;                        // view zoom variable name
71   int zoomvar;                          // index to zoom variable
72   int boxflag, axesflag;                // 0/1 for draw box and axes
73   double boxdiam, axeslen, axesdiam;    // params for drawing box and axes
74   int subboxflag;
75   double subboxdiam;
76 
77   int viewflag;    // overall view is static or dynamic
78 
79   double *diamtype, *diamelement, *bdiamtype;          // per-type diameters
80   double **colortype, **colorelement, **bcolortype;    // per-type colors
81 
82   class AtomVecLine *avec_line;    // ptrs to atom style (sub)classes
83   class AtomVecTri *avec_tri;
84   class AtomVecBody *avec_body;
85 
86   class Fix *fixptr;    // ptr to Fix that provides image data
87 
88   class Image *image;    // class that renders each image
89 
90   int *chooseghost;    // extended choose array for comm
91   double **bufcopy;    // buffer for communicating bond/atom info
92   int maxbufcopy;
93 
94   virtual void init_style();
95   int modify_param(int, char **);
96   void write();
97 
98   void box_center();
99   void view_params();
100   void box_bounds();
101 
102   void create_image();
103 };
104 
105 }    // namespace LAMMPS_NS
106 
107 #endif
108 #endif
109 
110 /* ERROR/WARNING messages:
111 
112 E: Invalid dump image filename
113 
114 The file produced by dump image cannot be binary and must
115 be for a single processor.
116 
117 E: Support for writing images in JPEG format not included
118 
119 LAMMPS was not built with the -DLAMMPS_JPEG switch in the Makefile.
120 
121 E: Support for writing images in PNG format not included
122 
123 LAMMPS was not built with the -DLAMMPS_PNG switch in the Makefile.
124 
125 E: Illegal ... command
126 
127 Self-explanatory.  Check the input script syntax and compare to the
128 documentation for the command.  You can use -echo screen as a
129 command-line option when running LAMMPS to see the offending line.
130 
131 E: Dump image bond not allowed with no bond types
132 
133 Self-explanatory.
134 
135 E: Invalid dump image theta value
136 
137 Theta must be between 0.0 and 180.0 inclusive.
138 
139 E: Dump image line requires atom style line
140 
141 Self-explanatory.
142 
143 E: Dump image tri requires atom style tri
144 
145 Self-explanatory.
146 
147 E: Dump image body yes requires atom style body
148 
149 Self-explanatory.
150 
151 E: Fix ID for dump image does not exist
152 
153 UNDOCUMENTED
154 
155 E: Dump image requires one snapshot per file
156 
157 Use a "*" in the filename.
158 
159 E: Dump image cannot perform sorting
160 
161 Self-explanatory.
162 
163 E: Variable name for dump image theta does not exist
164 
165 Self-explanatory.
166 
167 E: Variable for dump image theta is invalid style
168 
169 Must be an equal-style variable.
170 
171 E: Variable name for dump image phi does not exist
172 
173 Self-explanatory.
174 
175 E: Variable for dump image phi is invalid style
176 
177 Must be an equal-style variable.
178 
179 E: Variable name for dump image center does not exist
180 
181 Self-explanatory.
182 
183 E: Variable for dump image center is invalid style
184 
185 Must be an equal-style variable.
186 
187 E: Variable name for dump image zoom does not exist
188 
189 Self-explanatory.
190 
191 E: Variable for dump image zoom is invalid style
192 
193 Must be an equal-style variable.
194 
195 E: Invalid dump image element name
196 
197 The specified element name was not in the standard list of elements.
198 See the dump_modify doc page.
199 
200 E: Invalid color map min/max values
201 
202 The min/max values are not consistent with either each other or
203 with values in the color map.
204 
205 E: Invalid dump image zoom value
206 
207 Zoom value must be > 0.0.
208 
209 E: Invalid color in dump_modify command
210 
211 The specified color name was not in the list of recognized colors.
212 See the dump_modify doc page.
213 
214 E: Dump modify bcolor not allowed with no bond types
215 
216 Self-explanatory.
217 
218 E: Dump modify bdiam not allowed with no bond types
219 
220 Self-explanatory.
221 
222 */
223