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

Don't bond Noble gases #1357

Merged
merged 3 commits into from
Sep 29, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ jobs:
if [ -z "${P12_PASSWORD}" ]; then
unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign
fi
[[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"`
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ jobs:
# signing occurs via avogadroapp cpack instructions
fi # certificate exists
fi # password exists
# remove any previous DMG in case they're still around
rm -f avogadroapp/*.dmg

- name: Create Mac and Windows Packages
shell: bash
run: |
if [ -z "${P12_PASSWORD}" ]; then
unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign
fi
[[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"`
cpack ${{ matrix.config.cpack_flags }}
working-directory: ${{ runner.workspace }}/build/avogadroapp
env:
Expand Down
22 changes: 22 additions & 0 deletions avogadro/core/molecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,28 @@ void Molecule::perceiveBondsSimple(const double tolerance, const double min)
Vector3 jpos = m_positions3d[j];
Vector3 diff = jpos - ipos;

// Don't automatically bond nobel gases to anything
switch (atomicNumber(i)) {
case 2: // He
case 10: // Ne
case 18: // Ar
case 36: // Kr
continue;
default:
break;
}

// now for the other atom
switch (atomicNumber(j)) {
case 2: // He
case 10: // Ne
case 18: // Ar
case 36: // Kr
continue;
default:
break;
}

if (std::fabs(diff[0]) > cutoff || std::fabs(diff[1]) > cutoff ||
std::fabs(diff[2]) > cutoff ||
(atomicNumber(i) == 1 && atomicNumber(j) == 1))
Expand Down
Loading