-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistent use of PBC functions in NAMD (NAMD-provided vs. internal?) #368
Comments
I second that NAMD should initialize |
@HanatoK Thinking more about this, I could probably dig up how to pass the However, I am not sure that even that would be safe. It is increasingly common to update the simulation frame via scripting commands (i.e. at any time) via commands like Can we perhaps (1) just check that the pointer is not Since most errors are caught at the first |
As for As for other cases that require an updated cell information every step, maybe it is better to pass the periodic cell to Colvars like other atomic information (such as forces and positions), and to use it as a CV. |
@HanatoK Alright, so the PBC functions are only used to compute a default value for So how about making |
Instead of calculating the default lambda value in the initialization of the components, this commit provides a negative value for it in the initialization, and then re-computes the lambda value if it is still non-positive in calc_value(). This commit can avoid the use and detection of the null pointer of the Lattice object at least in aspathCV and azpathCV.
Test
022_apathCV_distanceVec
fails in the current master. I traced it to the fact thatcolvarproxy_namd::position_distance()
falls back to the base-class method (i.e. the internal PBC functions) because the pointer to theLattice
pointer was uninitialized.This fall-back was added in commit e767b8d, but it relied implicitly on the internal PBC flag not being properly initialized (thus raising an error). Commit 33da0c9 now initializes such flag, and the error is raised.
I can fix this by letting the NAMD proxy initialize the PBC stuff before initializing the module (commit coming to
master
). But it would be more robust if we could avoid theif
conditional incolvarproxy_namd::position_distance()
altogether. @HanatoK any thoughts?Alternatively, we could avoid using the NAMD-provided PBC functions anyway and always initialize the internal ones. Possibly while also addressing #160 (although to be honest, when dealing with non-orthogonal unit cells I'd much rather use LAMMPS).
EDIT: a straight fix is not possible, again because the
GlobalMaster
class does not have a validlattice
pointer when initialized. At best, a change in the NAMD repo is required.The text was updated successfully, but these errors were encountered: