Dear Lammps users,
I defined a dynamic group in the input. I calculated the peoperty of a dynamic group and oupt put it by
“fix ave/time 10 100 1000”, however I would like to normalize it by the number of atoms in the group.
I wonder how to get the number of atoms or total number of atoms during the simulation.
Thanks
You could define an equal style variable where you have access to either property and pass that to your ave/time fix.
The property I was trying to calculate is the force between two groups and I would like to normalize the force by the number of atoms in the group. I defined two groups : one is a dyanmic group defined by region and another one is a static group. then I compute the force between those two groups and count the number of atoms in the dynamics group, finally I output the force and number by fix ave/time. I used below commands to do so.
group trapped_ion dynamic sodium region Region_trapped_ion every 10
compute friction_ion0 trapped_ion group/group water kspace yes
variable num_na equal count(trapped_ion)
fix 16 all ave/time 10 100 1000 c_friction_ion0 c_friction_ion0[1] c_friction_ion0[2] c_friction_ion0[3] v_num_na file friction_ion0.txt
I got the decimal number for the force and the number of atoms. I don’t understand why the number of atoms is a decimal number. Correspondingly, I don’t understand what does the force mean as well. For example, if the force is 0.5 and the number of atoms is 0.2. Does it mean the force/per atom is 0.5/0.2=2.5?
Thanks
You don’t understand what you are doing at all, yet you are using complex commands without thinking through what they do. For example: why should a property that is an average over a variable (integer) property also be an integer?
I don’t know how to help you if you cannot understand this.