Output of center of mass

Hi,

A quick question, I want Lammps to calculate the conter of mass a single polymer chain in order to calculate the diffusion of this polymer chain.
my question is how do I output the data file?

Below is my script:

#3d electrophoresis

1. create wall

units lj
dimension 3
atom_style bond
#atom_style hybrid charge bond
boundary p p f
neighbor 0.4 bin
neigh_modify every 1 delay 1

read_data data.newdata1chain
#read_data data.chain
#read_restart randomizedpolymer.DNA

bond_style fene
bond_coeff 1 30 1.5 1.0 1.0
special_bonds fene

#create geometry

lattice fcc 6.33 orient x 1 -2 1 orient y 1 0 -1 orient z 1 1 1
region Simbox block 0 100 0 100 0 100

#atom regions

region stripe1 block 0 30 0 3 6 6.5 #units lattice
region stripe2 block 0 30 3.1 6 6 6.5 #units lattice
region stripe3 block 0 30 6.1 9 6 6.5 #units lattice
region stripe4 block 0 30 9.1 12 6 6.5 #units lattice
region stripe5 block 0 30 12.1 15 6 6.5 #units lattice
region stripe6 block 0 30 15.1 18 6 6.5 #units lattice

create_atoms 2 region stripe1
create_atoms 2 region stripe3
create_atoms 2 region stripe5
create_atoms 3 region stripe2
create_atoms 3 region stripe4
create_atoms 3 region stripe6

group wall-low type 2
group wall-high type 3
group wall union wall-low wall-high
group moving type 1

#L-J potential
pair_style lj/cut 2.7
pair_modify shift yes

pair_coeff * * 1 1
pair_coeff 1 2 1.2 1
pair_coeff 1 3 1.5 1

2.initial velocities

fix 5 wall setforce 0 0 0
fix 6 all nve
fix 7 moving langevin 1 1 10 61
fix topWall all wall/harmonic zhi EDGE 50 100 40

Run

timestep 0.003
thermo 100

set group moving image 0

compute 1 moving com/molecule

dump 3 all xyz 100 1chainstripes.xyz

run 1000000

Best,
Chao

Hi,

A quick question, I want Lammps to calculate the conter of mass a single
polymer chain in order to calculate the diffusion of this polymer chain.
my question is how do I output the data file?

please read the documentation of the command and in addition:
http://lammps.sandia.gov/doc/Section_howto.html#howto_15

the result of the compute is stored in a global array,
so you can access it through an equal style variable
and use fix print for example or access the compute
directly as "thermo" output.

axel.

Hello, Alex,

I still have some problems. when I use ‘dump 4 moving local 100 data.centerofmassstripes c_1’ command to dump data of center of mass which is generated from “compute”, Lammps says: ERROR: Dump local compute does not compute local info (dump_local.cpp:301)…

when I use “custom”, it says Dump custom compute does not compute per-atom info.

Chao

Hello, Alex,

I still have some problems. when I use 'dump 4 moving local 100
data.centerofmassstripes c_1' command to dump data of center of mass which
is generated from "compute", Lammps says: ERROR: Dump local compute does not
compute local info (dump_local.cpp:301)...

when I use "custom", it says Dump custom compute does not compute per-atom
info.

both is the correct and expected behavior.
the mistake is on your side and and if you
re-read what i wrote before, you'll see that
i suggested neither of these methods.

axel.

If I use variable and fix print, I don’t need “compute com” any more, right?

If I use variable and fix print, I don't need "compute com" any more, right?

why not?
you were talking about "compute com/molecule", not "compute com".

axel.

I though variable command says that it has a function of calculating displacement and velocity of center of mass. so it can replace “compute”
I’m using compute com/molecule, and I dont know how to access those value by variable and print them out by fix…I’ve read the doc but I still cannot figure it out. Would you mind explain it in detail? as well as “thermo_style”?

I though variable command says that it has a function of calculating
displacement and velocity of center of mass. so it can replace "compute"
I'm using compute com/molecule, and I dont know how to access those value by
variable and print them out by fix...I've read the doc but I still cannot
figure it out. Would you mind explain it in detail? as well as

all i could say is written down in the documentation.
it is concise and gives examples. try those examples
and learn and see. this is no rocket science and it
will be easier, if you don't assume anything. if you
don't get it by reading the documentation, then you
need to read it again (and again). and experiment.

i don't have the time to explain things differently,
that are already explained well.

axel.

"thermo_style"?

read

The com/molecule compute produces "global" info which
can't be dumped at all. It can be output with thermo, or
used by fix ave/time to output it. Read about global vs peratom
vs local in 6.15 of the manual.

Steve