I have a system made of multiple polymer chains around 100. Each chains is made of 200 atoms. I know that the pe/chain can be computed using compute pe/atom then summing pe of each atom in the chain. my problem is that my system is mode 100 chains and lammps only allows for 23 groups to be created and the compute/pe command is as follow “compute ID group-ID pe/atom keyword …”. How Can i do it for more than 23 chains.
I have a system made of multiple polymer chains around 100. Each chains is
made of 200 atoms. I know that the pe/chain can be computed using compute
pe/atom then summing pe of each atom in the chain. my problem is that my
system is mode 100 chains and lammps only allows for 23 groups to be created
and the compute/pe command is as follow "compute ID group-ID pe/atom keyword
...". How Can i do it for more than 23 chains.
ideally, we would have a compute style reduce/chunk for that in
LAMMPS. i am currently working on that. i am surprised it hasn't come
up before.
for your specific case, i can think of two ways to work around this by
making use of features, that were not primarily designed for this. one
should require a rather new version of LAMMPS, the other should also
work with somewhat older versions. i am basing these on the micelle
example in the LAMMPS distribution, which has 150 molecules (each with
3 atoms).
version 1:
compute mol all chunk/atom molecule
compute pe all pe/atom
fix emol all ave/chunk 500 1 500 mol c_pe norm none
ave one file pe-per-mol.dat
version 2:
compute pe all pe/atom
variable idx loop 150
print "compute emol all reduce sum &" file comp.list screen no
print "thermo_style custom step &" file thermo.list screen no
label mols
variable pe${idx} atom (mol==\{idx\}\)\*c\_pe
print "v\_pe{idx} &" append comp.list screen no
print "emol[${idx}] " append thermo.list screen no
next idx
jump SELF mols
print "c_pe" append comp.list screen no
include comp.list
print "pe ke temp" append thermo.list screen no
include thermo.list
I have a system made of multiple polymer chains around 100. Each chains is
made of 200 atoms. I know that the pe/chain can be computed using compute
pe/atom then summing pe of each atom in the chain. my problem is that my
system is mode 100 chains and lammps only allows for 23 groups to be created
and the compute/pe command is as follow “compute ID group-ID pe/atom keyword
…”. How Can i do it for more than 23 chains.
Version 1 of what Axel wrote is the way to do it
in current LAMMPS. Fix ave/chunk can sum
any per-atom property over the atoms in each chunk
(chunk = molecule in your case).
ideally, we would have a compute style reduce/chunk for that in
LAMMPS. i am currently working on that. i am surprised it hasn’t come
up before.
If you wanted the max PE in any chain, then the
variable command can do this, with functions like
max(), min(), sum(), ave(), using the output from fix ave/chunk
as the arguments of those functions. These are analogous