Skip to content

Commit

Permalink
Small patch to parsing XYZ trajectories to handle ORCA 6 separators
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Sep 8, 2024
1 parent 96c13db commit 48e1a4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions avogadro/io/xyzformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ bool XyzFormat::read(std::istream& inStream, Core::Molecule& mol)

// Do we have an animation?
size_t numAtoms2;
if (getline(inStream, buffer) && (numAtoms2 = lexicalCast<int>(buffer)) &&
numAtoms == numAtoms2) {
// check if the next frame has the same number of atoms
getline(inStream, buffer); // should be the number of atoms
if (buffer[0] == '<')
getline(inStream, buffer); // Orca 6 prints ">" separators instead

if ((numAtoms2 = lexicalCast<int>(buffer)) && numAtoms == numAtoms2) {
getline(inStream, buffer); // Skip the blank
mol.setCoordinate3d(mol.atomPositions3d(), 0);
int coordSet = 1;
Expand Down

0 comments on commit 48e1a4b

Please sign in to comment.