computeVirial_(computeVirial),
shiftForces_(shiftForces) {}
- //! Returns a, deprecated, rvec pointer to the force buffer
- rvec *f()
+ //! Returns an arrayref to the force buffer without padding
+ gmx::ArrayRef<gmx::RVec> force()
{
- return as_rvec_array(force_.paddedArrayRef().data());
+ return force_.unpaddedArrayRef();
+ }
+
+ //! Returns a const arrayref to the force buffer without padding
+ gmx::ArrayRef<const gmx::RVec> force() const
+ {
+ return force_.unpaddedConstArrayRef();
}
//! Returns whether the virial needs to be computed
return shiftForces_;
}
+ //! Returns a const shift forces buffer
+ gmx::ArrayRef<const gmx::RVec> shiftForces() const
+ {
+ return shiftForces_;
+ }
+
private:
//! The force buffer
gmx::ArrayRefWithPadding<gmx::RVec> force_;
forceWithShiftForces_(forceWithShiftForces),
forceWithVirial_(forceWithVirial) {}
- //! Returns a, deprecated, rvec pointer to the force buffer for use with shift forces
- rvec *f()
+ //! Returns a reference to the force with shift forces object
+ ForceWithShiftForces &forceWithShiftForces()
{
- return forceWithShiftForces_.f();
+ return forceWithShiftForces_;
}
//! Returns a reference to the force with virial object