From 631d8de6690a8a466c5c289e985941175770a6e7 Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Mon, 15 Apr 2024 15:02:02 +0100 Subject: [PATCH] fix: Creating configuration for CuBTC example (#1854) (#1856) --- src/gui/importCIFDialog.ui | 32 +++++++++++++++++++++++-------- src/io/import/cif.cpp | 4 +++- src/io/import/cif.h | 2 +- web/docs/examples/cu-btc/step1.md | 6 +++--- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/gui/importCIFDialog.ui b/src/gui/importCIFDialog.ui index 26ac27cd09..c85e18bbff 100644 --- a/src/gui/importCIFDialog.ui +++ b/src/gui/importCIFDialog.ui @@ -135,7 +135,7 @@ 0 0 - 162 + 292 639 @@ -392,8 +392,8 @@ 0 0 - 407 - 675 + 296 + 625 @@ -482,7 +482,7 @@ Remove any water molecules or coordinated oxygens without hydrogens - Remove water and coordinated oxygen + Remove water and coordinated oxygens @@ -598,8 +598,8 @@ 0 0 - 407 - 675 + 276 + 93 @@ -691,8 +691,8 @@ 0 0 - 407 - 675 + 96 + 78 @@ -728,6 +728,14 @@ + + + 0 + 0 + 96 + 78 + + :/general/icons/threeSpecies.svg:/general/icons/threeSpecies.svg @@ -757,6 +765,14 @@ + + + 0 + 0 + 167 + 142 + + :/general/icons/configuration.svg:/general/icons/configuration.svg diff --git a/src/io/import/cif.cpp b/src/io/import/cif.cpp index 33d3dd56ce..66e6b70c93 100644 --- a/src/io/import/cif.cpp +++ b/src/io/import/cif.cpp @@ -973,12 +973,14 @@ void CIFHandler::finalise(CoreData &coreData, const Flags &flags) c { auto *sp = coreData.addSpecies(); sp->copyBasic(&supercellSpecies_); - if (flags.isSet(OutputFlags::OutputFramework)) + if (flags.isSet(OutputFlags::OutputSupermolecule)) { sp->removePeriodicBonds(); sp->updateIntramolecularTerms(); sp->removeBox(); } + else + sp->createBox(supercellSpecies_.box()->axisLengths(), supercellSpecies_.box()->axisAngles()); if (flags.isSet(OutputFlags::OutputConfiguration)) { diff --git a/src/io/import/cif.h b/src/io/import/cif.h index 7f0732ab83..9922a0cdf7 100644 --- a/src/io/import/cif.h +++ b/src/io/import/cif.h @@ -119,7 +119,7 @@ class CIFHandler // Bonding tolerance, if calculating bonding rather than using CIF definitions double bondingTolerance_{1.1}; // Whether to prevent metallic bonding - bool preventMetallicBonds_{false}; + bool preventMetallicBonds_{true}; // Whether to remove free atomic moieties in clean-up bool removeAtomics_{false}; // Whether to remove water and coordinated oxygen atoms in clean-up diff --git a/web/docs/examples/cu-btc/step1.md b/web/docs/examples/cu-btc/step1.md index 1875915984..8ffec4118a 100644 --- a/web/docs/examples/cu-btc/step1.md +++ b/web/docs/examples/cu-btc/step1.md @@ -22,7 +22,7 @@ The default options get us most of the way there, but it's instructive to take a Before we proceed, make sure that the default Cu-BTC groups (`Global/Default`, `B/Default`, and `A/1`) are the only ones enabled. -Now, if you look closely at the crystal structure you'll see "extra" oxygen atoms attached to the copper sites: +Now, if you look closely at the crystal structure you'll see some oxygen atoms floating around in space... {{< cimage src="../cu-btc-default-zoom.png" caption="Dangling oxygens on Cu sites" >}} @@ -30,9 +30,9 @@ These are in fact from coordinated water molecules present when the crystal stru {{< action type="mouse" >}}Open the {{}} section{{< /action >}} -The _Structure Cleanup_ page has several options for cleaning up various aspects of the structure we currently have, for example removing free atoms/ions. We want to use the option to remove water molecules, which will also remove terminal oxygen atoms based on the assumption that hydrogen positions were not available in the CIF. So: +The _Structure Cleanup_ page has several options for cleaning up various aspects of the structure we currently have, for example removing free atoms/ions. There is a specific option for removing water molecules (_Remove water and coordinated oxygens_) which will also remove terminal oxygen atoms based on the assumption that hydrogen positions were not available in the CIF. Ours are just free atoms, however, so: -{{< action type="check" >}}Enable the _Remove water and coordinated oxygen_ option{{< /action >}} +{{< action type="check" >}}Enable the _Remove unbound atoms_ option{{< /action >}} You should see those terminal oxygen atoms disappear from the structure, leaving us with a "pure" Cu-BTC framework. There are a couple of pages left in the wizard which allow us to create a supercell from the unit cell,