(no subject)

Dear lammps users,

I wonder how I could dump the coordinate of one specific atom by using ‘dump’. I can dump all types of atoms by just input ‘type’ but cannot figure out how to dump only one or two types of them.
I have read the manual but did not find the answer.
Any suggestion would be appreciated.

Regards
Zizhen

Declaration of variables

- lattice parameters -

variable Sras equal 5.568
variable Tias equal 5.568
variable O1as equal 5.568
variable O2as equal 5.568
variable O3as equal 5.568

- simulation box -

variable slbx equal 0.0
variable subx equal 11.0
variable slby equal 0.0
variable suby equal 11.0
variable slbz equal 0.0
variable subz equal 11.0

Principal simulation options

units metal
atom_style charge
neighbor 3.0 bin
neigh_modify every 1 delay 5 check yes

Lattice and geometry

lattice sc {Sras} origin 0.5 0.5 0.5 region simbox block {slbx} {subx} {slby} {suby} {slbz} {subz} units lattice create_box 5 simbox create_atoms 1 box lattice sc {Tias} origin 0.0 0.0 0.0
create_atoms 2 box
lattice sc {O1as} origin 0.0 0.5 0.5 create_atoms 3 box lattice sc {O2as} origin 0.5 0.0 0.5
create_atoms 4 box
lattice sc ${O3as} origin 0.5 0.5 0.0
create_atoms 5 box

Species and interatomic potential

group A1 type 1
group A2 type 2
group A3 type 3
group A4 type 4
group A5 type 5
set group A1 charge 1.84
set group A2 charge 2.36
set group A3 charge -1.40
set group A4 charge -1.40
set group A5 charge -1.40
mass 1 87.62
mass 2 47.867
mass 3 15.9994
mass 4 15.9994
mass 5 15.9994
kspace_style ewald 1.0e-3
pair_style buck/coul/long 10
pair_coeff 1 1 0.0 0.319894 0.00
pair_coeff 1 2 0.0 0.319894 0.00
pair_coeff 1 3 1769.51 0.319894 0.00
pair_coeff 1 4 1769.51 0.319894 0.00
pair_coeff 1 5 1769.51 0.319894 0.00
pair_coeff 2 2 0.0 0.197584 0.00
pair_coeff 2 3 14567.40 0.197584 0.00
pair_coeff 2 4 14567.40 0.197584 0.00
pair_coeff 2 5 14567.40 0.197584 0.00
pair_coeff 3 3 6249.17 0.231472 0.00
pair_coeff 3 4 6249.17 0.231472 0.00
pair_coeff 3 5 6249.17 0.231472 0.00
pair_coeff 4 4 6249.17 0.231472 0.00
pair_coeff 4 5 6249.17 0.231472 0.00
pair_coeff 5 5 6249.17 0.231472 0.00

compute MSD1 A3 msd
compute MSD2 A4 msd
compute MSD3 A5 msd

Definition of output

thermo_style multi
thermo 100

Run simulation

velocity all create 1000.0 376847 loop geom

fix 1 all npt temp 1250.0 1250.0 0.02 iso 0.0 0.0 0.1
fix 2 A3 ave/time 1 100 100 c_MSD1[4] file msd1250_O1.txt
fix 3 A4 ave/time 1 100 100 c_MSD2[4] file msd1250_O2.txt
fix 2 A5 ave/time 1 100 100 c_MSD3[4] file msd1250_O3.txt

#dump 1 all xyz 100 coordinate.kkdat
#dump 2 all custom 100 coordinateSrTiO3.dat type x y z

timestep 0.001
run 120000
write_restart restart.*

I wonder how I could dump the coordinate of one specific atom by using 'dump'. I can dump all types of atoms by just input 'type' but cannot figure out how to dump only one or two types of them.

Do you want to dump only one atom, or one type of atom? In the former
case, do this:

#define a group which contains only one atom, eg:

group gOneAtom id 1234

#Then use that group with the dump command, eg:
dump myDump gOneAtom custom 1000 traj.lammpstrj id type x y z ix iy iz

For more information:
https://lammps.sandia.gov/doc/group.html
https://lammps.sandia.gov/doc/dump.html

-andrew

Alternatively if you just want the coordinates of a single atom and don’t want all the overhead of a dump file, you can use fix print. There was a question (and answer) about that yesterday…