Skip to content

Commit 2a1e7d3

Browse files
author
Gareth Aneurin Tribello
committed
Ensuring derivatives are not added in ContactMap when they are not required
1 parent 767169b commit 2a1e7d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/adjmat/ContactMatrix.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ double ContactMatrix::calculateWeight( const Vector& pos1, const Vector& pos2, c
113113
if( mod2<epsilon ) return 0.0; // Atoms can't be bonded to themselves
114114
double dfunc, val = switchingFunction.calculateSqr( mod2, dfunc );
115115
if( val<epsilon ) return 0.0;
116+
if( doNotCalculateDerivatives() ) return val;
116117
addAtomDerivatives( 0, (-dfunc)*distance, myvals );
117118
addAtomDerivatives( 1, (+dfunc)*distance, myvals );
118119
addBoxDerivatives( (-dfunc)*Tensor(distance,distance), myvals );

0 commit comments

Comments
 (0)