Hey, On a general note, assuming the frame is read in as a t_trxframe structure called frame, the box is accessible as frame.box and is a matrix instance, which means it's a 3x3 array, containing the triclinic box as a lower triangular matrix. If the code says t_trxframe *frame somewhere, rather than t_trxframe frame, then you need to access the box as frame->box in stead of frame.box. You can find both in different gromacs tools.
Cheers, Tsjerk On Thu, Dec 8, 2011 at 2:46 PM, Mark Abraham <mark.abra...@anu.edu.au> wrote: > On 9/12/2011 12:00 AM, Chandan Choudhury wrote: > > > On Thu, Dec 8, 2011 at 12:33 PM, Mark Abraham <mark.abra...@anu.edu.au> > wrote: >> >> On 8/12/2011 2:54 PM, Chandan Choudhury wrote: >> >> Thanks everyone for the responses. I should have framed my question much >> more precisely. I am trying to use the template.c code of (gmx_4.0.7) and >> within this, I want to take care of PBC. To do this, I should be having the >> knowledge of box dimensions. How can this done? >> >> >> Check out the code of g_bond or g_dist to see how to get access to the box >> information from the trajectory, and how that might be used. Note that it's >> important to get the data from the trajectory frame rather than the .tpr >> when the former varies, and I am not sure that the code of those tools does >> this correctly at the moment, or in 4.0.7 (see >> http://redmine.gromacs.org/issues/834). >> >> Mark > > > Thanks Mark for the response. I did look at the code of g_hbond and > g_dist. Truly speaking, I couldnot decode any information from it. > > > Search the text for the variables "box" and "pbc" and see how they > interact... Key here is to recognize that MD trajectories are normally too > large to slurp into memory and then do operations on, so the code has to be > structured to work on the trajectory frame by frame. > > > Actually, I dont have such a broad knowledge in C. > > > That's all the more reason to proceed by analogy from working code, rather > than try to write something from scratch. > > > Can some one point me out what functions/variables should be called in > template.c (gmx_4.0.7) to obtain the box vectors. > > > That's as hard as writing the code oneself... we don't even know that the > reason you want to get these vectors at C level is worth writing C code > for... > > Mark > > > > Chandan >> >> >> >> >> I also know that the g_energy prints the box vector with the simulation >> time. But, trjconv -dump also writes the box vectors in the pdb file. >> >> Chandan >> >> -- >> Chandan kumar Choudhury >> NCL, Pune >> INDIA >> >> >> On Thu, Dec 8, 2011 at 3:33 AM, Mark Abraham <mark.abra...@anu.edu.au> >> wrote: >>> >>> On 8/12/2011 4:36 AM, Chandan Choudhury wrote: >>>> >>>> >>>> Dear gmx_users, >>>> >>>> I am using gmx_4.0.7. I need to print the box vectors from the >>>> trajectory of a simulated system. How can this be achieved? Can someone >>>> help >>>> me out? >>> >>> >>> g_energy on the .edr file (assuming that the vectors actually vary). >>> >>> Mark >>> >>> -- >>> gmx-users mailing list gmx-users@gromacs.org >>> http://lists.gromacs.org/mailman/listinfo/gmx-users >>> Please search the archive at >>> http://www.gromacs.org/Support/Mailing_Lists/Search before posting! >>> Please don't post (un)subscribe requests to the list. Use the www >>> interface or send it to gmx-users-requ...@gromacs.org. >>> Can't post? Read http://www.gromacs.org/Support/Mailing_Lists >> >> >> >> >> >> >> -- >> gmx-users mailing list gmx-users@gromacs.org >> http://lists.gromacs.org/mailman/listinfo/gmx-users >> Please search the archive at >> http://www.gromacs.org/Support/Mailing_Lists/Search before posting! >> Please don't post (un)subscribe requests to the list. Use the >> www interface or send it to gmx-users-requ...@gromacs.org. >> Can't post? Read http://www.gromacs.org/Support/Mailing_Lists > > > > > > > -- > gmx-users mailing list gmx-users@gromacs.org > http://lists.gromacs.org/mailman/listinfo/gmx-users > Please search the archive at > http://www.gromacs.org/Support/Mailing_Lists/Search before posting! > Please don't post (un)subscribe requests to the list. Use the > www interface or send it to gmx-users-requ...@gromacs.org. > Can't post? Read http://www.gromacs.org/Support/Mailing_Lists -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands -- gmx-users mailing list gmx-users@gromacs.org http://lists.gromacs.org/mailman/listinfo/gmx-users Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/Search before posting! Please don't post (un)subscribe requests to the list. Use the www interface or send it to gmx-users-requ...@gromacs.org. Can't post? Read http://www.gromacs.org/Support/Mailing_Lists