Fix print issue

Dear LAMMPS users,

Hi,

I’m re-scaling my system every 10 step, i.e. step 10 20 30 40 etc., and I need to print at step 9 19 29 etc. I’m aware that there is a similar command in Dump option as dump_modify. But, there is no such command with fix print to the best of my knowledge. Moreover, following suggestion doesn’t work also:

fix 1 all npt temp 1 1 0.1 y 0 0 1.0 z 0 0 1.0 drag 0.3
fix 2 all deform 10 x erate 100 units box remap x
run 9

fix def1 all print 10 "{p1} {p2} {p3} {p4} {p5} {p6} {p7} {pp1} {pp2} {pp3} " file Final.dat screen no
run 1000

So, I wonder if you could please comment on it if there is any way except modifying the source code of LAMMPS.

Thanks,

Ali

Why does the suggestion not work? What does it do?

Because it print out step 10 20 30 40 etc … But, I want to have 9 19 29 39 etc

I suppose the easiest way will be to print every step, and then to post-process it (just one line of bash or awk or python)?

Right, I get the issue. I think the following would work. It’s ugly but it seems to work if I try it with a fix print and a normal print

fix 1 all npt temp 1 1 0.1 y 0 0 1.0 z 0 0 1.0 drag 0.3
fix 2 all deform 10 x erate 100 units box remap x
run 9 # To “Forward 9 steps”

print “{p1} {p2} {p3} {p4} {p5} {p6} {p7} {pp1} {pp2} {pp3}” file Final.d screen no

run 10000 every 10 “print ‘{p1} {p2} {p3} {p4} {p5} {p6} {p7} {pp1} {pp2} {pp3}’ append Final.d screen no”

However, I do not know if this is the most efficient way to go about it.

Stephan,

I really appreciate it. You really did a great help to me.

Sincerely,

Ali

Hi Stephan,

I’ve just realized that using fix deform the strain that is resulted in my system is different in the two below cases:

fix 1 all npt temp 1 1 0.1 y 0 0 1.0 z 0 0 1.0 drag 0.3

fix 22 all deform 10 x erate 100 units box remap x
fix def1 all print 10 “{p9} {p8} {p1} {p2} {p3} {p4} {p5} {p6}” file Final.dat screen no

run 100

fix 1 all npt temp 1 1 0.1 y 0 0 1.0 z 0 0 1.0 drag 0.3

fix 22 all deform 10 x erate 100 units box remap x
run 9

print "{p9} {p8} {p2} {p3} {p4} {p5} {p6} {p7} " file Final.dat screen no

run 100 every 10 “print '{p9} {p8} {p2} {p3} {p4} {p5} {p6} {p7} ’ append Final.dat screen no”

I wonder if you could please comment on it.
Thanks,
Ali

They should be different because they belong to different time steps I think. If they are statistically similar I would not worry about it too much. If you really want the data at the right time step then you should probably just write the information every time step and then use e.g. AWK to filter out the right time steps.

The difference is in the box length which is strange to me. in the two cases, the box length in x direction will be changed in step 10 and remain constant until step 20. The thing is step 10 of the first code and step 19 of the second one doesn’t have the same size which shouldn’t by logic. Is that so or I’m doing a mistake ?

Thanks,

Ali

I was expecting the output at steps 19 and 10 to be the same between the two inputs, but apparently they are not. I think at this rate it is easiest to just use the approach Julien suggested, unless someone else has a better idea.

Thanks Stephan. I didn’t receive any response from " Julien ". Did you ?

Ali