uchicago-voth / cgmap

Simple fine-grained to coarse-grained molecular dynamics mapping code
Apache License 2.0
6 stars 4 forks source link

how can I dump the .lammpstrj file with force information included #4

Closed pky0204 closed 4 years ago

pky0204 commented 4 years ago

Hi,

I am using lammps to run the full-atomistic simulation and then trying to use cgmap to get the mapped CG trajectory. When the output is .lammpstrj, it only contains the x,y,z coordinates, no forces information on the mapped CG beads. Is there a way to do it?

pakles commented 4 years ago

Hello @pky0204 , thank you for your interest in our code. You will have to make 2 changes. The first is to use the "dump custom" style in LAMMPS to print out the force fields (fx, fy, fz), in addition to atom index, type, and cartesian coordinates. When using cgmap, you will also need to use a custom version of mdtraj - found here: https://github.com/uchicago-voth/mdtraj. This version of mdtraj correctly parses the custom force fields and will also print out the CG mapped trajectory with forces.

pky0204 commented 4 years ago

Thanks a lot! It solved my problem.

pakles commented 4 years ago

Glad to hear :)