From 48e1a4ba1986986dd2dbbd3dc95b81e2a728ca58 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sun, 8 Sep 2024 11:15:31 -0400 Subject: [PATCH] Small patch to parsing XYZ trajectories to handle ORCA 6 separators Signed-off-by: Geoff Hutchison --- avogadro/io/xyzformat.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/avogadro/io/xyzformat.cpp b/avogadro/io/xyzformat.cpp index 8c042da5e4..64a3988f2b 100644 --- a/avogadro/io/xyzformat.cpp +++ b/avogadro/io/xyzformat.cpp @@ -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(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(buffer)) && numAtoms == numAtoms2) { getline(inStream, buffer); // Skip the blank mol.setCoordinate3d(mol.atomPositions3d(), 0); int coordSet = 1;