|
23 | 23 | #include <cmath> |
24 | 24 | #include <set> |
25 | 25 |
|
| 26 | +#include <ObjCryst/version.h> |
26 | 27 | #include <diffpy/srreal/ObjCrystStructureAdapter.hpp> |
27 | 28 |
|
| 29 | +#if LIBOBJCRYST_VERSION < 2017002001000LL |
| 30 | +#error libdiffpy requires libobjcryst 2017.2.1 or later. |
| 31 | +#endif |
| 32 | + |
28 | 33 | using namespace std; |
29 | 34 |
|
30 | 35 | namespace diffpy { |
@@ -56,34 +61,6 @@ getUij(const ObjCryst::ScatteringPower* sp) |
56 | 61 | } |
57 | 62 |
|
58 | 63 |
|
59 | | -bool isGetInversionCenterDoubled() |
60 | | -{ |
61 | | - static int value_cached = 0; |
62 | | - const int BIT_CACHED = 1; |
63 | | - const int BIT_VALUE = 2; |
64 | | - // short circuit when the flag is already cached |
65 | | - if (BIT_CACHED & value_cached) { |
66 | | - const bool rv = BIT_VALUE & value_cached; |
67 | | - return rv; |
68 | | - } |
69 | | - ObjCryst::SpaceGroup sg129("P 4/n m m :1"); |
70 | | - const CrystVector_REAL xyzinv = sg129.GetInversionCenter(); |
71 | | - if (0.5 == xyzinv(0) && 0.5 == xyzinv(1) && 0 == xyzinv(2)) { |
72 | | - value_cached |= BIT_VALUE; |
73 | | - } |
74 | | - else if (0.25 == xyzinv(0) && 0.25 == xyzinv(1) && 0 == xyzinv(2)) { |
75 | | - value_cached &= ~BIT_VALUE; |
76 | | - } |
77 | | - else { |
78 | | - const char* emsg = |
79 | | - "Unexpected value of ObjCryst::SpaceGroup::GetInversionCenter()"; |
80 | | - throw logic_error(emsg); |
81 | | - } |
82 | | - value_cached |= BIT_CACHED; |
83 | | - return isGetInversionCenterDoubled(); |
84 | | -} |
85 | | - |
86 | | - |
87 | 64 | CrystalStructureAdapter::SymOpVector |
88 | 65 | fetchSymmetryOperations(const ObjCryst::SpaceGroup& spacegroup) |
89 | 66 | { |
@@ -126,12 +103,10 @@ fetchSymmetryOperations(const ObjCryst::SpaceGroup& spacegroup) |
126 | 103 | assert(spacegroup.IsCentrosymmetric()); |
127 | 104 | assert(nbsym == 2 * last); |
128 | 105 | CrystVector_REAL xyzinv = spacegroup.GetInversionCenter(); |
129 | | - // get tinv the overall translation associated with inversion center. |
130 | | - // fox-objcryst 2017.2 returns doubled coordinates for the inversion |
131 | | - // center so the tinv is the same. Expect fixup which will require |
132 | | - // doubling the tinv value here. |
| 106 | + // tinv is the overall translation associated with inversion center. |
| 107 | + // it is double the inversion center position. |
133 | 108 | R3::Vector tinv(xyzinv(0), xyzinv(1), xyzinv(2)); |
134 | | - tinv *= isGetInversionCenterDoubled() ? 1.0 : 2.0; |
| 109 | + tinv *= 2.0; |
135 | 110 | // now apply the inversion center here |
136 | 111 | for (int i = 0, j = last; i < last; ++i, ++j) |
137 | 112 | { |
|
0 commit comments