Skip to content
Snippets Groups Projects
read_data.h 13.4 KiB
Newer Older
sjplimp's avatar
 
sjplimp committed
/* -*- c++ -*- ----------------------------------------------------------
sjplimp's avatar
sjplimp committed
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
sjplimp's avatar
 
sjplimp committed
   http://lammps.sandia.gov, Sandia National Laboratories
   Steve Plimpton, sjplimp@sandia.gov
sjplimp's avatar
sjplimp committed

   Copyright (2003) Sandia Corporation.  Under the terms of Contract
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
sjplimp's avatar
 
sjplimp committed
   certain rights in this software.  This software is distributed under
sjplimp's avatar
sjplimp committed
   the GNU General Public License.

   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

sjplimp's avatar
 
sjplimp committed
#ifdef COMMAND_CLASS

CommandStyle(read_data,ReadData)

#else

#ifndef LMP_READ_DATA_H
#define LMP_READ_DATA_H
sjplimp's avatar
sjplimp committed

sjplimp's avatar
 
sjplimp committed
#include <stdio.h>
sjplimp's avatar
 
sjplimp committed
#include "pointers.h"
sjplimp's avatar
sjplimp committed

sjplimp's avatar
 
sjplimp committed
namespace LAMMPS_NS {

class ReadData : protected Pointers {
sjplimp's avatar
sjplimp committed
 public:
sjplimp's avatar
 
sjplimp committed
  ReadData(class LAMMPS *);
sjplimp's avatar
sjplimp committed
  ~ReadData();
  void command(int, char **);

 private:
sjplimp's avatar
 
sjplimp committed
  int me,compressed;
sjplimp's avatar
 
sjplimp committed
  char *line,*copy,*keyword,*buffer,*style;
sjplimp's avatar
sjplimp committed
  FILE *fp;
  char **arg;
sjplimp's avatar
 
sjplimp committed
  int narg,maxarg;
  char argoffset1[8],argoffset2[8];
sjplimp's avatar
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  bigint id_offset;
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  int nlocal_previous;
sjplimp's avatar
 
sjplimp committed
  bigint natoms;
  bigint nbonds,nangles,ndihedrals,nimpropers;
  int ntypes;
  int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes;
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  bigint nellipsoids;
  class AtomVecEllipsoid *avec_ellipsoid;
sjplimp's avatar
 
sjplimp committed
  bigint nlines;
  class AtomVecLine *avec_line;
  bigint ntris;
  class AtomVecTri *avec_tri;
sjplimp's avatar
 
sjplimp committed
  bigint nbodies;
  class AtomVecBody *avec_body;
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  // box info

  double boxlo[3],boxhi[3];
  double xy,xz,yz;
  int triclinic;

  // optional args

sjplimp's avatar
 
sjplimp committed
  int addflag,offsetflag,shiftflag,coeffflag;
sjplimp's avatar
 
sjplimp committed
  tagint addvalue;
  int toffset,boffset,aoffset,doffset,ioffset;
  double shift[3];
  int extra_atom_types,extra_bond_types,extra_angle_types;
  int extra_dihedral_types,extra_improper_types;
  int groupbit;

sjplimp's avatar
 
sjplimp committed
  int nfix;
sjplimp's avatar
 
sjplimp committed
  int *fix_index;
  char **fix_header;
  char **fix_section;

  // methods

sjplimp's avatar
sjplimp committed
  void open(char *);
sjplimp's avatar
 
sjplimp committed
  void scan(int &, int &, int &, int &);
sjplimp's avatar
sjplimp committed
  int reallocate(int **, int, int);
sjplimp's avatar
 
sjplimp committed
  void header(int);
sjplimp's avatar
 
sjplimp committed
  void parse_keyword(int);
  void skip_lines(bigint);
sjplimp's avatar
 
sjplimp committed
  void parse_coeffs(char *, const char *, int, int, int);
sjplimp's avatar
 
sjplimp committed
  int style_match(const char *, const char *);
sjplimp's avatar
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  void atoms();
  void velocities();
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  void bonds(int);
  void bond_scan(int, char *, int *);
  void angles(int);
  void dihedrals(int);
  void impropers(int);

  void bonus(bigint, class AtomVec *, const char *);
  void bodies(int);
sjplimp's avatar
sjplimp committed

  void mass();
  void paircoeffs();
sjplimp's avatar
 
sjplimp committed
  void pairIJcoeffs();
sjplimp's avatar
sjplimp committed
  void bondcoeffs();
  void anglecoeffs(int);
  void dihedralcoeffs(int);
  void impropercoeffs(int);
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
  void fix(int, char *);
sjplimp's avatar
sjplimp committed
};

sjplimp's avatar
 
sjplimp committed
}

sjplimp's avatar
sjplimp committed
#endif
sjplimp's avatar
 
sjplimp committed
#endif
sjplimp's avatar
 
sjplimp committed

/* ERROR/WARNING messages:

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.

sjplimp's avatar
 
sjplimp committed
E: Read data add offset is too big

sjplimp's avatar
 
sjplimp committed
It cannot be larger than the size of atom IDs, e.g. the maximum 32-bit
integer.
sjplimp's avatar
 
sjplimp committed

E: Non-zero read_data shift z value for 2d simulation

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: No bonds allowed with this atom style
sjplimp's avatar
 
sjplimp committed

Self-explanatory.

sjplimp's avatar
 
sjplimp committed
E: No angles allowed with this atom style
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: No dihedrals allowed with this atom style
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: No impropers allowed with this atom style
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
Self-explanatory.

E: Fix ID for read_data does not exist

Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Cannot run 2d simulation with nonperiodic Z dimension

Use the boundary command to make the z dimension periodic in order to
run a 2d simulation.

sjplimp's avatar
 
sjplimp committed
E: Cannot read_data without add keyword after simulation box is defined

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: Cannot use read_data add before simulation box is defined

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: Cannot use read_data offset without add flag

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: Cannot use read_data shift without add flag

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: Cannot use read_data extra with add flag

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
W: Atom style in data file differs from currently defined atom style
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Must read Atoms before Velocities

The Atoms section of a data file must come before a Velocities
section.

E: Invalid data file section: Bonds

Atom style does not allow bonds.

E: Must read Atoms before Bonds

The Atoms section of a data file must come before a Bonds section.

E: Invalid data file section: Angles

Atom style does not allow angles.

E: Must read Atoms before Angles

The Atoms section of a data file must come before an Angles section.

E: Invalid data file section: Dihedrals

Atom style does not allow dihedrals.

E: Must read Atoms before Dihedrals

The Atoms section of a data file must come before a Dihedrals section.

E: Invalid data file section: Impropers

Atom style does not allow impropers.

E: Must read Atoms before Impropers

The Atoms section of a data file must come before an Impropers
section.

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: Ellipsoids

Atom style does not allow ellipsoids.

E: Must read Atoms before Ellipsoids

The Atoms section of a data file must come before a Ellipsoids
section.

E: Invalid data file section: Lines

Atom style does not allow lines.

E: Must read Atoms before Lines

The Atoms section of a data file must come before a Lines section.

E: Invalid data file section: Triangles

Atom style does not allow triangles.

E: Must read Atoms before Triangles

The Atoms section of a data file must come before a Triangles section.

E: Invalid data file section: Bodies

Atom style does not allow bodies.

E: Must read Atoms before Bodies

The Atoms section of a data file must come before a Bodies section.

sjplimp's avatar
 
sjplimp committed
E: Must define pair_style before Pair Coeffs

Must use a pair_style command before reading a data file that defines
Pair Coeffs.

sjplimp's avatar
 
sjplimp committed
W: Pair style in data file differs from currently defined pair style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Must define pair_style before PairIJ Coeffs

sjplimp's avatar
 
sjplimp committed
Must use a pair_style command before reading a data file that defines
PairIJ Coeffs.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: Bond Coeffs

Atom style does not allow bonds.

E: Must define bond_style before Bond Coeffs

Must use a bond_style command before reading a data file that
defines Bond Coeffs.

sjplimp's avatar
 
sjplimp committed
W: Bond style in data file differs from currently defined bond style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: Angle Coeffs

Atom style does not allow angles.

E: Must define angle_style before Angle Coeffs

Must use an angle_style command before reading a data file that
defines Angle Coeffs.

sjplimp's avatar
 
sjplimp committed
W: Angle style in data file differs from currently defined angle style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: Dihedral Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before Dihedral Coeffs

Must use a dihedral_style command before reading a data file that
defines Dihedral Coeffs.

sjplimp's avatar
 
sjplimp committed
W: Dihedral style in data file differs from currently defined dihedral style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: Improper Coeffs

Atom style does not allow impropers.

E: Must define improper_style before Improper Coeffs

Must use an improper_style command before reading a data file that
defines Improper Coeffs.

sjplimp's avatar
 
sjplimp committed
W: Improper style in data file differs from currently defined improper style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Invalid data file section: BondBond Coeffs

Atom style does not allow angles.

E: Must define angle_style before BondBond Coeffs

Must use an angle_style command before reading a data file that
defines Angle Coeffs.

E: Invalid data file section: BondAngle Coeffs

Atom style does not allow angles.

E: Must define angle_style before BondAngle Coeffs

Must use an angle_style command before reading a data file that
defines Angle Coeffs.

E: Invalid data file section: MiddleBondTorsion Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before MiddleBondTorsion Coeffs

Must use a dihedral_style command before reading a data file that
defines MiddleBondTorsion Coeffs.

E: Invalid data file section: EndBondTorsion Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before EndBondTorsion Coeffs

Must use a dihedral_style command before reading a data file that
defines EndBondTorsion Coeffs.

E: Invalid data file section: AngleTorsion Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before AngleTorsion Coeffs

Must use a dihedral_style command before reading a data file that
defines AngleTorsion Coeffs.

E: Invalid data file section: AngleAngleTorsion Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before AngleAngleTorsion Coeffs

Must use a dihedral_style command before reading a data file that
defines AngleAngleTorsion Coeffs.

E: Invalid data file section: BondBond13 Coeffs

Atom style does not allow dihedrals.

E: Must define dihedral_style before BondBond13 Coeffs

Must use a dihedral_style command before reading a data file that
defines BondBond13 Coeffs.

E: Invalid data file section: AngleAngle Coeffs

Atom style does not allow impropers.

E: Must define improper_style before AngleAngle Coeffs

Must use an improper_style command before reading a data file that
defines AngleAngle Coeffs.

E: Unknown identifier in data file: %s

A section of the data file cannot be read by LAMMPS.

E: No atoms in data file

The header of the data file indicated that atoms would be included,
sjplimp's avatar
 
sjplimp committed
but they are not present.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Needed molecular topology not in data file

sjplimp's avatar
 
sjplimp committed
The header of the data file indicated bonds, angles, etc would be
included, but they are not present.
sjplimp's avatar
 
sjplimp committed

E: Needed bonus data not in data file

Some atom styles require bonus data.  See the read_data doc page for
details.

sjplimp's avatar
 
sjplimp committed
E: Read_data shrink wrap did not assign all atoms correctly

sjplimp's avatar
 
sjplimp committed
This is typically because the box-size specified in the data file is
large compared to the actual extent of atoms in a shrink-wrapped
dimension.  When LAMMPS shrink-wraps the box atoms will be lost if the
processor they are re-assigned to is too far away.  Choose a box
size closer to the actual extent of the atoms.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Unexpected end of data file

LAMMPS hit the end of the data file while attempting to read a
section.  Something is wrong with the format of the data file.

E: No ellipsoids allowed with this atom style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.  Check data file.
sjplimp's avatar
 
sjplimp committed

E: No lines allowed with this atom style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.  Check data file.
sjplimp's avatar
 
sjplimp committed

E: No triangles allowed with this atom style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.  Check data file.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: No bodies allowed with this atom style

sjplimp's avatar
 
sjplimp committed
Self-explanatory.  Check data file.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: System in data file is too big

See the setting for bigint in the src/lmptype.h file.

E: Bonds defined but no bond types

The data file header lists bonds but no bond types.

E: Angles defined but no angle types

The data file header lists angles but no angle types.

E: Dihedrals defined but no dihedral types

The data file header lists dihedrals but no dihedral types.

E: Impropers defined but no improper types

The data file header lists improper but no improper types.

sjplimp's avatar
 
sjplimp committed
E: No molecule topology allowed with atom style template

sjplimp's avatar
 
sjplimp committed
The data file cannot specify the number of bonds, angles, etc,
because this info if inferred from the molecule templates.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Did not assign all atoms correctly

Atoms read in from a data file were not assigned correctly to
processors.  This is likely due to some atom coordinates being
outside a non-periodic simulation box.

sjplimp's avatar
 
sjplimp committed
E: Subsequent read data induced too many bonds per atom

See the create_box extra/bond/per/atom or the read_data
extra/bond/per/atom keyword to set this limit larger.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Bonds assigned incorrectly

Bonds read in from the data file were not assigned correctly to atoms.
This means there is something invalid about the topology definitions.

sjplimp's avatar
 
sjplimp committed
E: Subsequent read data induced too many angles per atom

See the create_box extra/angle/per/atom or the read_data
extra/angle/per/atom keyword to set this limit larger.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Angles assigned incorrectly

Angles read in from the data file were not assigned correctly to
atoms.  This means there is something invalid about the topology
definitions.

sjplimp's avatar
 
sjplimp committed
E: Subsequent read data induced too many dihedrals per atom

See the create_box extra/dihedral/per/atom or the read_data
extra/dihedral/per/atom keyword to set this limit larger.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Dihedrals assigned incorrectly

Dihedrals read in from the data file were not assigned correctly to
atoms.  This means there is something invalid about the topology
definitions.

sjplimp's avatar
 
sjplimp committed
E: Subsequent read data induced too many impropers per atom

See the create_box extra/improper/per/atom or the read_data
extra/improper/per/atom keyword to set this limit larger.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Impropers assigned incorrectly

Impropers read in from the data file were not assigned correctly to
atoms.  This means there is something invalid about the topology
definitions.

sjplimp's avatar
 
sjplimp committed
E: Too few values in body lines in data file

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

E: Too many values in body lines in data file

sjplimp's avatar
 
sjplimp committed
Self-explanatory.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Too many lines in one body in data file - boost MAXBODY
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
MAXBODY is a setting at the top of the src/read_data.cpp file.
Set it larger and re-compile the code.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Unexpected end of PairCoeffs section

sjplimp's avatar
 
sjplimp committed
Read a blank line.
sjplimp's avatar
 
sjplimp committed

E: Unexpected end of BondCoeffs section

sjplimp's avatar
 
sjplimp committed
Read a blank line.
sjplimp's avatar
 
sjplimp committed

E: Unexpected end of AngleCoeffs section

sjplimp's avatar
 
sjplimp committed
Read a blank line.
sjplimp's avatar
 
sjplimp committed

E: Unexpected end of DihedralCoeffs section

sjplimp's avatar
 
sjplimp committed
Read a blank line.
sjplimp's avatar
 
sjplimp committed

E: Unexpected end of ImproperCoeffs section

sjplimp's avatar
 
sjplimp committed
Read a blank line.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Cannot open gzipped file
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
LAMMPS was compiled without support for reading and writing gzipped
files through a pipeline to the gzip program with -DLAMMPS_GZIP.
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
E: Cannot open file %s
sjplimp's avatar
 
sjplimp committed

sjplimp's avatar
 
sjplimp committed
The specified file cannot be opened.  Check that the path and name are
correct. If the file is a compressed file, also check that the gzip
executable can be found and run.
sjplimp's avatar
 
sjplimp committed

*/