Skip to content

Commit 58afe78

Browse files
committed
Merge branch 'fix-overlapcalc-rmin'
* respect OverlapCalculator.rmin in overlap evaluation Resolve #26
2 parents 6e74f72 + 7ab9bcf commit 58afe78

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/diffpy/srreal/OverlapCalculator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ void OverlapCalculator::resetValue()
424424

425425
void OverlapCalculator::configureBondGenerator(BaseBondGenerator& bnds) const
426426
{
427+
bnds.setRmin(this->getRmin());
427428
bnds.setRmax(this->getRmaxUsed());
428429
}
429430

src/tests/TestOverlapCalculator.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,31 @@ class TestOverlapCalculator : public CxxTest::TestSuite
5454
}
5555

5656

57+
void test_rmin()
58+
{
59+
molc->eval(mnacl);
60+
TS_ASSERT(molc->distances().size());
61+
double tot = molc->totalSquareOverlap();
62+
TS_ASSERT_LESS_THAN(0.0, tot);
63+
molc->setRmin(10);
64+
molc->eval();
65+
TS_ASSERT(molc->distances().empty());
66+
TS_ASSERT_EQUALS(0.0, molc->totalSquareOverlap());
67+
molc->setRmin(2);
68+
molc->eval();
69+
TS_ASSERT_EQUALS(tot, molc->totalSquareOverlap());
70+
}
71+
72+
73+
void test_rmax()
74+
{
75+
molc->setRmax(2.5);
76+
molc->eval(mnacl);
77+
TS_ASSERT(molc->distances().empty())
78+
TS_ASSERT_EQUALS(0.0, molc->totalSquareOverlap());
79+
}
80+
81+
5782
void test_lineNoTouch()
5883
{
5984
AtomicStructureAdapterPtr stru(new AtomicStructureAdapter);

0 commit comments

Comments
 (0)