RE: how to get cell vectors in tcl forces script

From: Cosseddu, Salvatore (S.M.Cosseddu_at_warwick.ac.uk)
Date: Thu Mar 13 2014 - 13:11:01 CDT

Hi Hongbo,

Unfortunately, my impression is that the difference between max and min coordinates does not necessarily return the cell vectors, although it might represent a sufficient approximation in some cases. However a loop in tcl over all the atoms coordinates might be computational expensive depending on the size of the system.

Regards
Salvatore M Cosseddu
________________________________________
From: owner-namd-l_at_ks.uiuc.edu <owner-namd-l_at_ks.uiuc.edu> on behalf of Hongbo Du <hongbodu_at_uark.edu>
Sent: 13 March 2014 16:32
To: namd-l_at_ks.uiuc.edu
Subject: RE: namd-l: how to get cell vectors in tcl forces script

Hi, Thomas,

I think you can read out all the coordinates in the cell by command loadcoords and use a loop to find out the maximal and minimal coordinates in x,y,z direction to determine you cell vector.
By the way, the TCLforces is slow because it is running on one core. If you want to speed up, you may try TCLBC.

Best wishes,

Hongbo
_______________________________________
From: owner-namd-l_at_ks.uiuc.edu [owner-namd-l_at_ks.uiuc.edu] on behalf of Norman Geist [norman.geist_at_uni-greifswald.de]
Sent: Thursday, March 13, 2014 8:34 AM
To: 'Thomas Evangelidis'
Cc: Namd Mailing List
Subject: AW: namd-l: how to get cell vectors in tcl forces script

And no error cause of unknown command? You may not “set output lala” only do “output lala” as single line.

Norman Geist.

Von: Thomas Evangelidis [mailto:tevang3_at_gmail.com]
Gesendet: Donnerstag, 13. März 2014 12:12
An: Norman Geist
Cc: Namd Mailing List
Betreff: Re: namd-l: how to get cell vectors in tcl forces script

Just to update you, I tried to use the "output" command within the tcl forces script but no file is written, although namd is running.

On 12 March 2014 16:59, Norman Geist <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>> wrote:
You need to try. The “output” command will just write a set of restarts with the specified name, so hitting:

output test

should result in the following files being created:

test.coor
test.vel
test.xsc

The question is just if the „output“ command is available within TclForces.

Norman Geist.

Von: Thomas Evangelidis [mailto:tevang3_at_gmail.com<mailto:tevang3_at_gmail.com>]
Gesendet: Mittwoch, 12. März 2014 15:27
An: Cosseddu, Salvatore
Cc: Norman Geist; namd-l_at_ks.uiuc.edu<mailto:namd-l_at_ks.uiuc.edu>
Betreff: Re: namd-l: how to get cell vectors in tcl forces script

Hi Norman & Salvatore,
I also thought about reading in the .xsc file but that would slow down the simulation. Fortunately, the cell vectors do not change drastically - and precision is
 unnecessary in my case- therefore lowering too much restartfreq is not needed.
Norman can you give an example of using the output command within a jobscript file? I don't understand how you can write restart files more frequently than restartfreq does.
thanks,
Thomas

On 12 March 2014 16:01, Cosseddu, Salvatore <S.M.Cosseddu_at_warwick.ac.uk<mailto:S.M.Cosseddu_at_warwick.ac.uk>> wrote:

Hi Norman,

This is what I usually do, I set restartfreq conveniently. To be honest I don't know either about "output" command within tclforces.

Best wishes

Salvatore M Cosseddu

________________________________
From: Norman Geist <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>>
Sent: 12 March 2014 12:54
To: Cosseddu, Salvatore

Cc: Namd Mailing List
Subject: AW: namd-l: how to get cell vectors in tcl forces script

Yes, I mean I don’t know if the “output” command works from TclForces. He need to try, otherwise he would have to set the restartfreq suitable for his needs.

Norman Geist.

Von: owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu> [mailto:owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu>] Im Auftrag von Cosseddu, Salvatore

Gesendet: Mittwoch, 12. März 2014 13:06
An: Namd Mailing List
Betreff: RE: namd-l: how to get cell vectors in tcl forces script

Dear Norman and Thomas,

It works also within tclforces. You must be ready to a slight loss of performance for the additional I/O work. Anyway the following procedure has been tested and have worked fine for me since version 2.8. Hope it will help

------------------------------------

proc readcell {xscfile} {

    if {[catch {open "${xscfile}" r} xsc]} {
        puts stderr "ERROR opening ${xscfile}
CHECK!!!"
        exit 1
    }

    set in [read $xsc]
    set bcell [list [lindex $in 28] [lindex $in 32] [lindex $in 36]]
    print "readcell: read cell, at step [lindex $in 27] was $bcell"
    close $xsc
    return $bcell
}

-------------------------------------

simply usage:

set boxcell [readcell <xsc filename>]

Best regards

Salvatore M Cosseddu

