From: William Ray (ray.29_at_osu.edu)
Date: Thu Sep 27 2012 - 15:13:03 CDT

And, I think I might have it?

Molecule.C : get_new_frames()

Where it's trying to decide if there were forces applied in the previous timestep that need to be cancelled in this one:

    for(ii=0; ii<last_force_indices.num(); ii++) {
      int j;
      int index_missing=1;
      for (j=0; j<force_indices.num(); j++) {
        if (force_indices[j]==last_force_indices[ii]) {
          index_missing=0;
          break;
        }
      }
      if (index_missing) {
        // this one didn't show up this time
        zero_force_indices.append(force_indices[j]);
        zero_forces.append(0);
        zero_forces.append(0);
        zero_forces.append(0);
      }
    }

I'm pretty sure that

 zero_force_indices.append(force_indices[j]);

should actually be

 zero_force_indices.append(last_force_indices[ii]);

If I understand correctly, the intent is to accumulate appropriate last_force_indices when they're not present in the current force_indices array.

If you have multiple forces being deleted however, the current code will append the same current (force_indices[j]) index to the zero_force_indices array, for every now-missing force.

It's possible this works with a single atom selection, because both indices are serendipitously zero?

... wish I could make this compile! I feel like a complete dolt trying to debug from the source alone.