Skip to content

Commit

Permalink
Merge pull request #1823 from ghutchis/orca-mbis
Browse files Browse the repository at this point in the history
Read MBIS charges from ORCA output
  • Loading branch information
ghutchis authored Nov 26, 2024
2 parents 33007db + 6b051ff commit 7098118
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
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

0 comments on commit 7098118

Please sign in to comment.