________________________________
From: owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu> <owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu>> on behalf of Norman Geist <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>>
Sent: 12 March 2014 07:29
To: 'Thomas Evangelidis'
Cc: Namd Mailing List
Subject: AW: namd-l: how to get cell vectors in tcl forces script

Hi,

I was also searching for such a command, but the only way you are currently able to do it, seems to be using the “output” command to write a set of restarts and read the box info out of the xsc file. No idea if this is also possible within TclForces, but its working from jobscript context. Also, just to mention it, the only way currently to “set” the box during simulation is by loading dcd frames with the “coorfile” command.

Norman Geist.

Von: owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu> [mailto:owner-namd-l_at_ks.uiuc.edu<mailto:owner-namd-l_at_ks.uiuc.edu>] Im Auftrag von Thomas Evangelidis
Gesendet: Dienstag, 11. März 2014 21:14
An: namd-l
Betreff: namd-l: how to get cell vectors in tcl forces script

Dear NAMD community,
Is it possible to get the current unit cell vectors on the fly from within a tcl forces script?

--
======================================================================
Thomas Evangelidis
PhD student
University of Athens
Faculty of Pharmacy
Department of Pharmaceutical Chemistry
Panepistimioupoli-Zografou
157 71 Athens
GREECE
email: tevang_at_pharm.uoa.gr<mailto:tevang_at_pharm.uoa.gr>
          tevang3_at_gmail.com<mailto:tevang3_at_gmail.com>
website: https://sites.google.com/site/thomasevangelidishomepage/YqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=5d98c6e35dba17bc655283ca91ba5417cbc8de3343554c80b38b67b088ada2a2>
________________________________
[http://static.avast.com/emails/avast-mail-stamp.png]<https://urldefense.proofpoint.com/v1/url?u=http://www.avast.com/&k=t8cWouLHMWKnKZhAFQUeVA%3D%3D%0A&r=4316ESJbOFwuhrgpq0bMQK5q7D1UmD%2BPxLwbvJ1mBjs%3D%0A&m=nHgpswtGas7Mwe7zYqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=81eb81e31907817d195c982cdb849d5b2da887679fbe2c74952a874dbf9310b8>
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus<https://urldefense.proofpoint.com/v1/url?u=http://www.avast.com/&k=t8cWouLHMWKnKZhAFQUeVA%3D%3D%0A&r=4316ESJbOFwuhrgpq0bMQK5q7D1UmD%2BPxLwbvJ1mBjs%3D%0A&m=nHgpswtGas7Mwe7zYqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=81eb81e31907817d195c982cdb849d5b2da887679fbe2c74952a874dbf9310b8> Schutz ist aktiv.
--
======================================================================
Thomas Evangelidis
PhD student
University of Athens
Faculty of Pharmacy
Department of Pharmaceutical Chemistry
Panepistimioupoli-Zografou
157 71 Athens
GREECE
email: tevang_at_pharm.uoa.gr<mailto:tevang_at_pharm.uoa.gr>
          tevang3_at_gmail.com<mailto:tevang3_at_gmail.com>
website: https://sites.google.com/site/thomasevangelidishomepage/YqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=5d98c6e35dba17bc655283ca91ba5417cbc8de3343554c80b38b67b088ada2a2>
--
======================================================================
Thomas Evangelidis
PhD student
University of Athens
Faculty of Pharmacy
Department of Pharmaceutical Chemistry
Panepistimioupoli-Zografou
157 71 Athens
GREECE
email: tevang_at_pharm.uoa.gr<mailto:tevang_at_pharm.uoa.gr>
          tevang3_at_gmail.com<mailto:tevang3_at_gmail.com>
website: https://sites.google.com/site/thomasevangelidishomepage/YqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=5d98c6e35dba17bc655283ca91ba5417cbc8de3343554c80b38b67b088ada2a2>
________________________________
[http://static.avast.com/emails/avast-mail-stamp.png] <https://urldefense.proofpoint.com/v1/url?u=http://www.avast.com/&k=t8cWouLHMWKnKZhAFQUeVA%3D%3D%0A&r=4316ESJbOFwuhrgpq0bMQK5q7D1UmD%2BPxLwbvJ1mBjs%3D%0A&m=nHgpswtGas7Mwe7zYqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=81eb81e31907817d195c982cdb849d5b2da887679fbe2c74952a874dbf9310b8>
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus<https://urldefense.proofpoint.com/v1/url?u=http://www.avast.com/&k=t8cWouLHMWKnKZhAFQUeVA%3D%3D%0A&r=4316ESJbOFwuhrgpq0bMQK5q7D1UmD%2BPxLwbvJ1mBjs%3D%0A&m=nHgpswtGas7Mwe7zYqdIDVOhSzcYTtGswVRCZYD%2FIcM%3D%0A&s=81eb81e31907817d195c982cdb849d5b2da887679fbe2c74952a874dbf9310b8> Schutz ist aktiv.

This archive was generated by hypermail 2.1.6 : Wed Dec 31 2014 - 23:22:14 CST