Skip to content

Commit

Permalink
Ensure all energies are grabbed in a trajectory
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Dec 3, 2024
1 parent 7682af5 commit fd94c68
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions avogadro/io/xyzformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ bool XyzFormat::read(std::istream& inStream, Core::Molecule& mol)
}

std::getline(inStream, buffer); // Skip the blank
// check for energies
if (findEnergy(buffer, energy)) {
energies.push_back(energy);
}
positions.clear();
}
}
Expand All @@ -280,9 +284,8 @@ bool XyzFormat::read(std::istream& inStream, Core::Molecule& mol)
mol.setPartialCharges("From File", chargesMatrix);
}

if (energies.size() > 1) {
if (energies.size() > 1)
mol.setData("energies", energies);
}

return true;
}
Expand Down

0 comments on commit fd94c68

Please sign in to comment.