Project

General

Profile

Feature #871

request for trjconv -box to allow modification of only one or two dimensions

Added by Chris Neale over 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Difficulty:
uncategorized
Close

Description

It would be nice if trjconv -box -1 -1 14 would modify the z-axis to 14 nm but leave the x and y axes as they are. This could be useful in the following way. I have already made my own modified version of trjconv to do this, but other users may be interested.

I desire to center a lipid bilayer along z to make a movie or do analysis (e.g. g_density), but since the simulation used pressure coupling then the center of z actually changes from frame to frame. Thus, I could do this:

trjconv -center -pbc mol -f a.xtc -o b.xtc
trjconv -box -1 -1 20 -f b.xtc -o c.xtc (note that I selected 20 as larger than the z in any frame)
trjconv -center -pbc none -f c.xtc -o d.xtc

In the second trjconv line above, I used -1 to indicate that I didn;t want to change these dimensions.

I can now use d.xtc to make a movie in which the bilayer appears to remain with a constant Center of mass along z. (Note that this would still not really be true unless you have already modified trjconv -center to act on the center of mass instead of (max-min)/2 , but again I already have my own modified version of trjconv to do that.

Thank you,
Chris.

Associated revisions

Revision f99217aa (diff)
Added by Rossen Apostolov over 3 years ago

Allow trjconv to keep some box dimensions unchanged.

Giving -1 to option box will preserve the original box size
for the given dimension.

Fixes #871.

Change-Id: I339aedcf09da8ecb4eb8f32e8057f953a21e0f5f

History

#1 Updated by Roland Schulz about 5 years ago

Chris Neale wrote:

I have already made my own modified version of trjconv to do this, but other users may be interested.

Could you upload your patch to gerrit.gromacs.org?

#2 Updated by Chris Neale over 4 years ago

Sorry, I am not sure how to use gerrit.gromacs.org.

I replaced the following code that starts at line 1149 in gmx_trjconv.c from version 4.5.3:

if (bSetBox) {
/* generate new box */
clear_mat(fr.box);
for (m=0; m<DIM; m++)
fr.box[m][m] = newbox[m];
}

with the new code:

if (bSetBox) {
/* generate new box */
clear_mat(fr.box);
for (m=0; m<DIM; m++)
if(newbox[m]>=0)
fr.box[m][m] = newbox[m];
}

#3 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #871.
Uploader: Rossen Apostolov ()
Change-Id: Ib761796ebc7a1fa77c894dbd447400ab09677417
Gerrit URL: https://gerrit.gromacs.org/3494

#4 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #871.
Uploader: Rossen Apostolov ()
Change-Id: I339aedcf09da8ecb4eb8f32e8057f953a21e0f5f
Gerrit URL: https://gerrit.gromacs.org/3495

#5 Updated by Rossen Apostolov over 3 years ago

applied to 5-0 since it's new feature

#6 Updated by Rossen Apostolov over 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#7 Updated by Rossen Apostolov over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF