From f86f97f9c9cb77cbcabc737fd638b98f117c5c28 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 13 Nov 2023 10:27:51 -0500 Subject: [PATCH] Fix atomic numbers from Orca - it would read electrons not symbols Thanks to the forum https://discuss.avogadro.cc/t/avogadro-1-98-reads-zinc-as-calcium/4978 Signed-off-by: Geoff Hutchison --- avogadro/quantumio/orca.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avogadro/quantumio/orca.cpp b/avogadro/quantumio/orca.cpp index 8578236e74..83105b3ae1 100644 --- a/avogadro/quantumio/orca.cpp +++ b/avogadro/quantumio/orca.cpp @@ -249,7 +249,9 @@ void ORCAOutput::processLine(std::istream& in, GaussianSet* basis) Core::lexicalCast(list[6]) * m_coordFactor, Core::lexicalCast(list[7]) * m_coordFactor); - m_atomNums.push_back(Core::lexicalCast(list[2])); + unsigned char atomicNum = + Core::Elements::atomicNumberFromSymbol(Core::trimmed(list[1])); + m_atomNums.push_back(atomicNum); m_atomPos.push_back(pos); m_atomLabel.push_back(Core::trimmed(list[1])); getline(in, key);