diff --git a/rugnux/Rugnux.h b/rugnux/Rugnux.h index 21227a34b..fc61f484d 100644 --- a/rugnux/Rugnux.h +++ b/rugnux/Rugnux.h @@ -678,7 +678,8 @@ struct DoubledClassTranslation { std::vector shells; }; DoubledClassTranslation FitDoubledClassTranslation(const std::vector &merged, - const UnitCell &doubled_cell, const UnitCell &half_cell); + const UnitCell &doubled_cell, const UnitCell &half_cell, + char half_centering = 'P'); // Whether two passes hold the same lattice: the same Bravais class and primitive volumes within 2 %. bool ArmsHoldSameLattice(const ProcessResult &a, const ProcessResult &b); diff --git a/rugnux/RugnuxPasses.cpp b/rugnux/RugnuxPasses.cpp index c2e229fbf..eb0db145d 100644 --- a/rugnux/RugnuxPasses.cpp +++ b/rugnux/RugnuxPasses.cpp @@ -1470,14 +1470,15 @@ std::string DoubledCellRises(const ProcessResult::SupercellClass &sc) { } DoubledClassTranslation FitDoubledClassTranslation(const std::vector &merged, - const UnitCell &doubled_cell, const UnitCell &half_cell) { + const UnitCell &doubled_cell, const UnitCell &half_cell, + char half_centering) { DoubledClassTranslation out; // The added class in the written cell: the parity whose sub-lattice is the half cell. Its real lattice // is the doubled one plus half of (p0 a + p1 b + p2 c), so one vector the class is odd on is replaced // by that half-vector. const CrystalLattice dl(doubled_cell); const Coord v[3] = {dl.Vec0(), dl.Vec1(), dl.Vec2()}; - const UnitCell want = CrystalLattice(half_cell).NiggliReduce().GetUnitCell(); + const UnitCell want = CrystalLattice(half_cell).ToPrimitive(half_centering).NiggliReduce().GetUnitCell(); double best_mismatch = INFINITY; for (int c = 1; c < 8; c++) { const std::array p = {(c >> 2) & 1, (c >> 1) & 1, c & 1}; @@ -1681,7 +1682,8 @@ ProcessResult Rugnux::DoubledCellHypothesis(RugnuxObserver *observer, ProcessRes // doubled merge, that one translation accounts for most of the class in every shell: the two halves // of the cell are then one content displaced, out to the limit (FitDoubledClassTranslation). const DoubledClassTranslation tr = FitDoubledClassTranslation(d.merged_reflections, *d.consensus_cell, - *half.consensus_cell); + *half.consensus_cell, + half.consensus_centering.value_or('P')); d.merged_reflections.clear(); const DoubledClassTranslation::Shell *weakest = nullptr; std::string table;