VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Sat Nov 14 2015 - 09:51:58 CST
- Next message: Arash Azari: "Re: Error (incompatible tcl8.5.so) when installing VMD plugins"
- Previous message: Axel Kohlmeyer: "Re: Error (incompatible tcl8.5.so) when installing VMD plugins"
- In reply to: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Next in thread: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Reply: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Tristan,
Hmm, I had thought we also had an existing scheme to set them, but
I may be remembering something that had been a hack/prototype and not in
the production versions of VMD. I'm out of town at the annual Supercomputing
conference until next Friday, but when I get back to the lab I would be happy
to look into this more closely. In the mean time, I'd suggest you keep
playing around with the code.
Cheers,
John
On Sat, Nov 14, 2015 at 04:55:11AM +0000, Tristan Croll wrote:
> OK, if I understand correctly (which is entirely possible - my knowledge of C++ remains quite fuzzy), the uf[xyz] variables are effectively just read-outs of the forces being applied in IMD. In GeometryMol.C we have:
>
> 00148 if (ts != NULL) {
> 00149 if (ts->force != NULL) {
> 00150 float ufx = ts->force[ind*3 ];
> 00151 float ufy = ts->force[ind*3 + 1];
> 00152 float ufz = ts->force[ind*3 + 2];
> 00153 totalforce = sqrtf(ufx*ufx + ufy*ufy + ufz*ufz);
> 00154 }
>
> which is what sets them, but they don't go back in the other direction. Meanwhile, in Molecule.C we have
>
> 00132 // If an IMD simulation is in progress, store the forces in the current
> 00133 // timestep and send them to the simulation. Otherwise, just toss them.
> 00134 if (app->imd_connected(id())) {
> 00135 // Add persistent forces to regular forces
> 00136 force_indices.appendlist(&persistent_force_indices[0], persistent_force_indices.num());
> 00137 force_vectors.appendlist(&persistent_force_vectors[0], persistent_force_vectors.num());
> 00138
> 00139 // Clear old forces out of the timestep
> 00140 Timestep *ts = current();
> 00141 if (ts && ts->force) {
> 00142 memset(ts->force, 0, 3*nAtoms*sizeof(float));
> 00143 }
>
> The forces that actually get applied to the simulation are wiped and re-calculated each timestep, re-setting uf[xyz] in the process. So at present it doesn't seem possible to apply forces to a simulation from TCL.
>
> Cheers,
>
> Tristan
>
> ________________________________________
> From: Tristan Croll
> Sent: Saturday, 14 November 2015 2:20 PM
> To: John Stone
> Cc: vmd-l_at_ks.uiuc.edu
> Subject: Re: vmd-l: Re: namd-l: On-the-fly modification of tclforces script?
>
> Hi John,
>
> Looks like I should clarify that. $sel set ufx works exactly as expected in a static molecule, or in an IMD simulation that has been prepped but is not yet connected to NAMD. The moment I connect to NAMD the command stops doing anything, even if the simulation is paused.
>
> Thanks,
>
> Tristan
>
> ________________________________________
> From: Tristan Croll
> Sent: Saturday, 14 November 2015 1:24 PM
> To: John Stone
> Cc: vmd-l_at_ks.uiuc.edu
> Subject: Re: vmd-l: Re: namd-l: On-the-fly modification of tclforces script?
>
> Hi John,
>
> Essentially, I'm just looking for a neat way to force specific configurations within the context of a running IMD simulation. For example, to force a section of backbone into a helix, or to induce a specific rotamer. I want to be able to do this on-the-fly, without stopping and generating a new simulation configuration, hence the need for a scripted approach.
>
> The uf[xyz] keywords seem ideal in principle, but I can't seem to set them through the TCL interface. The following commands:
>
> set sel [atomselect top "residue 1"]
> $sel set ufx 1
> $sel get ufx
>
> don't throw any errors, but the last command returns an array of zeros. The get command works correctly when I manually apply forces with the mouse, but as far as I can see set currently does nothing for these keywords.
>
> Thanks,
>
> Tristan
>
> ________________________________________
> From: John Stone <johns_at_ks.uiuc.edu>
> Sent: Saturday, 14 November 2015 12:17 PM
> To: Tristan Croll
> Cc: Jim Phillips; namd-l_at_ks.uiuc.edu; vmd-l_at_ks.uiuc.edu
> Subject: Re: vmd-l: Re: namd-l: On-the-fly modification of tclforces script?
>
> Okay. Try uf[xyz] and let me know if you need something different to
> achieve whatever it is you're after.
>
> Cheers,
> John
>
> On Sat, Nov 14, 2015 at 01:28:39AM +0000, Tristan Croll wrote:
> > Only in the fact that I was ignorant of their existence, by the looks of things. Well, that makes life easier...
> >
> >
> >
> > Tristan Croll
> > Lecturer
> > Faculty of Health
> > School of Biomedical Sciences
> > Institute of Health and Biomedical Engineering
> > Queensland University of Technology
> > 60 Musk Ave
> > Kelvin Grove QLD 4059 Australia
> > +61 7 3138 6443
> >
> > This email and its attachments (if any) contain confidential information intended for use by the addressee and may be privileged. We do not waive any confidentiality, privilege or copyright associated with the email or the attachments. If you are not the intended addressee, you must not use, transmit, disclose or copy the email or any attachments. If you receive this email by mistake, please notify the sender immediately and delete the original email.
> >
> >
> >
> > > On 14 Nov 2015, at 11:05 am, John Stone <johns_at_ks.uiuc.edu> wrote:
> > >
> > > Tristan,
> > > Since I don't have much context from the prior discussion, how does this
> > > differ from setting ufx/ufy/ufz in VMD?
> > >
> > > Cheers,
> > > John
> > >
> > >> On Sat, Nov 14, 2015 at 12:14:28AM +0000, Tristan Croll wrote:
> > >> Something like:
> > >>
> > >> imd impulse <mol> <index> <force vector>
> > >>
> > >> as a simple wrapper for addForce would add a lot of flexibility.
> > >>
> > >> Cheers,
> > >>
> > >> Tristan
> > >>
> > >>
> > >> ________________________________________
> > >> From: Tristan Croll
> > >> Sent: Saturday, 14 November 2015 8:48 AM
> > >> To: Jim Phillips; namd-l_at_ks.uiuc.edu; Tristan Croll
> > >> Cc: vmd-l_at_ks.uiuc.edu
> > >> Subject: Re: namd-l: On-the-fly modification of tclforces script?
> > >>
> > >> Hi again,
> > >>
> > >> Before seriously getting into this, I'm thinking it would be more elegant (and long-term useful) to make Molecule::addforce (from Molecule.C) available as a TCL command in VMD. On the downside, the added forces would have to be calculated (or at least re-applied) at each step in VMD, but on the plus side there's no file i/o involved. What do you think?
> > >>
> > >> Thanks,
> > >>
> > >> Tristan
> > >>
> > >> ________________________________________
> > >> From: owner-namd-l_at_ks.uiuc.edu <owner-namd-l_at_ks.uiuc.edu> on behalf of Tristan Croll <tristan.croll_at_qut.edu.au>
> > >> Sent: Wednesday, 11 November 2015 8:03 AM
> > >> To: Jim Phillips; namd-l_at_ks.uiuc.edu
> > >> Subject: Re: namd-l: On-the-fly modification of tclforces script?
> > >>
> > >> Thanks Jim. I'll start tinkering with that.
> > >>
> > >> ________________________________________
> > >> From: Jim Phillips <jim_at_ks.uiuc.edu>
> > >> Sent: Wednesday, 11 November 2015 1:53 AM
> > >> To: namd-l_at_ks.uiuc.edu; Tristan Croll
> > >> Subject: Re: namd-l: On-the-fly modification of tclforces script?
> > >>
> > >> Hi Tristan,
> > >>
> > >> In NAMD 2.11b1 you can do the following:
> > >>
> > >> tclForces on
> > >> tclForcesScript {
> > >> }
> > >> startup
> > >> while ( 1 ) {
> > >> clearconfig ; # drop previously requested atoms
> > >> source forcescript.tcl
> > >> run 200
> > >> }
> > >>
> > >> The main function of the tclForcesScript is to delay tclForces setup until
> > >> after startup has progressed far enough to process atom lookup commands.
> > >> You can give it /dev/null or an inline script with at least one newline as
> > >> above. I could make tclForcesScript optional, but I think keeping it
> > >> mandatory results in clearer error messages for new users.
> > >>
> > >> The "startup" command is like "run 0" without the force calculation, so it
> > >> won't notice that you haven't defined a calcforces proc. Without the
> > >> "startup" command you would need to do this:
> > >>
> > >> tclForces on
> > >> tclForcesScript {
> > >> proc calcforces {} { }
> > >> }
> > >> run 0
> > >> .
> > >>
> > >> Note that in 2.11b1 if you want total forces on atoms/groups you need to
> > >> explicitly request them. For backwards compatibility use "catch":
> > >>
> > >> tclForces on
> > >> tclForcesScript {
> > >> catch { enabletotalforces }
> > >> proc calcforces {} { }
> > >> }
> > >>
> > >> Also, since you're hoping to push updates from VMD, you at least need to
> > >> use an atomic filesystem operation like rename to update forcescript.tcl
> > >> so NAMD doesn't see an incomplete file, or you could use sockets. For an
> > >> example see the file lib/replica/namd_replica_server.tcl in NAMD 2.8.
> > >>
> > >> Jim
> > >>
> > >>
> > >>> On Tue, 10 Nov 2015, Tristan Croll wrote:
> > >>>
> > >>> Hi all,
> > >>>
> > >>>
> > >>> I'm looking for a way to add some more complex interactions to interactive MD simulations (e.g. to force a defined group of atoms into a particular conformation). Preferably I'd like to be able to do this on-the-fly without having to restart the simulation. Would an approach something like the following in the NAMD configuration file work?
> > >>>
> > >>>
> > >>> tclForces on
> > >>>
> > >>>
> > >>> while {1} {
> > >>>
> > >>> tclForcesScript forcescript.tcl
> > >>>
> > >>> run 200
> > >>>
> > >>> }
> > >>>
> > >>>
> > >>> .. with forcescript.tcl being modified/replaced as necessary from within VMD?
> > >>>
> > >>>
> > >>> Thanks,
> > >>>
> > >>>
> > >>> Tristan
> > >
> > > --
> > > NIH Center 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/
>
> --
> NIH Center 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/
-- NIH Center 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/
- Next message: Arash Azari: "Re: Error (incompatible tcl8.5.so) when installing VMD plugins"
- Previous message: Axel Kohlmeyer: "Re: Error (incompatible tcl8.5.so) when installing VMD plugins"
- In reply to: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Next in thread: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Reply: Tristan Croll: "Re: Re: namd-l: On-the-fly modification of tclforces script?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]