Skip to content

Commit 5419027

Browse files
committed
MNT: drop check for ObjCryst inversion center bug
Inversion center bug is fixed in recent ObjCryst.
1 parent e0d69e1 commit 5419027

1 file changed

Lines changed: 3 additions & 33 deletions

File tree

src/diffpy/srreal/ObjCrystStructureAdapter.cpp

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,6 @@ getUij(const ObjCryst::ScatteringPower* sp)
6161
}
6262

6363

64-
bool isGetInversionCenterDoubled()
65-
{
66-
static int value_cached = 0;
67-
const int BIT_CACHED = 1;
68-
const int BIT_VALUE = 2;
69-
// short circuit when the flag is already cached
70-
if (BIT_CACHED & value_cached) {
71-
const bool rv = BIT_VALUE & value_cached;
72-
return rv;
73-
}
74-
ObjCryst::SpaceGroup sg129("P 4/n m m :1");
75-
const CrystVector_REAL xyzinv = sg129.GetInversionCenter();
76-
if (0.5 == xyzinv(0) && 0.5 == xyzinv(1) && 0 == xyzinv(2)) {
77-
value_cached |= BIT_VALUE;
78-
}
79-
else if (0.25 == xyzinv(0) && 0.25 == xyzinv(1) && 0 == xyzinv(2)) {
80-
value_cached &= ~BIT_VALUE;
81-
}
82-
else {
83-
const char* emsg =
84-
"Unexpected value of ObjCryst::SpaceGroup::GetInversionCenter()";
85-
throw logic_error(emsg);
86-
}
87-
value_cached |= BIT_CACHED;
88-
return isGetInversionCenterDoubled();
89-
}
90-
91-
9264
CrystalStructureAdapter::SymOpVector
9365
fetchSymmetryOperations(const ObjCryst::SpaceGroup& spacegroup)
9466
{
@@ -131,12 +103,10 @@ fetchSymmetryOperations(const ObjCryst::SpaceGroup& spacegroup)
131103
assert(spacegroup.IsCentrosymmetric());
132104
assert(nbsym == 2 * last);
133105
CrystVector_REAL xyzinv = spacegroup.GetInversionCenter();
134-
// get tinv the overall translation associated with inversion center.
135-
// fox-objcryst 2017.2 returns doubled coordinates for the inversion
136-
// center so the tinv is the same. Expect fixup which will require
137-
// doubling the tinv value here.
106+
// tinv is the overall translation associated with inversion center.
107+
// it is double the inversion center position.
138108
R3::Vector tinv(xyzinv(0), xyzinv(1), xyzinv(2));
139-
tinv *= isGetInversionCenterDoubled() ? 1.0 : 2.0;
109+
tinv *= 2.0;
140110
// now apply the inversion center here
141111
for (int i = 0, j = last; i < last; ++i, ++j)
142112
{

0 commit comments

Comments
 (0)