potential energy changed when read atoms position from data file

Dear Lammps users,

I used lammps (1Nov2013) to calculate equlibrium cohesive energy and lattice constant of bcc iron using FeCuNi potential(G. Bonny, R.C. Pasianot, L. Malerba and N. Castin Phylos. Mag. 89 (2009) 3531) at two different cases:

1- I used built-in lattice builder in lammps (create _atom, create_box…etc) and I got correct value of cohesive energy.

2- I used external tool to create data file with the same no of atoms and same equlibrium lattice constant but I got different value of cohesive energy.

I noticed also when I slightly change (xlo-xhi, ylo-yhi and zlo-zhi) in the data file I got diffent values of Ecoh.

any explaination would be appreciated.

Kind Regards
Tamer

in.surface1 (1.07 KB)

Fe.dat (60.1 KB)

Dear Lammps users,

I used lammps (1Nov2013) to calculate equlibrium cohesive energy and lattice
constant of bcc iron using FeCuNi potential(G. Bonny, R.C. Pasianot, L.
Malerba and N. Castin Phylos. Mag. 89 (2009) 3531) at two different cases:

1- I used built-in lattice builder in lammps (create _atom,
create_box.....etc) and I got correct value of cohesive energy.

2- I used external tool to create data file with the same no of atoms and
same equlibrium lattice constant but I got different value of cohesive
energy.

I noticed also when I slightly change (xlo-xhi, ylo-yhi and zlo-zhi) in the
data file I got diffent values of Ecoh.

how different is "different"?

have you checked whether the coordinates that you read in are actually
identical to what LAMMPS generates for what you expect to be the same
initial configuration. in other words, have you written out two dump
files and compared them properly?

axel.

As Axel mentioned, the coordinates generated by LAMMPS' "lattice"
and "create_atoms" commands are probably not identical to the
coordinates generated by the 3rd-party software you are using. The
easiest way I know to compare them is to use the "write_data" command
to print the x,y,z coordinates of the atoms into a new data file.
(You can do this right after you create the atom coordinates using the
"create_atoms 1 region whole" command before you minimize the system.)
Then compare the coordinates in this data file with the coordinates
in the file generated by your 3rdparty software (Fe.dat).

http://lammps.sandia.gov/doc/write_data.html

The rest of this email you can skip
Cheers

Andrew

# Suppose you have two different data files "file1.data", "file2.data"
# One automatic way to extract the coordinates (without using a text editor)
# is to use a combination of awk and "extract_lammps_data.py" (attached)

extract_lammps_data.py Atoms < file1.data \
     > awk '{print $3" "$4" "$5}' > coords1.dat

extract_lammps_data.py Atoms < file2.data \
     > awk '{print $3" "$4" "$5}' > coords2.dat

#(I assume you are using "atom_style atomic".
# If you use "atom_style full", then use this instead:
# {print $5" "$6" "$7}

# You can find the RMS difference between the coordinate sets using:

paste -d' ' coords1.dat coords2.dat > coords.dat

awk '{sum+=($1-$4)**2+($2-$5)**2+($3-$6)**2; n++}
       END{print sqrt(sum/n)}' < coords.dat

Cheers

Andrew

extract_lammps_data.py (4.25 KB)

    As Axel mentioned, the coordinates generated by LAMMPS' "lattice"
and "create_atoms" commands are probably not identical to the
coordinates generated by the 3rd-party software you are using. The
easiest way I know to compare them is to use the "write_data" command
to print the x,y,z coordinates of the atoms into a new data file.
(You can do this right after you create the atom coordinates using the
"create_atoms 1 region whole" command before you minimize the system.)
Then compare the coordinates in this data file with the coordinates
in the file generated by your 3rdparty software (Fe.dat).

http://lammps.sandia.gov/doc/write_data.html

The rest of this email you can skip
Cheers

Andrew

# Suppose you have two different data files "file1.data", "file2.data"
# One automatic way to extract the coordinates (without using a text editor)
# is to use a combination of awk and "extract_lammps_data.py" (attached)

extract_lammps_data.py Atoms < file1.data \
     > awk '{print $3" "$4" "$5}' > coords1.dat

extract_lammps_data.py Atoms < file2.data \
     > awk '{print $3" "$4" "$5}' > coords2.dat

oops, sorry. I forgot to sort by atom-ID numbers.
(Two data files might not have atoms in the same order.)
Here's the correction:

extract_lammps_data.py Atoms < file1.data \
      > sort -g | awk '{print $3" "$4" "$5}' > coords1.dat

extract_lammps_data.py Atoms < file2.data \
      > sort -g | awk '{print $3" "$4" "$5}' > coords2.dat

I doubt anyone will try this. I just have having errors in my posts.
In any case, this could all probably be done more elegantly in
pizza.py (http://pizza.sandia.gov).

Thanks Axel and Andrew. Indeed the atoms coordinates created by 3rd-party software are not identical with those generated by lammps, I should try something else.

Cheers