Calculation of coordination of atoms

Dear all,

I am trying to calculated a coordination of atoms forming
nanoparticles of various shapes. I would like to treat the problem
purely geometrically. As an example, I have tried to construct a
nanocube of gold atoms. This is my input:

units metal
boundary f f f

atom_style atomic
lattice fcc 4.0694
region box block 0 4 0 4 0 4
region gold block 1 3 1 3 1 3
create_box 1 box
create_atoms 1 region gold

compute coord all coord/atom 1.0 *
write_dump all custom coords.dat c_coord

When I run this simulation with lmp_serial command, I get a
segmentation fault error:

LAMMPS (28 Jun 2014)
Lattice spacing in x,y,z = 4.0694 4.0694 4.0694
Created orthogonal box = (0 0 0) to (16.2776 16.2776 16.2776)
  1 by 1 by 1 MPI processor grid
Created 63 atoms
Segmentation fault

and the file coords.dat is not even created. I have been trying to
find a solution to my problem, but unfortunately without any success.
I would greatly appreciate any help you can provide me on this topic.
Many thanks in advance,

David

PS: My aim is to use the coordination number to distinguish between
bulk and surface atoms, and for the surface atoms to get a feeling of
the number of broken bonds.

Dear all,

I am trying to calculated a coordination of atoms forming
nanoparticles of various shapes. I would like to treat the problem
purely geometrically. As an example, I have tried to construct a
nanocube of gold atoms. This is my input:

units metal
boundary f f f

atom_style atomic
lattice fcc 4.0694
region box block 0 4 0 4 0 4
region gold block 1 3 1 3 1 3
create_box 1 box
create_atoms 1 region gold

compute coord all coord/atom 1.0 *
write_dump all custom coords.dat c_coord

When I run this simulation with lmp_serial command, I get a
segmentation fault error:

LAMMPS (28 Jun 2014)
Lattice spacing in x,y,z = 4.0694 4.0694 4.0694
Created orthogonal box = (0 0 0) to (16.2776 16.2776 16.2776)
  1 by 1 by 1 MPI processor grid
Created 63 atoms
Segmentation fault

and the file coords.dat is not even created. I have been trying to
find a solution to my problem, but unfortunately without any success.
I would greatly appreciate any help you can provide me on this topic.

the compute needs access to a neighbor list, but since you have not
defined a pair style and didn't do at least a "run 0" to have at
least a basic MD setup done, your calculation will fail by trying to
access a nonexisting data structure.

axel.

Dear Axel,

Thanks for your hints. Unfortunately, I must be doing something else
wrong too, as my modified script

units metal
boundary f f f

atom_style atomic
lattice fcc 4.0694
region box block 0 4 0 4 0 4
region gold block 1 3 1 3 1 3
create_box 1 box
create_atoms 1 region gold

pair_style eam/alloy
pair_coeff * * Au-Grochola-JCP05.eam.alloy Au

neighbor 1.0 bin
neigh_modify delay 0

run 0

compute coord all coord/atom 2.0 *
write_dump all custom coords.dat c_coord

still yields the segmentation fault exactly when the write_dump
command is executed. Any more ideas? Many thanks for your patience.

David

Dear Axel,

Thanks for your hints. Unfortunately, I must be doing something else
wrong too, as my modified script

units metal
boundary f f f

atom_style atomic
lattice fcc 4.0694
region box block 0 4 0 4 0 4
region gold block 1 3 1 3 1 3
create_box 1 box
create_atoms 1 region gold

pair_style eam/alloy
pair_coeff * * Au-Grochola-JCP05.eam.alloy Au

neighbor 1.0 bin
neigh_modify delay 0

run 0

compute coord all coord/atom 2.0 *
write_dump all custom coords.dat c_coord

still yields the segmentation fault exactly when the write_dump
command is executed. Any more ideas? Many thanks for your patience.

unfortunately, you seem to have come across an "unintended
undocumented feature" (aka a bug) in the write_dump command when used
in combination with a compute.

the workaround for now would be to use the regular dump command, i.e.
change the last 3 command into this:

compute coord all coord/atom 2.0 *
dump d1 all custom 10 coords.dat c_coord
run 1

Just posted a 30Sep patch for this. It throws an error
if you try to use write_dump to output values from a per-atom
compute that are not “current”, meaning the compute has

been evaluated on the current timestep. This is similar
to how variables are restricted if output between timesteps,
so see the discussion on the variable doc page for how
to enforce this if your script does not (yours does not).

Basically you have to do a 0-step run ahead of the write_dump
and insure that the compute is actually invoked in that run.
For coord/atom, that could be doing a thermo output of some atom’s
coord number or summing the coord #s across all atoms, etc.

Otherwise LAMMPS has no way to know that the values in the compute
are current, and it can’t safely invoke many kinds of computes between

runs.

Steve

Many thanks for your prompt help, now I am able to get what I need :slight_smile:

David