diff --git a/src/colvarvalue.cpp b/src/colvarvalue.cpp index 0a7223d9e..d03708b07 100644 --- a/src/colvarvalue.cpp +++ b/src/colvarvalue.cpp @@ -663,6 +663,8 @@ colvarvalue colvarvalue::dist2_grad(colvarvalue const &x2) const { colvarvalue::check_types(*this, x2); + // Compute derivative with respect to (*this) + switch (this->value_type) { case colvarvalue::type_scalar: return 2.0 * (this->real_value - x2.real_value);