[lammps-users] How to output temp/chunk data

Hi, everyone
I am using temp/chunk command to calculate per chunk temperature during an impact process.
My compute command is

compute c0 sample chunk/atom bin/1d z lower 6.6 units box
compute Stemp sample temp/chunk c0 temp com yes

In the manual, I found that temp/chunk command calcutates a global scalar (the temperature) and a global vector of length 6 (KE tensor) and also optionally calculates a global array, if one or more of the optional values are specified.
My question is how to output the temp data of every chunk in every N steps to a file? I want to output the data like this style:

ChunkID Temp

1 300
2 300
3 300

Is it possible and how to do? I have tried some ways but not successful.
Thank you with best regards.
Yuntian Wang
PhD student of Sichuan Universiy

what ways have you tried?

there is an example how to output the results of compute temp/chunk with fix ave/time and that works very well.
for “fix 1 all ave/time 100 1 100 c_Stemp file tmp.out mode vector”

you’ll get something like this:

Time-averaged data for fix 1

TimeStep Number-of-rows

Row c_Stemp

0 6
1 0
2 0
3 0
4 0
5 0
6 0
100 6
1 13.7715
2 14.4281
3 14.6712
4 -0.0281865
5 0.37811
6 0.0399736

i.e. timestep number and number of chunks followed by Nchunk number of lines with chunk number and temperature. here shown for timesteps 0 and 100

axel.

Dear Dr Axel,
Sorry for that, I am not using the mailing list very well.

I have tried your as your suggestion and get some results like you provided.

Time-averaged data for fix 2

TimeStep Number-of-rows

Row c_Stemp

0 6
1 400.35
2 393.64
3 400.894
4 -2.9475
5 0.63814
6 5.83513
100 6
1 455.786
2 448.843
3 562.389
4 -2.61164
5 -3.40383
6 -1.25168
I found that there are only 6 rows in each step, and I have more than 6 chunks in the system. My test system is about 150A at z direction and divided in chunks every 5A. There should be 30 chunks at least. Is there anyway to output all the chunks in the system? Or I have used a wrong command to calculate chunks?
I hope to output every chunk temp like this format, I dont’t know if it is possible.
timestep0
chunk1 300
chunk2 300

chunkN 300
timestep1

chunk1 300
chunk2 300

chunkN 300

Here is the input command
lattice fcc 3.3 origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region sim_box block 0 10 0 10 0 50 units lattice

compute c0 sample chunk/atom bin/1d z lower 6.6 units box
compute Stemp sample temp/chunk c0 temp com yes
fix 2 all ave/time 100 1 100 c_Stemp file tmp.out mode vector

Thank you.
Regards
Yuntian Wang

On 2/22/2021 18:58,Axel Kohlmeyer[email protected] wrote:

the example that I quoted from the documentation was outdated. compute temp/chunk has since been changed so it can compute multiple properties (up to 6) and thus you have to specifically request which one to output. so the fix command has to be:

fix 2 all ave/time 100 1 100 c_Stemp[1] file tmp.out mode vector

i’ll see that the documentation is updated.
Axel.

Dear Axel,
Thank you so much for helping me solve this.
Regards
Yuntian Wang

On 2/22/2021 20:43,Axel Kohlmeyer[email protected] wrote:

Dear Sir,
In mode scalar I am getting 6 output for c_stemp[*] type of fix as mentioned in above mail. While in mode vector same is giving 3 values in output file. I have selected only 3 values (temp, kecom, internal) during compute command.
What is the issue?

problem 1) i understand your question. there is not enough information here and i don’t have a crystal ball to see what you see but don’t tell us.
problem 2) you don’t say what you expect as output and what part of the documentation of compute temp/chunk this is based on. from what I see, the documentation is saying what the compute does and I see the output with fix ave/time that should be there, for mode scala and mode vector.
it was just that the example I quoted previously needed to be updated.