From: John Stone (johns_at_ks.uiuc.edu)
Date: Sun Sep 30 2012 - 16:50:11 CDT

William,
  I'm a bit swamped working on something else currently, but I will
make time to look at this next week after I get past a couple of deadlines.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Sep 27, 2012 at 04:13:03PM -0400, William Ray wrote:
>
>
> 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.
>
>
>
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/       Fax: 217-244-6078