dump angular velocity for calculating rotational density of state

Dear LAMMPS Users

I want to calculate the rotational density of state of water molecules by using Fast Fourier Transform Methods. For that, I need calculate the angular velocity for each water molecule. I am using SPCE rigid water model with atom style full.

By searching our previous lammps email list. I found the following commands (marked in red color)might be applied to calculate the angular velocity.And, I want to print the information for each atom in dump file.But the error occurs as below. I would like to know whether the chunk/atom is correct to calculate the angular velocity.If so,how can I OUTPUT the angular velocity information for each water atoms in dump file.

I am grateful for any suggestions and help.

partial input:

group surface1 type 4
group water type 1 2
group surface2 type 3

#velocity water create $T 72489 rot yes dist gaussian

fix 1 water shake 0.0001 20 0 b 1 a 1
fix 2 water nve

fix 3 surface1 rigid/nve single langevin $T $T 100.0 2784 force 1 off off off torque 1 off off off
fix 4 surface2 rigid/nve single langevin $T $T 100.0 2784 force 1 off off off torque 1 off off off

compute cc1 water chunk/atom molecule
compute mychunk water angmom/chunk cc1

thermo_style custom step v_time press pe ke
thermo 5

dump 1 water custom 5 dump.water id type c_cc1[1] c_cc1[2] c_cc1[3]

ERROR: Dump custom compute does not calculate per-atom array (…/dump_custom.cpp:1232)

Thank you very much

Bai

Hello Bai, the error message is the most important part here, as usual:

ERROR: Dump custom compute does not calculate per-atom array (…/dump_custom.cpp:1232)

Dump will expect a vector that is as long as there are atoms, not as long as there are chunks. Please look at e.g. fix ave/chunk to output the result a chunk-based compute onto a file.

Giacomo

Dear Giacomo,

As you suggested,I was trying to calculate the angular velocity by using below commands.It still takes error.

compute cc1 water chunk/atom molecule
compute mychunk water angmom/chunk cc1

fix 5 water ave/chunk 50 1 50 cc1 c_mychunk[1] c_mychunk[2] c_mychunk[3] file tmp.mom
ERROR: Fix ave/chunk compute does not calculate per-atom values (…/fix_ave_chunk.cpp:274)

And I wanna made my questions more clear,since you looks like not get my points.

1.Exact command to calculate angular velocity for water molecules.

As suggested by Dr.Axel in lammps previous email list,I choose compute chunk/atom angmom/chunk to perform this calculation. As my understanding,the angmom/chunk is used to calculate the angular momentum rather than angular velocity.

  1. print angular velocity for each atom of water molecule,as I want to substitute these information to Fast Fourier Transform equation to get rotational density of state.

Actually,I am not sure Whether it is possible to print angular velocity for each chunk with each atom. I have treated each water molecule as a chunk.But I want to print each atom in water molecule along with atom index ID.For that, I was trying to use “dump” to output(As previously, I was succeed using dump to print velocity vector information without adding any "compute"related commands).

  1. dump and fix/chunk

If I use fix ave/chunk,it’s not possible print angular velocity along with atom index ID.As I need use Fourier Transform angular velocity auto-correlation function,the atom(molecule) angular velocity corresponding index id should be printed.

I am eager to get some explanation about my confounded problem above.

Thank you very much

Best Regards

Bai

Hi Liyi, it’s very much possible that I am still not getting your point(s). While I do have some additional suggestions, I’ll refrain from writing them to avoid causing more confusion.

I presume that you refer to Axel’s email:
https://sourceforge.net/p/lammps/mailman/message/36178968/
where one of Axel’s suggestions to you was the following:

​nobody can help you unless you describe in a comprehensible way what it is
exactly, that you want to ​do. so far, you are giving the impression that
you don't really know yourself what that is.

Dear LAMMPS Users

I want to calculate the rotational density of state of water molecules by
using Fast Fourier Transform Methods. For that, I need calculate the
angular velocity for each water molecule. I am using SPCE rigid water model
with atom style full.

By searching our previous lammps email list. I found the following
commands (marked in red color)might be applied to calculate the angular
velocity.And, I want to print the information for each atom in dump
file.But the error occurs as below. I would like to know whether the *
chunk/atom* is correct to calculate the angular velocity.If so,how can I
OUTPUT the angular velocity information for each water atoms in dump file.

I am grateful for any suggestions and help.

*partial input:*

group surface1 type 4
group water type 1 2
group surface2 type 3

#velocity water create $T 72489 rot yes dist gaussian

