GROMACS version: 2022.4
Dear gromacs users,
I’m trying to center a micelle in the box after simulation, and the output is somehow not expected:
This is understandable becasue the COM of the micelle is located at the center of box, but it’s cut by box boundary as 2 parts.
I’ve tried 2 different approaches, but both of them result in the strucutre as described:
- gmx trjconv -s md.tpr -f md.gro -pbc mol -center
- a vmd tcl script:
package require pbctools
mol new "$file_name"
set sel [atomselect top "not resname SOL NAW CHL CA2"]
pbc wrap -center \$sel
set com [measure center \$sel weight mass]
set box [molinfo top get {a b c}]
set box_center [vecscale 0.5 \$box]
set translation_vector [vecsub \$box_center \$com]
set all [atomselect top "all"]
\$all moveby \$translation_vector
pbc wrap -all
animate write gro "$file_name"
These methods work adequately when the micelle’s final position is already near the box center. However, issues arise when the micelle is positioned close to the box boundary. I hope there’s a solution that can reliably handle both scenarios without requiring manual adjustment of the system prior to centering.
Please kindly help me if you have any ideas. Thank you.