Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read MBIS charges from ORCA output #1823

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ jobs:
path: ${{ runner.workspace }}/build/avogadroapp/Avogadro*.*
name: ${{ matrix.config.artifact }}

- name: Sign Windows artifact
if: matrix.config.os == 'windows-latest' && github.ref == 'refs/heads/master'
- name: Sign Windows release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
Expand Down
16 changes: 14 additions & 2 deletions avogadro/quantumio/orca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,28 @@ void ORCAOutput::processLine(std::istream& in, GaussianSet* basis)
getline(in, key); //------------
} else if (Core::contains(key, "HIRSHFELD ANALYSIS")) {
m_currentMode = HirshfeldCharges;
m_chargeType = "Hirshfeld";
for (unsigned int i = 0; i < 6; ++i) {
getline(in, key); // skip header
}
} else if (Core::contains(key, "MBIS ANALYSIS")) {
// MBIS analysis is similar to Hirshfeld, but with different headers
m_currentMode = HirshfeldCharges;
m_chargeType = "MBIS";
for (unsigned int i = 0; i < 9; ++i) {
getline(in, key); // skip header
}
} else if (Core::contains(key, "ATOMIC CHARGES")) {
m_currentMode = Charges;
// figure out what type of charges we have
list = Core::split(key, ' ');
if (list.size() > 2) {
m_chargeType = Core::trimmed(list[0]); // e.g. MULLIKEN or LOEWDIN
}
// lowercase everything except the first letter
for (unsigned int i = 1; i < m_chargeType.size(); ++i) {
m_chargeType[i] = tolower(m_chargeType[i]);
}
getline(in, key); // skip ------------
} else if (Core::contains(key, "VIBRATIONAL FREQUENCIES")) {
m_currentMode = Frequencies;
Expand Down Expand Up @@ -370,7 +382,7 @@ void ORCAOutput::processLine(std::istream& in, GaussianSet* basis)

list = Core::split(key, ' ');
while (!key.empty()) {
if (list.size() != 4) {
if (list.size() < 4) {
break;
}
// e.g. index atom charge spin
Expand All @@ -384,7 +396,7 @@ void ORCAOutput::processLine(std::istream& in, GaussianSet* basis)
list = Core::split(key, ' ');
}

m_partialCharges["Hirshfeld"] = charges;
m_partialCharges[m_chargeType] = charges;
m_currentMode = NotParsing;
break;
}
Expand Down
Loading