This is part of the generic module |
Dump masses and charges on a selected file.
This command dumps a file containing charges and masses. It does so only once in the simulation (at first step). File can be recycled in the driver tool.
Notice that masses and charges are only written once at the beginning of the simulation. In case no atom list is provided, charges and masses for all atoms are written.
ATOMS | the atom indices whose charges and masses you would like to print out. For more information on how to specify lists of atoms see Groups and Virtual Atoms |
STRIDE | ( default=1 ) the frequency with which the atoms should be output |
FILE | file on which to output charges and masses. |
ONLY_MASSES | ( default=off ) Only output masses to file |
ONLY_CHARGES | ( default=off ) Only output charges to file |
You can add the DUMPMASSCHARGE action at the end of the plumed.dat file that you use during an MD simulations:
c1: COM ATOMS=1-10 c2: COM ATOMS=11-20 DUMPATOMS ATOMS=c1,c2 FILE=coms.xyz STRIDE=100 DUMPMASSCHARGE FILE=mcfile
In this way, you will be able to use the same masses while processing a trajectory from the driver . To do so, you need to add the –mc flag on the driver command line, e.g.
plumed driver --mc mcfile --plumed plumed.dat --ixyz traj.xyz
With the following input you can dump only the charges for a specific group.
solute_ions: GROUP ATOMS=1-121,200-2012 DUMPATOMS FILE=traj.gro ATOMS=solute_ions STRIDE=100 DUMPMASSCHARGE FILE=mcfile ATOMS=solute_ions
Notice however that if you want to process the charges with the driver (e.g. reading traj.gro) you have to fix atom numbers first, e.g. with the script
awk 'BEGIN{c=0}{ if(match($0,"#")) print ; else {print c,$2,$3; c++} }' < mc > newmc }'
then
plumed driver --mc newmc --plumed plumed.dat --ixyz traj.gro