[lammps-users] Set Command

Good day,

For a group named Wall1 containing 1344 atoms and using the set command as shown below I would be grateful if anyone can clarify if the command sets the charge value of 0.02e for the group as one entity (group charge = 0.02e) or does it set the charge value of 0.02e for each and every atom in the group (group charge = 0.02e x 1344 atoms)

set group wall1 charge 0.02e

Thank you very much.

Best regards,
Justice

Three comments,

a) the final argument should be 0.02 and not 0.02e. 0.02e is accepted by chance because it will be interpreted as 0.02e0, i.e. 2.0e-2
b) the answer to that should be found in the documentation. if the documentation is ambiguous, you should point out where that is, so it can be improved
c) as a computational scientist it should be common practice to confirm yourself that your input produces the system and settings you expect. In this case you could just output the charges of those atoms with a custom style write_dump command before and after the set command and confirm what is done by LAMMPS.

Especially c) is something that should be always done in some shape or form, since all software can have bugs and you want to make certain that commands work correctly and according to your understanding of the documentation.Otherwise, it can too easily happen that you get unpleasant surprises and can find out that you wasted a lot of time on bogus simulations. Those are not always obvious, but the differences can be subtle and then it can become quite embarrassing, too.

Hi Axel,

c is a pretty straightforward way to confirm, I have just tried it. Thanks for the advice.

Regards,
Justice