generating average structure at the end of simulation

Hi,
      I have 2 queries.

1. How can I generate structure with averaged atomic positions at the end of my simulation. (Like I run my system for 30 ps using NVT and I want to average out atomic position for last 10 ps in the final structure). currently, I am dumping out the structures at certain intervals. One way could be just take the last few structures and have a code to do the average. Is there any command in LAMMPS to do this?

2. It is kind of an extension to my previous question. When structure is symmetric around (0,0,0); I am having trouble converting dump file to new structure file. As dump with xyz option generates fractional coordinates for between 0 to 1. Any easier way to convert them to structure file with full coordinates. I am thinking of having a code that will map 0,0,0 to min and 1,1,1 to max of the symmetric structure (which is in the dump file) and then convert each coordinate accordingly. Does this sound ok or there is a better method already?

Please let me know.

Thanks
Priyank

Hi,
      I have 2 queries.

1. How can I generate structure with averaged atomic positions at the
end of my simulation. (Like I run my system for 30 ps using NVT and I
want to average out atomic position for last 10 ps in the final
structure). currently, I am dumping out the structures at certain
intervals. One way could be just take the last few structures and have a
code to do the average. Is there any command in LAMMPS to do this?

that is better done in post-processing.
since the coordinates of immediately succeeding
time steps a highly correlated, there is little
use in sampling positions more often than once
every picosecond (are you _sure_ that your system
is well equilibrated after only 20ps of simulation time?).

depending on what kind of a structure you have,
you may first do a fit/alignment of the structure
to minimize errors from overall drift and rotations.

2. It is kind of an extension to my previous question. When structure is
symmetric around (0,0,0); I am having trouble converting dump file to
new structure file. As dump with xyz option generates fractional
coordinates for between 0 to 1. Any easier way to convert them to

please have a closer look at the dump command
and particular the dump_modify command, which
allows to select whether coordinates are written
scaled or absolute (and wrapped or unwrapped).

structure file with full coordinates. I am thinking of having a code
that will map 0,0,0 to min and 1,1,1 to max of the symmetric structure
(which is in the dump file) and then convert each coordinate
accordingly. Does this sound ok or there is a better method already?

if you write in the right format and use a tool
like VMD or Pizza.py to read/process your data,
you won't have to worry about this.

Please let me know.

please let yourself know. the LAMMPS manual
discusses many things that you have asked.

cheers,
    axel.

Hi Priyank,
Regarding your first question, I wrote a separate postprocessing code to do something similar, essentially reading in the dump file and sorting through a series of several dumps. The only difference is I took the median positions, rather than average positions. At least for my domain, the median better approximates the mode than the average does. If you are looking for the long-time residence position, it should be the mode.

Jonathan

Fix ave/atom will store time averaged coords, which can then
be dumped.

Steve

Thanks Steve,
                          I tried that but I am unable to dump/print the averaged co-ordinates. here is my input script (where I tried fix ave/time and dump with ad without custom)

Read about the difference bewteen scalars, vectors, and arrays
(from the LAMMPS perspective) in 4.15 of the manual. You can't
dump a scalar, and you can't dump an array. You need
something like

dump min all custom 8 avgstr.dump f_3[1] f_3[2] ...

Steve