minimize command

Dear all
I have a query about minimization of energy for LJ system.I want to get the minimized energy for every dump step that means the time evolution of minimized energy using conjugate gradient technique.In Lammps I have used the following command

minimize 1.0e-4 1.0e-6 100 1000
min_style cg

But it writes the minimized energy in the output log file only at once.I want to get the minimized energy at every snap.How can i get it?
Looking forward for reply.
Thanks in advance.

The dump and thermo commands should set the frequency
of output, just as they do for dynamics.

Steve

It sounded to me like Atreyee wants to perform a minimization on every
frame in the trajectory.

If so, then the "rerun.sh" script I posted earlier could be used to do
that. (I'm attaching rerun.sh to this post as well.)

The "rerun.sh" script I'm posting here is just a for-loop which
extracts frames from a dump file and runs a short lammps simulation on
each frame. Here is the syntax:

rerun.sh LMP_BINARY NEW_IN \
    DATA_FILE [auxfile1 auxfile2 ...] \
    < DUMP_FILE

---- Output ----
If you have a trajectory with 100 frames (for example) this will
generate a 100 directories:

rerun_frame1/
rerun_frame2/
:
rerun_frame100/

----- Input arguments -----

Here "LMP_BINARY" is the name of the LAMMPS binary you are using. (In
my case it is "lmp_ubuntu".)

The file "IN_NEW" in this examples contains the commands you want to
use in each of these simulations. In Atreyee's case, he should put a
"minimize" command in this file.

(If you need additional files to run the simulation (eg, aux_file1,
aux_file2), these must follow the DATA_FILE argument.)

The DUMP_FILE has to have the correct format. It can't be a DCD file.
As an example of the correct dump file format, I have been using this
command:

dump 1 all custom 500 DUMP_FILE id mol type x y z ix iy iz

(As Steve said, you will probably want to increase the write interval "500")

---- for loops ----

rerun.sh creates many directories. Of coarse, Atreyee would then have
to write a shell-script containing a for-loop which visits every
directory and extracts the number he wants from each one (representing
minimized energy). Of course, it would be something like:

#!/bin/sh
NUM_FRAMES=100
for ((i=1; i <= "NUM\_FRAMES&quot;; i\+\+\)\); do &nbsp;&nbsp;&nbsp;PRINT\_THE\_DESIRED\_NUMBER \\ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt; rerun\_frame{i}/OUTPUT_FILE \
     >> minimized_energy.dat
done

This solution is reasonably general. There may be a much easier way
to do what Atreyee wants. (If so, post it!)

(I don't mean to be promoting this script. It is not something I'm
particularly proud of. This is just a quick script which I use. If it
is a good example to show someone else how to write a similar
post-processing script, then great. Perhaps there's also a way to do
this kind of post-processing using pizza.py. If that's the case, by
all means do it that way!)

Cheers!

Andrew

P.S. Alas I just realized that the "dump2data.py" file included with
rerun.sh has the same name as one of the pizza.py scripts. I hope
this does not cause any confusion.

rerun_2012-4-19.tar.gz (178 KB)