2014-07-30 22:59:20 +08:00
|
|
|
/* -*- c++ -*- ----------------------------------------------------------
|
2006-09-28 03:51:33 +08:00
|
|
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
2007-01-30 08:22:05 +08:00
|
|
|
http://lammps.sandia.gov, Sandia National Laboratories
|
|
|
|
Steve Plimpton, sjplimp@sandia.gov
|
2006-09-28 03:51:33 +08:00
|
|
|
|
|
|
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
|
|
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
2012-06-07 06:47:51 +08:00
|
|
|
certain rights in this software. This software is distributed under
|
2006-09-28 03:51:33 +08:00
|
|
|
the GNU General Public License.
|
|
|
|
|
|
|
|
See the README file in the top-level LAMMPS directory.
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
2010-01-12 09:37:48 +08:00
|
|
|
#ifdef DUMP_CLASS
|
|
|
|
|
|
|
|
DumpStyle(custom,DumpCustom)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#ifndef LMP_DUMP_CUSTOM_H
|
|
|
|
#define LMP_DUMP_CUSTOM_H
|
2006-09-28 03:51:33 +08:00
|
|
|
|
|
|
|
#include "dump.h"
|
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
namespace LAMMPS_NS {
|
|
|
|
|
2006-09-28 03:51:33 +08:00
|
|
|
class DumpCustom : public Dump {
|
|
|
|
public:
|
2007-01-30 08:22:05 +08:00
|
|
|
DumpCustom(class LAMMPS *, int, char **);
|
2009-09-03 00:24:00 +08:00
|
|
|
virtual ~DumpCustom();
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2009-09-03 00:24:00 +08:00
|
|
|
protected:
|
2013-06-13 23:24:28 +08:00
|
|
|
int nevery; // dump frequency for output
|
2006-09-28 03:51:33 +08:00
|
|
|
int iregion; // -1 if no region, else which region
|
2010-08-19 23:16:31 +08:00
|
|
|
char *idregion; // region ID
|
2006-09-28 03:51:33 +08:00
|
|
|
int nthresh; // # of defined threshholds
|
|
|
|
int *thresh_array; // array to threshhhold on for each nthresh
|
|
|
|
int *thresh_op; // threshhold operation for each nthresh
|
|
|
|
double *thresh_value; // threshhold value for each nthresh
|
|
|
|
|
|
|
|
int *vtype; // type of each vector (INT, DOUBLE)
|
|
|
|
char **vformat; // format string for each vector element
|
|
|
|
|
2009-03-17 06:34:07 +08:00
|
|
|
char *columns; // column labels
|
|
|
|
|
2011-06-01 00:34:45 +08:00
|
|
|
int nchoose; // # of selected atoms
|
2007-12-14 02:16:04 +08:00
|
|
|
int maxlocal; // size of atom selection and variable arrays
|
2011-06-01 00:34:45 +08:00
|
|
|
int *choose; // local indices of selected atoms
|
2006-09-28 03:51:33 +08:00
|
|
|
double *dchoose; // value for each atom to threshhold against
|
2011-06-09 02:16:56 +08:00
|
|
|
int *clist; // compressed list of indices of selected atoms
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
int nfield; // # of keywords listed by user
|
2011-06-01 00:34:45 +08:00
|
|
|
int ioptional; // index of start of optional args
|
2007-10-04 00:22:30 +08:00
|
|
|
|
2007-12-14 02:16:04 +08:00
|
|
|
int *field2index; // which compute,fix,variable calcs this field
|
|
|
|
int *argindex; // index into compute,fix scalar_atom,vector_atom
|
|
|
|
// 0 for scalar_atom, 1-N for vector_atom values
|
|
|
|
|
2007-10-04 00:22:30 +08:00
|
|
|
int ncompute; // # of Compute objects used by dump
|
2007-01-30 08:22:05 +08:00
|
|
|
char **id_compute; // their IDs
|
|
|
|
class Compute **compute; // list of ptrs to the Compute objects
|
2006-11-11 05:29:18 +08:00
|
|
|
|
2007-10-04 00:22:30 +08:00
|
|
|
int nfix; // # of Fix objects used by dump
|
|
|
|
char **id_fix; // their IDs
|
|
|
|
class Fix **fix; // list of ptrs to the Fix objects
|
2007-12-14 02:16:04 +08:00
|
|
|
|
|
|
|
int nvariable; // # of Variables used by dump
|
|
|
|
char **id_variable; // their names
|
|
|
|
int *variable; // list of indices for the Variables
|
|
|
|
double **vbuf; // local storage for variable evaluation
|
2006-11-11 05:29:18 +08:00
|
|
|
|
2014-07-30 22:59:20 +08:00
|
|
|
int ncustom; // # of custom atom properties
|
|
|
|
char **id_custom; // their names
|
|
|
|
int *flag_custom; // their data type
|
|
|
|
|
2011-05-30 23:46:44 +08:00
|
|
|
int ntypes; // # of atom types
|
2012-06-07 06:47:51 +08:00
|
|
|
char **typenames; // array of element names for each type
|
2011-05-30 23:46:44 +08:00
|
|
|
|
2006-11-11 05:29:18 +08:00
|
|
|
// private methods
|
|
|
|
|
2010-09-16 06:16:20 +08:00
|
|
|
virtual void init_style();
|
2011-01-08 05:42:19 +08:00
|
|
|
virtual void write_header(bigint);
|
2006-09-28 03:51:33 +08:00
|
|
|
int count();
|
2014-01-18 02:43:09 +08:00
|
|
|
void pack(tagint *);
|
2013-11-26 00:29:18 +08:00
|
|
|
virtual int convert_string(int, double *);
|
2009-09-03 00:24:00 +08:00
|
|
|
virtual void write_data(int, double *);
|
2011-03-17 04:03:49 +08:00
|
|
|
bigint memory_usage();
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2011-06-01 00:34:45 +08:00
|
|
|
int parse_fields(int, char **);
|
2007-10-04 00:22:30 +08:00
|
|
|
int add_compute(char *);
|
|
|
|
int add_fix(char *);
|
2007-12-14 02:16:04 +08:00
|
|
|
int add_variable(char *);
|
2014-07-30 22:59:20 +08:00
|
|
|
int add_custom(char *, int);
|
2011-06-01 00:34:45 +08:00
|
|
|
virtual int modify_param(int, char **);
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2011-01-08 05:42:19 +08:00
|
|
|
typedef void (DumpCustom::*FnPtrHeader)(bigint);
|
2006-09-28 03:51:33 +08:00
|
|
|
FnPtrHeader header_choice; // ptr to write header functions
|
2011-01-08 05:42:19 +08:00
|
|
|
void header_binary(bigint);
|
|
|
|
void header_binary_triclinic(bigint);
|
|
|
|
void header_item(bigint);
|
|
|
|
void header_item_triclinic(bigint);
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2013-11-22 04:47:55 +08:00
|
|
|
typedef int (DumpCustom::*FnPtrConvert)(int, double *);
|
|
|
|
FnPtrConvert convert_choice; // ptr to convert data functions
|
|
|
|
int convert_image(int, double *);
|
|
|
|
int convert_noimage(int, double *);
|
|
|
|
|
|
|
|
typedef void (DumpCustom::*FnPtrWrite)(int, double *);
|
|
|
|
FnPtrWrite write_choice; // ptr to write data functions
|
2006-11-11 05:29:18 +08:00
|
|
|
void write_binary(int, double *);
|
2013-11-22 04:47:55 +08:00
|
|
|
void write_string(int, double *);
|
|
|
|
void write_lines(int, double *);
|
2006-11-11 05:29:18 +08:00
|
|
|
|
2006-09-28 03:51:33 +08:00
|
|
|
// customize by adding a method prototype
|
|
|
|
|
|
|
|
typedef void (DumpCustom::*FnPtrPack)(int);
|
|
|
|
FnPtrPack *pack_choice; // ptrs to pack functions
|
2007-01-30 08:22:05 +08:00
|
|
|
|
2012-01-05 07:23:41 +08:00
|
|
|
void pack_compute(int);
|
|
|
|
void pack_fix(int);
|
|
|
|
void pack_variable(int);
|
2014-07-30 22:59:20 +08:00
|
|
|
void pack_custom(int);
|
2012-01-05 07:23:41 +08:00
|
|
|
|
2009-01-06 06:26:08 +08:00
|
|
|
void pack_id(int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_molecule(int);
|
2014-07-23 06:52:38 +08:00
|
|
|
void pack_proc(int);
|
2014-07-30 07:26:56 +08:00
|
|
|
void pack_procp1(int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_type(int);
|
2008-09-09 22:45:36 +08:00
|
|
|
void pack_mass(int);
|
2009-01-13 23:40:03 +08:00
|
|
|
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_x(int);
|
|
|
|
void pack_y(int);
|
|
|
|
void pack_z(int);
|
|
|
|
void pack_xs(int);
|
|
|
|
void pack_ys(int);
|
|
|
|
void pack_zs(int);
|
2009-01-13 23:40:03 +08:00
|
|
|
void pack_xs_triclinic(int);
|
|
|
|
void pack_ys_triclinic(int);
|
|
|
|
void pack_zs_triclinic(int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_xu(int);
|
|
|
|
void pack_yu(int);
|
|
|
|
void pack_zu(int);
|
2009-01-13 23:40:03 +08:00
|
|
|
void pack_xu_triclinic(int);
|
|
|
|
void pack_yu_triclinic(int);
|
|
|
|
void pack_zu_triclinic(int);
|
2011-04-30 07:40:29 +08:00
|
|
|
void pack_xsu(int);
|
|
|
|
void pack_ysu(int);
|
|
|
|
void pack_zsu(int);
|
|
|
|
void pack_xsu_triclinic(int);
|
|
|
|
void pack_ysu_triclinic(int);
|
|
|
|
void pack_zsu_triclinic(int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_ix(int);
|
|
|
|
void pack_iy(int);
|
|
|
|
void pack_iz(int);
|
2009-01-13 23:40:03 +08:00
|
|
|
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_vx(int);
|
|
|
|
void pack_vy(int);
|
|
|
|
void pack_vz(int);
|
|
|
|
void pack_fx(int);
|
|
|
|
void pack_fy(int);
|
|
|
|
void pack_fz(int);
|
|
|
|
void pack_q(int);
|
|
|
|
void pack_mux(int);
|
|
|
|
void pack_muy(int);
|
|
|
|
void pack_muz(int);
|
2011-04-14 05:40:14 +08:00
|
|
|
void pack_mu(int);
|
2008-04-29 07:56:09 +08:00
|
|
|
void pack_radius(int);
|
2011-05-30 23:46:44 +08:00
|
|
|
void pack_diameter(int);
|
|
|
|
|
2008-04-29 07:56:09 +08:00
|
|
|
void pack_omegax(int);
|
|
|
|
void pack_omegay(int);
|
|
|
|
void pack_omegaz(int);
|
2008-06-25 01:25:43 +08:00
|
|
|
void pack_angmomx(int);
|
|
|
|
void pack_angmomy(int);
|
|
|
|
void pack_angmomz(int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void pack_tqx(int);
|
|
|
|
void pack_tqy(int);
|
|
|
|
void pack_tqz(int);
|
|
|
|
};
|
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
}
|
|
|
|
|
2006-09-28 03:51:33 +08:00
|
|
|
#endif
|
2010-01-12 09:37:48 +08:00
|
|
|
#endif
|
2011-12-16 09:37:13 +08:00
|
|
|
|
|
|
|
/* ERROR/WARNING messages:
|
|
|
|
|
|
|
|
E: No dump custom arguments specified
|
|
|
|
|
|
|
|
The dump custom command requires that atom quantities be specified to
|
|
|
|
output to dump file.
|
|
|
|
|
|
|
|
E: Invalid attribute in dump custom command
|
|
|
|
|
|
|
|
Self-explantory.
|
|
|
|
|
2013-02-16 01:32:15 +08:00
|
|
|
E: Dump_modify format string is too short
|
|
|
|
|
2014-01-31 01:42:09 +08:00
|
|
|
There are more fields to be dumped in a line of output than your
|
|
|
|
format string specifies.
|
2013-02-16 01:32:15 +08:00
|
|
|
|
2011-12-16 09:37:13 +08:00
|
|
|
E: Could not find dump custom compute ID
|
|
|
|
|
2014-01-31 01:42:09 +08:00
|
|
|
Self-explanatory.
|
2011-12-16 09:37:13 +08:00
|
|
|
|
|
|
|
E: Could not find dump custom fix ID
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom and fix not computed at compatible times
|
|
|
|
|
|
|
|
The fix must produce per-atom quantities on timesteps that dump custom
|
|
|
|
needs them.
|
|
|
|
|
|
|
|
E: Could not find dump custom variable name
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
2015-03-19 05:54:52 +08:00
|
|
|
E: Could not find custom per-atom property ID
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
Self-explanatory.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
2011-12-16 09:37:13 +08:00
|
|
|
E: Region ID for dump custom does not exist
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
2015-03-19 05:54:52 +08:00
|
|
|
E: Compute used in dump between runs is not current
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
The compute was not invoked on the current timestep, therefore it
|
|
|
|
cannot be used in a dump between runs.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
2011-12-16 09:37:13 +08:00
|
|
|
E: Threshhold for an atom property that isn't allocated
|
|
|
|
|
|
|
|
A dump threshhold has been requested on a quantity that is
|
|
|
|
not defined by the atom style used in this simulation.
|
|
|
|
|
|
|
|
E: Dumping an atom property that isn't allocated
|
|
|
|
|
|
|
|
The chosen atom style does not define the per-atom quantity being
|
|
|
|
dumped.
|
|
|
|
|
|
|
|
E: Dump custom compute does not compute per-atom info
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom compute does not calculate per-atom vector
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
2014-01-30 02:40:05 +08:00
|
|
|
E: Dump custom compute does not calculate per-atom array
|
2011-12-16 09:37:13 +08:00
|
|
|
|
2014-01-30 02:40:05 +08:00
|
|
|
Self-explanatory.
|
2011-12-16 09:37:13 +08:00
|
|
|
|
|
|
|
E: Dump custom compute vector is accessed out-of-range
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom fix does not compute per-atom info
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom fix does not compute per-atom vector
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom fix does not compute per-atom array
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom fix vector is accessed out-of-range
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump custom variable is not atom-style variable
|
|
|
|
|
|
|
|
Only atom-style variables generate per-atom quantities, needed for
|
|
|
|
dump output.
|
|
|
|
|
2015-03-19 05:54:52 +08:00
|
|
|
E: Custom per-atom property ID is not floating point
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
Self-explanatory.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
|
|
|
E: Custom per-atom property ID is not integer
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
Self-explanatory.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
2011-12-16 09:37:13 +08:00
|
|
|
E: Illegal ... command
|
|
|
|
|
|
|
|
Self-explanatory. Check the input script syntax and compare to the
|
|
|
|
documentation for the command. You can use -echo screen as a
|
|
|
|
command-line option when running LAMMPS to see the offending line.
|
|
|
|
|
|
|
|
E: Dump_modify region ID does not exist
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify element names do not match atom types
|
|
|
|
|
|
|
|
Number of element names must equal number of atom types.
|
|
|
|
|
|
|
|
E: Invalid attribute in dump modify command
|
|
|
|
|
|
|
|
Self-explantory.
|
|
|
|
|
|
|
|
E: Could not find dump modify compute ID
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify compute ID does not compute per-atom info
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify compute ID does not compute per-atom vector
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify compute ID does not compute per-atom array
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify compute ID vector is not large enough
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Could not find dump modify fix ID
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify fix ID does not compute per-atom info
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify fix ID does not compute per-atom vector
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify fix ID does not compute per-atom array
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify fix ID vector is not large enough
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Could not find dump modify variable name
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
|
|
|
E: Dump modify variable is not atom-style variable
|
|
|
|
|
|
|
|
Self-explanatory.
|
|
|
|
|
2015-03-19 05:54:52 +08:00
|
|
|
E: Could not find dump modify custom atom floating point property ID
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
Self-explanatory.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
|
|
|
E: Could not find dump modify custom atom integer property ID
|
|
|
|
|
2015-03-24 07:30:50 +08:00
|
|
|
Self-explanatory.
|
2015-03-19 05:54:52 +08:00
|
|
|
|
2011-12-16 09:37:13 +08:00
|
|
|
E: Invalid dump_modify threshhold operator
|
|
|
|
|
|
|
|
Operator keyword used for threshold specification in not recognized.
|
|
|
|
|
|
|
|
*/
|