[lammps-users] regarding gyration

Hello everyone,

I ran about 100 chains in my simulations (in Jan 2009 version) .
And i like to calculate the average of gyration of molecules.
When i use as follows

group mol1 molecule <> 1 100
fix 1 mol1 gyraton 10000 rg.out

When i get the results, i found that lammps consider mol1 as a molecule, and the gyration is for mol1.

How can i calculate the average gyration of each molecule?

Thanks in advance


Upgrade the newest version of LAMMPS, and you can do something like this:

compute calcrg poly gyration/molecule #makes vector of all the Rgs
compute rgave poly reduce ave c_calcrg #averages the values in the vector
fix outrg poly ave/time 1000 1 1000 c_rgave file averg.out #prints the average Rg


Hello, Lisa,
I will do it.


i did the work as you suggested. However, i found some problems.

The command i used like:

group poly molecule <> 1 100
compute calcrg poly gyration/molecule
compute rgave poly reduce ave c_calcrg
fix outrg poly ave/time 100 1 100 c_rgave file tmp1.dat
compute calcrg1 poly gyration/molecule
fix outrg1 poly ave/time 1000 1 1000 c_calcrg1 &
    mode vector file tmp2.dat

I added your commands (slightly modified, see above) to bench/in.chain and
looked at the two output files: tmp1.dat and tmp2.dat. They
are in good agreement. One has the ave value, about 5, the other
has a spread of values from about 4 to 6. So I'm not
seeing the kind of issue you discuss. Are you running the most
current version of LAMMPS?


Sorry. I made a mistake in my file.
It is OK now.

Thanks & Best wishes