Simpatico
v1.10
|
ConfigIo for Lammps data files.
This class reads and writes the data file format that is read by the LAMMPS read_data command. Because the Lammps data model is very different than that used in Simpatico, there are signficant restrictions on the use of such files:
1) When reading a LAMMPS data file, the maximum total number of atoms defined by the Simpatico parameter file must exactly match the number of atoms in the data file.
2) The atom ids (or tags) in the Lammps data file must appear in order, numbered from 1. This is checked.
3) The ordering of atoms in the lammps file and the topology are assumed to be consistent with that used in Simpatico. The topology information in the Lammps data file is discarded. This requires that atoms within each molecule be listed sequentially, with molecules with the same species listed sequentially, and that ordered of atoms within each molecule be consistent with the numbering scheme used in Simpatico. Thus far, none of this is checked.
Definition at line 50 of file mcMd/configIos/LammpsConfigIo.h.
#include <LammpsConfigIo.h>
Public Member Functions | |
LammpsConfigIo (System &system) | |
Constructor. More... | |
virtual | ~LammpsConfigIo () |
Destructor. More... | |
void | read (std::istream &in) |
Read configuration (particle positions) from file. More... | |
void | write (std::ostream &out) |
Write configuration (particle positions) to file. More... | |
![]() | |
ConfigIo (System &system) | |
Constructor. More... | |
virtual | ~ConfigIo () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
System & | system () const |
Get a reference to the parent System. More... | |
Simulation & | simulation () const |
Get a reference to the parent Simulation. More... | |
Boundary & | boundary () const |
Get the Boundary. More... | |
McMd::LammpsConfigIo::LammpsConfigIo | ( | System & | system | ) |
Constructor.
Definition at line 35 of file mcMd/configIos/LammpsConfigIo.cpp.
|
virtual |
Destructor.
Definition at line 42 of file mcMd/configIos/LammpsConfigIo.cpp.
|
virtual |
Read configuration (particle positions) from file.
in | input file stream. |
Implements McMd::ConfigIo.
Definition at line 45 of file mcMd/configIos/LammpsConfigIo.cpp.
References McMd::System::addMolecule(), McMd::Molecule::begin(), McMd::ConfigIo::boundary(), Simp::Species::capacity(), McMd::Simulation::getMolecule(), Simp::Species::nAtom(), Simp::Species::nBond(), Util::ArrayIterator< Data >::notEnd(), McMd::Simulation::nSpecies(), Simp::OrthorhombicBoundary::setOrthorhombic(), McMd::ConfigIo::simulation(), McMd::Simulation::species(), Util::Vector::subtract(), McMd::ConfigIo::system(), UTIL_CHECK, and UTIL_THROW.
|
virtual |
Write configuration (particle positions) to file.
out | output file stream. |
Implements McMd::ConfigIo.
Definition at line 168 of file mcMd/configIos/LammpsConfigIo.cpp.
References McMd::System::begin(), McMd::ConfigIo::boundary(), Util::Dimension, Util::Format::initStatic(), Simp::OrthorhombicBoundary::lengths(), Simp::Species::nAngle(), McMd::Simulation::nAngleType(), Simp::Species::nAtom(), McMd::Simulation::nAtomType(), Simp::Species::nBond(), McMd::Simulation::nBondType(), Simp::Species::nDihedral(), McMd::Simulation::nDihedralType(), McMd::System::nMolecule(), Util::ArrayIterator< Data >::notEnd(), Util::PArrayIterator< Data >::notEnd(), McMd::Simulation::nSpecies(), Util::Format::setDefaultPrecision(), Util::Format::setDefaultWidth(), McMd::ConfigIo::simulation(), McMd::Simulation::species(), and McMd::ConfigIo::system().