fix 1 water shake 0.0001 20 0 b 1 a 1
fix 2 water nve

fix 3 surface1 rigid/nve single langevin $T $T 100.0 2784 force 1
off off off torque 1 off off off
fix 4 surface2 rigid/nve single langevin $T $T 100.0 2784 force 1
off off off torque 1 off off off

compute cc1 water chunk/atom molecule
compute mychunk water angmom/chunk cc1

thermo_style custom step v_time press pe ke
thermo 5

dump 1 water custom 5 dump.water id type c_cc1[1] c_cc1[2]
c_cc1[3]

*ERROR:* Dump custom compute does not calculate per-atom array
(../dump_custom.cpp:1232)

​you *cannot* output a per-chunk information using a method (dump custom)
that is meant to output per-atom data.
instead, i urge you to pay better attention to the documentation which does
explain this and gives examples all over the place. for example, the
compute angmom/chunk documentation contains the following:

The simplest way to output the results of the compute angmom/chunk
calculation to a file is to use the fix ave/time
<http://lammps.sandia.gov/doc/fix_ave_time.html> command, for example:

compute cc1 all chunk/atom molecule
compute myChunk all angmom/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector

*Output info:*

This compute calculates a global array where the number of rows = the
number of chunks *Nchunk* as calculated by the specified compute chunk/atom
<http://lammps.sandia.gov/doc/compute_chunk_atom.html> command. The number
of columns = 3 for the 3 xyz components of the angular momentum for each
chunk. These values can be accessed by any command that uses global array
values from a compute as input. See Section 6.15
<http://lammps.sandia.gov/doc/Section_howto.html#howto-15> for an overview
of LAMMPS output options.

​RT*M rulez!

axel.​

Dear Dr.Axel,

Thank you very much for kindly suggestion. Actually, I am struggling to find out the way to “DUMP” the angular velocity of water.So I made previous stupid mistake.
Now I switch to use below command line for performing the angular velocity calculation and output info using fix ave/time.

I am meant to calculate the angular velocity for each molecule.I have N water molecules in simulation box, so it should be have Nchunk. But it only print one chunk angular velocity for each time period.

I am wonder if I can print angular velocity for each chunk (each water molecule ).From the output file,it looks like I have took all the water molecules as one chunk.Could you give me any suggestion to figure it out?

input lines:

compute cc1 all chunk/atom molecule
compute myChunk all omega/chunk cc1
fix 5 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector

partial output information in tmp.out

Time-averaged data for fix 5

TimeStep Number-of-rows

Row c_myChunk[1] c_myChunk[2] c_myChunk[3]

0 1
1 -3.09502e-07 8.41514e-07 -1.14551e-06
100 1
1 -2.71675e-06 -9.49113e-08 -3.73511e-07
200 1
1 -6.32119e-07 -6.29203e-07 -4.16946e-08
300 1
1 1.21609e-06 6.76206e-07 7.1096e-07
400 1
1 -1.23215e-06 2.58847e-07 -4.37827e-07

Thank you very much

Bai

Dear Dr.Axel,

Thank you very much for kindly suggestion. Actually, I am struggling to
find out the way to "DUMP" the angular velocity of water.So I made previous
stupid mistake.
Now I switch to use below command line for performing the angular velocity
calculation and output info using fix ave/time.

I am meant to calculate the angular velocity for each molecule.I have N
water molecules in simulation box, so it should be have Nchunk. But it
only print one chunk angular velocity for each time period.

I am wonder if I can print angular velocity for each chunk (each water
molecule ).From the output file,it looks like I have took all the water
molecules as one chunk.Could you give me any suggestion to figure it out?

do your molecules actually have different molecule ids.
LAMMPS will do exactly what you ask it to do. if it doesn't do that, this
usually means that you didn't ask for it correctly, or didn't provide the
proper input.
how to do things correctly is documented in the manual and testing and
sorting out how things work require careful reading of the documentation,
as i have just proven to you.

the conclusion of that is:
- if you can convincingly prove that LAMMPS is *not* doing precisely what
is says in the documentation (and saying "i don't get what i want is no
proof"!), then me or some other LAMMPS developer will carefully check it
out and - if needed - either correct the documentation or the code.
- otherwise, it is your job to figure out how to tell LAMMPS correctly what
you want it to do. how is in the documentation, it may take a little more
effort than you have invested so far to sort this out. it may also need
some construction of simple test cases to follow what the LAMMPS
documentation says it does. people here don't have the time to do this for
you. this is what the LAMMPS documentation is so extensive and so detailed.
it should be sufficient to figure things out on your own.

axel.