Class Scine::Utils::MolecularTrajectoryIO

class MolecularTrajectoryIO

Class for input and output of MolecularTrajectory classes.

Public Types

enum format

Enum class for possible input and output formats.

Values:

xyz
binary

Public Static Functions

static void write(format f, const std::string &fileName, const MolecularTrajectory &m)

Write a molecular trajectory to a file.

Parameters
  • f: The format to be used/expected.

  • fileName: The file path.

  • m: The trajectory.

Exceptions
  • std::runtime_error: If the file could not be created.

static void write(format f, std::ostream &out, const MolecularTrajectory &m)

Write a molecular trajectory to a stream.

Parameters
  • f: The format to be used/expected.

  • out: The output stream.

  • m: The trajectory.

static MolecularTrajectory read(format f, const std::string &fileName)

Read a molecular trajectory from a file.

Return

MolecularTrajectory Returns the trajectory.

Parameters
  • f: The format to be used/expected.

  • fileName: The file path.

Exceptions
  • std::runtime_error: If the file could not be opened.

static MolecularTrajectory read(format f, std::istream &in)

Read a molecular trajectory from a stream.

Return

MolecularTrajectory Returns the trajectory.

Parameters
  • f: The format to be used/expected.

  • in: The input stream.

Exceptions
  • std::runtime_error: If the format isn’t supported.

static void writeXYZLine(std::ostream &out, ElementType e, const Position &p)

Output a single line (one atom) of a XYZ file.

Parameters
  • out: The output stream to be written to.

  • e: The ElementType of the atom tho be printed.

  • p: The Position of the atom tho be printed.