ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | List of all members
BinaryReader Class Reference
Inheritance diagram for BinaryReader:
InputBase

Public Member Functions

void readXML (XMLfileUnits &xmlconfig)
 
void setPhaseSpaceFile (std::string filename)
 gets a filename and opens an ifstream associated with the given file More...
 
void setPhaseSpaceHeaderFile (std::string filename)
 For this class, header and data are in the same file, so there is no separate header file.
 
void readPhaseSpaceHeader (Domain *domain, double timestep)
 reads in header of the input file (including component description) More...
 
unsigned long readPhaseSpace (ParticleContainer *particleContainer, Domain *domain, DomainDecompBase *domainDecomp)
 reads in the data of all molecules More...
 

Member Function Documentation

◆ readPhaseSpace()

unsigned long BinaryReader::readPhaseSpace ( ParticleContainer particleContainer,
Domain domain,
DomainDecompBase domainDecomp 
)
virtual

reads in the data of all molecules

The Molecule Data starts in a new line with the string "MoleculeFormat" followed by whitespace and a string representing the format. In the standard case (format ICRVQD), the following values are provided for each molecule:

  • id of the molecule (int)
  • id of the component of the molecule (int)
  • Coordinates: x, y, z (all double)
  • velocities: vx, vy, vz (all double)
  • Orientation (quaternion): q0, q1, q2, q3 (all double)
  • Angular Momentum: Dx, Dy, Dz (all double)

An example can be seen in the documentation of this class

Parameters
particleContainerHere the Molecules from the input file are stored
Returns
Highest molecule ID found in the input phase space file.

Implements InputBase.

◆ readPhaseSpaceHeader()

void BinaryReader::readPhaseSpaceHeader ( Domain domain,
double  timestep 
)
virtual

reads in header of the input file (including component description)

The Header in the input file consists of several elements. An element starts in a new line with the element name followed by some whitespace (e.g. "Temperature "). After that, there can be any number of tokens belonging to that element. A description of the different elements follows below. But first some rules dealing with the order of the elements:

  • The first header element must start with the string "MDProject" followed by a timestamp.
  • The last header element must start with the string NumberOfMolecules. After that, the header is over and the molecule data follows
  • The order of the remaining header lines is not important.
  • Header elements beginning with "#" are ignored.

Now the description of the different elements:

  • MDProject: One token follows with a version number (see description of _inpversion);
  • currenttime: One token follows with the start time
  • Temperature: One token follows with the temperature
  • Length: Three tokens follow with the length of the simulation box in the three dimensions (x, y and z)
  • NumberOfComponents: Here follow several tokens, the first one is the actual Number of Components. Then the values describing the components have to follow, seperated by whitespace. For each component, the following values have to be provided:
    • Number of Lennard-Jones-Centers, Number of Dipoles, Number of Quadrupoles (all int)
    • For each LJ-Center: x-coord., y-coord., z-coord., mass, epsilon, sigma (all double)
    • For each Dipole: x-coord., y-coord., z-coord., eMyx, eMyy, eMyz, absMy (all double)
    • For each Quadrupole: x-coord., y-coord., z-coord., eQx, eQy, eQz, absQ (all double)
    • moments of inertia for principal axes: I11, I22, I33 (all double)
    • For each pair of different components: xi, eta (both double)
    • epsilonRF (double)
  • NumberOfMolecules: One token follows with the number of molecules

An example can be seen in the documentation of this class

Implements InputBase.

◆ readXML()

void BinaryReader::readXML ( XMLfileUnits xmlconfig)
virtual

Reimplemented from InputBase.

◆ setPhaseSpaceFile()

void BinaryReader::setPhaseSpaceFile ( std::string  filename)

gets a filename and opens an ifstream associated with the given file

As the reading of the phasespace file is separated into two parts, but each line of the file should only be parsed once, not the filename itself is stored, but a stream (_phaseSpaceFileStream) which is associated with the file

Parameters
filenamefull path to the input file

The documentation for this class was generated from the following files: