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(atom,DumpAtom);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_DUMP_ATOM_H
21 #define LMP_DUMP_ATOM_H
22 
23 #include "dump.h"
24 
25 namespace LAMMPS_NS {
26 
27 class DumpAtom : public Dump {
28  public:
29   DumpAtom(LAMMPS *, int, char **);
30 
31   const char *MAGIC_STRING = "DUMPATOM";
32   const int FORMAT_REVISION = 0x0002;
33   const int ENDIAN = 0x0001;
34 
35  protected:
36   int scale_flag;    // 1 if atom coords are scaled, 0 if no
37   int image_flag;    // 1 if append box count to atom coords, 0 if no
38 
39   char *columns;    // column labels
40 
41   void init_style();
42   int modify_param(int, char **);
43   void write_header(bigint);
44   void pack(tagint *);
45   int convert_string(int, double *);
46   void write_data(int, double *);
47 
48   void header_format_binary();
49   void header_unit_style_binary();
50   void header_time_binary();
51   void header_columns_binary();
52   void format_magic_string_binary();
53   void format_endian_binary();
54   void format_revision_binary();
55 
56   typedef void (DumpAtom::*FnPtrHeader)(bigint);
57   FnPtrHeader header_choice;    // ptr to write header functions
58   void header_binary(bigint);
59   void header_binary_triclinic(bigint);
60   void header_item(bigint);
61   void header_item_triclinic(bigint);
62 
63   typedef void (DumpAtom::*FnPtrPack)(tagint *);
64   FnPtrPack pack_choice;    // ptr to pack functions
65   void pack_scale_image(tagint *);
66   void pack_scale_noimage(tagint *);
67   void pack_noscale_image(tagint *);
68   void pack_noscale_noimage(tagint *);
69   void pack_scale_image_triclinic(tagint *);
70   void pack_scale_noimage_triclinic(tagint *);
71 
72   typedef int (DumpAtom::*FnPtrConvert)(int, double *);
73   FnPtrConvert convert_choice;    // ptr to convert data functions
74   int convert_image(int, double *);
75   int convert_noimage(int, double *);
76 
77   typedef void (DumpAtom::*FnPtrWrite)(int, double *);
78   FnPtrWrite write_choice;    // ptr to write data functions
79   void write_binary(int, double *);
80   void write_string(int, double *);
81   void write_lines_image(int, double *);
82   void write_lines_noimage(int, double *);
83 };
84 
85 }    // namespace LAMMPS_NS
86 
87 #endif
88 #endif
89 
90 /* ERROR/WARNING messages:
91 
92 E: Illegal ... command
93 
94 Self-explanatory.  Check the input script syntax and compare to the
95 documentation for the command.  You can use -echo screen as a
96 command-line option when running LAMMPS to see the offending line.
97 
98 */
99