From: William Ray (ray.29_at_osu.edu)
Date: Thu Sep 27 2012 - 14:21:31 CDT

Ugh - I wish I could get this to compile so that I could be more helpful, but:

Is it possible that the implementation of Molecule::addPersistentForce() is part of the problem?

Specifically, at the bottom, where it's doing:

      persistent_force_indices.remove(ind);
      persistent_force_vectors.remove(3*ind );
      persistent_force_vectors.remove(3*ind+1);
      persistent_force_vectors.remove(3*ind+2);

If I'm reading ResizeArray.h properly, that trio trying to remove the persistent force vectors won't work as I believe it's intended to, because the ResizeArray class shifts everything left when an element is removed.

I don't see how this results in forces remaining present when all are removed, since it ought to slaughter them all regardless of whether it randomizes them a bit while doing it, but it explain some bizarre behavior I noticed when deleting individual atom forces when multiples have been added - sometimes a different force will suddenly change magnitude or direction - which I'd previously attributed to the difficulty in making a precise click in the mouse-mode interface.