/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
GMX_ASSERT(restraint_, "Restraint must be initialized.");
- const auto& mdatoms = forceProviderInput.mdatoms_;
- GMX_ASSERT(mdatoms.homenr >= 0, "number of home atoms must be non-negative.");
+ const int homenr = forceProviderInput.homenr_;
+ GMX_ASSERT(homenr >= 0, "number of home atoms must be non-negative.");
const auto& box = forceProviderInput.box_;
GMX_ASSERT(check_box(PbcType::Unset, box) == nullptr, "Invalid box.");
const auto& cr = forceProviderInput.cr_;
const auto& t = forceProviderInput.t_;
// Cooperatively get Cartesian coordinates for center of mass of each site
- RVec r1 = sites_[0].centerOfMass(cr, static_cast<size_t>(mdatoms.homenr), x, t);
+ RVec r1 = sites_[0].centerOfMass(cr, static_cast<size_t>(homenr), x, t);
// r2 is to be constructed as
// r2 = (site[N] - site[N-1]) + (site_{N-1} - site_{N-2}) + ... + (site_2 - site_1) + site_1
// where the minimum image convention is applied to each path but not to the overall sum.
// a big molecule in a small box.
for (size_t i = 0; i < sites_.size() - 1; ++i)
{
- RVec a = sites_[i].centerOfMass(cr, static_cast<size_t>(mdatoms.homenr), x, t);
- RVec b = sites_[i + 1].centerOfMass(cr, static_cast<size_t>(mdatoms.homenr), x, t);
+ RVec a = sites_[i].centerOfMass(cr, static_cast<size_t>(homenr), x, t);
+ RVec b = sites_[i + 1].centerOfMass(cr, static_cast<size_t>(homenr), x, t);
// dr = minimum_image_vector(b - a)
pbc_dx(&pbc, b, a, dr);
r2[0] += dr[0];