Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Consolidate clearing of eflags and vflags #1365
Note: Purpose of the PR changed as per Comment #1
When applying flags at the start of a compute call, most pair styles only clear some of the flags. There is a function ev_unset that clears all flags, but that is rarely used.
This PR replaces the shared pattern with a central function that clears all flags.
Sebastian Hütter (OvGU)
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
No functional changes (hopefully!).
Post Submission Checklist
Please check the fields below as they are completed after the pull request has been submitted. Delete lines that don't apply
@martok pair->compute(0,0) is called quite frequently, e.g. during MD with fixed volume or minimization, when there is no thermo output or other access to energies. That not all pair styles call ev_unset() must be for historical reasons, i.e. the manual clearing of those flags must have been used until somebody, probably @sjplimp decided to consolidate it, but then did not apply it everywhere for reasons unknown. The difference, that I is that
So, if we are consolidating it now, we should be doing it now all the way. I am assigning @sjplimp to this PR so he can keep an eye on it and give further advice.
Edit: Actually, almost nothing uses
OTOH, this would mean we'd get instances of this exact code segment everywhere:
if (eflag || vflag) ev_setup(eflag,vflag); else ev_unset();
I'd prefer a function for that.