[lammps-users] the command of the center's of mass for the molecule in the system

Dear lammps users and developers,I want to calculate the coordinates of the centers of mass for the molecules in a system.
I use the com commands 1. " compute 1 all com" or “compute 1 all com/molecule”
2. “dump 1 all custom 50 com.txt”

but I didn’t receive the correct answer. Can anyone tell me which command to use to calculate the coordinates of COM for the molecules (not atoms) and get the output?
Best Regards

This is not a well posed question and thus very difficult to provide a meaningful answer.
please see https://lammps.org/guidelines.html for some guidelines to post better formulated and presented questions in the future.

  • you don’t mention the LAMMPS version you are using and the platform you are running on. that is crucial information.
  • the commands you quoted either make no sense (“compute com” computes the global center of mass for the compute group, i.e. all so it cannot give you what you are asking for.)
    or they don’t exist in a current/recent version of LAMMPS (“compute com/molecule” has been replaced a long time ago)
    or they cannot work (“dump 1 all custom 50 com.txt” will (rightfully) stop with an error that you have not specified which properties to output)
  • you say that you didn’t receive the correct answer, but you don’t explain how you determined that or provide a simple example input deck demonstrating it.
  • you don’t confirm that your input and data file are consistent with using molecule IDs to group atoms and to determine their center of mass.

for quite some time now LAMMPS has used the “chunk mechanism” as outlined here https://docs.lammps.org/Howto_chunk.html
to compute and output these kinds of properties. i.e. you use compute chunk/atom to assign atoms to chunks matching the molecule IDs, then you can use compute com/chunk to compute the center of mass of those, and then use fix ave/chunk to output them.