Merge pull request #1796 from athomps/compute-snap-tweak

Fixed error in compute snap for quadratic and add log files for regre…
This commit is contained in:
Richard Berger 2019-12-13 11:55:20 -07:00 committed by GitHub
commit 6c3161cb55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 910 additions and 21 deletions

View File

@ -4,7 +4,6 @@
variable nsteps index 0
variable nrep equal 1
#variable a equal 3.316
variable a equal 2.0
units metal
@ -16,6 +15,7 @@ variable nz equal ${nrep}
boundary p p p
atom_modify map hash
lattice bcc $a
region box block 0 ${nx} 0 ${ny} 0 ${nz}
create_box 2 box
@ -35,8 +35,11 @@ variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 0
variable bzero equal 0
variable switch equal 0
variable snap_options string &
"${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag 0 bzeroflag 0 switchflag 0"
"${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
# set up dummy potential to satisfy cutoff
@ -67,6 +70,7 @@ compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_30 equal c_db[2][30]
# set up compute snap generating global array
@ -78,12 +82,14 @@ thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(B_{000}^i, all i of type 2)
# 4: xy component of Sum(Sum(r_j*dB_{222}^i/dr_j), all i of type 2), all j)
# followed by counterparts from compute snap
# 4: xy component of Sum(Sum(r_j*dB_{222}^i/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(B_{222}^i)/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom &
pe pxy c_bsum2[1] c_vbsum[60] &
c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10]
pe pxy c_bsum2[1] c_vbsum[60] v_db_2_30 &
c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10] c_snap[7][10]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]

View File

@ -0,0 +1,100 @@
# Demonstrate bispectrum computes
# initialize simulation
variable nsteps index 0
variable nrep equal 1
variable a equal 2.0
units metal
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable ny equal ${nrep}
variable nz equal ${nrep}
boundary p p p
atom_modify map hash
lattice bcc $a
region box block 0 ${nx} 0 ${ny} 0 ${nz}
create_box 2 box
create_atoms 2 box
mass * 180.88
displace_atoms all random 0.1 0.1 0.1 123456
# choose SNA parameters
variable twojmax equal 2
variable rcutfac equal 1.0
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 1
variable bzero equal 0
variable switch equal 0
variable snap_options string &
"${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
# set up dummy potential to satisfy cutoff
pair_style zero ${rcutfac}
pair_coeff * *
# set up reference potential
variable zblcutinner equal 4
variable zblcutouter equal 4.8
variable zblz equal 73
pair_style zbl ${zblcutinner} ${zblcutouter}
pair_coeff * * ${zblz} ${zblz}
# set up per-atom computes
compute b all sna/atom ${snap_options}
compute vb all snav/atom ${snap_options}
compute db all snad/atom ${snap_options}
# perform sums over atoms
group snapgroup1 type 1
group snapgroup2 type 2
compute bsum1 snapgroup1 reduce sum c_b[*]
compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum1 all ave/time 1 1 1 c_bsum1 file bsum1.dat mode vector
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_120 equal c_db[2][120]
# set up compute snap generating global array
compute snap all snap ${snap_options}
fix snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector
thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(0.5*(B_{222}^i)^2, all i of type 2)
# 4: xy component of Sum(Sum(r_j*(0.5*(dB_{222}^i)^2/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(0.5*(B_{222}^i)^2/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom &
pe pxy c_bsum2[20] c_vbsum[240] v_db_2_120 &
c_snap[1][41] c_snap[13][41] c_snap[1][40] c_snap[13][40] c_snap[7][40]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]
# dump_modify mydump_db sort id
# Run MD
run ${nsteps}

View File

@ -0,0 +1,198 @@
LAMMPS (20 Nov 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
# Demonstrate bispectrum computes
# initialize simulation
variable nsteps index 0
variable nrep equal 1
variable a equal 2.0
units metal
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable nx equal 1
variable ny equal ${nrep}
variable ny equal 1
variable nz equal ${nrep}
variable nz equal 1
boundary p p p
atom_modify map hash
lattice bcc $a
lattice bcc 2
Lattice spacing in x,y,z = 2 2 2
region box block 0 ${nx} 0 ${ny} 0 ${nz}
region box block 0 1 0 ${ny} 0 ${nz}
region box block 0 1 0 1 0 ${nz}
region box block 0 1 0 1 0 1
create_box 2 box
Created orthogonal box = (0 0 0) to (2 2 2)
1 by 1 by 1 MPI processor grid
create_atoms 2 box
Created 2 atoms
create_atoms CPU = 0.000478029 secs
mass * 180.88
displace_atoms all random 0.1 0.1 0.1 123456
# choose SNA parameters
variable twojmax equal 2
variable rcutfac equal 1.0
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 0
variable bzero equal 0
variable switch equal 0
variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
1 ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
# set up dummy potential to satisfy cutoff
pair_style zero ${rcutfac}
pair_style zero 1
pair_coeff * *
# set up reference potential
variable zblcutinner equal 4
variable zblcutouter equal 4.8
variable zblz equal 73
pair_style zbl ${zblcutinner} ${zblcutouter}
pair_style zbl 4 ${zblcutouter}
pair_style zbl 4 4.8
pair_coeff * * ${zblz} ${zblz}
pair_coeff * * 73 ${zblz}
pair_coeff * * 73 73
# set up per-atom computes
compute b all sna/atom ${snap_options}
compute b all sna/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
compute vb all snav/atom ${snap_options}
compute vb all snav/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
compute db all snad/atom ${snap_options}
compute db all snad/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
# perform sums over atoms
group snapgroup1 type 1
0 atoms in group snapgroup1
group snapgroup2 type 2
2 atoms in group snapgroup2
compute bsum1 snapgroup1 reduce sum c_b[*]
compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum1 all ave/time 1 1 1 c_bsum1 file bsum1.dat mode vector
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_30 equal c_db[2][30]
# set up compute snap generating global array
compute snap all snap ${snap_options}
compute snap all snap 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
fix snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector
thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(B_{000}^i, all i of type 2)
# 4: xy component of Sum(Sum(r_j*dB_{222}^i/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(B_{222}^i)/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom pe pxy c_bsum2[1] c_vbsum[60] v_db_2_30 c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10] c_snap[7][10]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]
# dump_modify mydump_db sort id
# Run MD
run ${nsteps}
run 0
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 6.8
ghost atom cutoff = 6.8
binsize = 3.4, bins = 1 1 1
5 neighbor lists, perpetual/occasional/extra = 1 4 0
(1) pair zbl, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) compute sna/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(3) compute snav/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(4) compute snad/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(5) compute snap, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 10.06 | 10.06 | 10.06 Mbytes
PotEng Pxy c_bsum2[1] c_vbsum[60] v_db_2_30 c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10] c_snap[7][10]
322.86952 1505558.1 364182.88 381.32218 -855.04473 322.86952 1505558.1 364182.88 381.32218 -855.04473
Loop time of 9.53674e-07 on 1 procs for 0 steps with 2 atoms
104.9% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 9.537e-07 | | |100.00
Nlocal: 2 ave 2 max 2 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 853 ave 853 max 853 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 330 ave 330 max 330 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 660 ave 660 max 660 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 660
Ave neighs/atom = 330
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,199 @@
LAMMPS (20 Nov 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
# Demonstrate bispectrum computes
# initialize simulation
variable nsteps index 0
variable nrep equal 1
variable a equal 2.0
units metal
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable nx equal 1
variable ny equal ${nrep}
variable ny equal 1
variable nz equal ${nrep}
variable nz equal 1
boundary p p p
atom_modify map hash
lattice bcc $a
lattice bcc 2
Lattice spacing in x,y,z = 2 2 2
region box block 0 ${nx} 0 ${ny} 0 ${nz}
region box block 0 1 0 ${ny} 0 ${nz}
region box block 0 1 0 1 0 ${nz}
region box block 0 1 0 1 0 1
create_box 2 box
Created orthogonal box = (0 0 0) to (2 2 2)
1 by 2 by 2 MPI processor grid
create_atoms 2 box
Created 2 atoms
create_atoms CPU = 0.000610113 secs
mass * 180.88
displace_atoms all random 0.1 0.1 0.1 123456
# choose SNA parameters
variable twojmax equal 2
variable rcutfac equal 1.0
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 0
variable bzero equal 0
variable switch equal 0
variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
1 ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
# set up dummy potential to satisfy cutoff
pair_style zero ${rcutfac}
pair_style zero 1
pair_coeff * *
# set up reference potential
variable zblcutinner equal 4
variable zblcutouter equal 4.8
variable zblz equal 73
pair_style zbl ${zblcutinner} ${zblcutouter}
pair_style zbl 4 ${zblcutouter}
pair_style zbl 4 4.8
pair_coeff * * ${zblz} ${zblz}
pair_coeff * * 73 ${zblz}
pair_coeff * * 73 73
# set up per-atom computes
compute b all sna/atom ${snap_options}
compute b all sna/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
compute vb all snav/atom ${snap_options}
compute vb all snav/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
compute db all snad/atom ${snap_options}
compute db all snad/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
# perform sums over atoms
group snapgroup1 type 1
0 atoms in group snapgroup1
group snapgroup2 type 2
2 atoms in group snapgroup2
compute bsum1 snapgroup1 reduce sum c_b[*]
compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum1 all ave/time 1 1 1 c_bsum1 file bsum1.dat mode vector
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_30 equal c_db[2][30]
# set up compute snap generating global array
compute snap all snap ${snap_options}
compute snap all snap 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 0 bzeroflag 0 switchflag 0
fix snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector
thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(B_{000}^i, all i of type 2)
# 4: xy component of Sum(Sum(r_j*dB_{222}^i/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(B_{222}^i)/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom pe pxy c_bsum2[1] c_vbsum[60] v_db_2_30 c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10] c_snap[7][10]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]
# dump_modify mydump_db sort id
# Run MD
run ${nsteps}
run 0
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 6.8
ghost atom cutoff = 6.8
binsize = 3.4, bins = 1 1 1
5 neighbor lists, perpetual/occasional/extra = 1 4 0
(1) pair zbl, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) compute sna/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(3) compute snav/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(4) compute snad/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(5) compute snap, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (../domain.cpp:936)
Per MPI rank memory allocation (min/avg/max) = 8.211 | 8.254 | 8.295 Mbytes
PotEng Pxy c_bsum2[1] c_vbsum[60] v_db_2_30 c_snap[1][11] c_snap[13][11] c_snap[1][6] c_snap[13][10] c_snap[7][10]
322.86952 1505558.1 364182.88 381.32218 -855.04473 322.86952 1505558.1 364182.88 381.32218 -855.04473
Loop time of 2.38419e-06 on 4 procs for 0 steps with 2 atoms
104.9% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 2.384e-06 | | |100.00
Nlocal: 0.5 ave 1 max 0 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Nghost: 734.5 ave 735 max 734 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Neighs: 82.5 ave 177 max 0 min
Histogram: 2 0 0 0 0 0 0 0 1 1
FullNghs: 165 ave 330 max 0 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Total # of neighbors = 660
Ave neighs/atom = 330
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,198 @@
LAMMPS (20 Nov 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
# Demonstrate bispectrum computes
# initialize simulation
variable nsteps index 0
variable nrep equal 1
variable a equal 2.0
units metal
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable nx equal 1
variable ny equal ${nrep}
variable ny equal 1
variable nz equal ${nrep}
variable nz equal 1
boundary p p p
atom_modify map hash
lattice bcc $a
lattice bcc 2
Lattice spacing in x,y,z = 2 2 2
region box block 0 ${nx} 0 ${ny} 0 ${nz}
region box block 0 1 0 ${ny} 0 ${nz}
region box block 0 1 0 1 0 ${nz}
region box block 0 1 0 1 0 1
create_box 2 box
Created orthogonal box = (0 0 0) to (2 2 2)
1 by 1 by 1 MPI processor grid
create_atoms 2 box
Created 2 atoms
create_atoms CPU = 0.000473976 secs
mass * 180.88
displace_atoms all random 0.1 0.1 0.1 123456
# choose SNA parameters
variable twojmax equal 2
variable rcutfac equal 1.0
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 1
variable bzero equal 0
variable switch equal 0
variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
1 ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
# set up dummy potential to satisfy cutoff
pair_style zero ${rcutfac}
pair_style zero 1
pair_coeff * *
# set up reference potential
variable zblcutinner equal 4
variable zblcutouter equal 4.8
variable zblz equal 73
pair_style zbl ${zblcutinner} ${zblcutouter}
pair_style zbl 4 ${zblcutouter}
pair_style zbl 4 4.8
pair_coeff * * ${zblz} ${zblz}
pair_coeff * * 73 ${zblz}
pair_coeff * * 73 73
# set up per-atom computes
compute b all sna/atom ${snap_options}
compute b all sna/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
compute vb all snav/atom ${snap_options}
compute vb all snav/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
compute db all snad/atom ${snap_options}
compute db all snad/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
# perform sums over atoms
group snapgroup1 type 1
0 atoms in group snapgroup1
group snapgroup2 type 2
2 atoms in group snapgroup2
compute bsum1 snapgroup1 reduce sum c_b[*]
compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum1 all ave/time 1 1 1 c_bsum1 file bsum1.dat mode vector
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_120 equal c_db[2][120]
# set up compute snap generating global array
compute snap all snap ${snap_options}
compute snap all snap 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
fix snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector
thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(0.5*(B_{222}^i)^2, all i of type 2)
# 4: xy component of Sum(Sum(r_j*(0.5*(dB_{222}^i)^2/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(0.5*(B_{222}^i)^2/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom pe pxy c_bsum2[20] c_vbsum[240] v_db_2_120 c_snap[1][41] c_snap[13][41] c_snap[1][40] c_snap[13][40] c_snap[7][40]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]
# dump_modify mydump_db sort id
# Run MD
run ${nsteps}
run 0
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 6.8
ghost atom cutoff = 6.8
binsize = 3.4, bins = 1 1 1
5 neighbor lists, perpetual/occasional/extra = 1 4 0
(1) pair zbl, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) compute sna/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(3) compute snav/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(4) compute snad/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(5) compute snap, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 21.78 | 21.78 | 21.78 Mbytes
PotEng Pxy c_bsum2[20] c_vbsum[240] v_db_2_120 c_snap[1][41] c_snap[13][41] c_snap[1][40] c_snap[13][40] c_snap[7][40]
322.86952 1505558.1 4.2492771e+08 7860489.6 -17625699 322.86952 1505558.1 4.2492771e+08 7860489.6 -17625699
Loop time of 2.14577e-06 on 1 procs for 0 steps with 2 atoms
93.2% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 2.146e-06 | | |100.00
Nlocal: 2 ave 2 max 2 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 853 ave 853 max 853 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 330 ave 330 max 330 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 660 ave 660 max 660 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 660
Ave neighs/atom = 330
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,199 @@
LAMMPS (20 Nov 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
# Demonstrate bispectrum computes
# initialize simulation
variable nsteps index 0
variable nrep equal 1
variable a equal 2.0
units metal
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable nx equal 1
variable ny equal ${nrep}
variable ny equal 1
variable nz equal ${nrep}
variable nz equal 1
boundary p p p
atom_modify map hash
lattice bcc $a
lattice bcc 2
Lattice spacing in x,y,z = 2 2 2
region box block 0 ${nx} 0 ${ny} 0 ${nz}
region box block 0 1 0 ${ny} 0 ${nz}
region box block 0 1 0 1 0 ${nz}
region box block 0 1 0 1 0 1
create_box 2 box
Created orthogonal box = (0 0 0) to (2 2 2)
1 by 2 by 2 MPI processor grid
create_atoms 2 box
Created 2 atoms
create_atoms CPU = 0.000118971 secs
mass * 180.88
displace_atoms all random 0.1 0.1 0.1 123456
# choose SNA parameters
variable twojmax equal 2
variable rcutfac equal 1.0
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable radelem1 equal 2.3
variable radelem2 equal 2.0
variable wj1 equal 1.0
variable wj2 equal 0.96
variable quadratic equal 1
variable bzero equal 0
variable switch equal 0
variable snap_options string "${rcutfac} ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}"
1 ${rfac0} ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 ${twojmax} ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 ${radelem1} ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 ${radelem2} ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 ${wj1} ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 ${wj2} rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 ${rmin0} quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag ${quadratic} bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag ${bzero} switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag ${switch}
1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
# set up dummy potential to satisfy cutoff
pair_style zero ${rcutfac}
pair_style zero 1
pair_coeff * *
# set up reference potential
variable zblcutinner equal 4
variable zblcutouter equal 4.8
variable zblz equal 73
pair_style zbl ${zblcutinner} ${zblcutouter}
pair_style zbl 4 ${zblcutouter}
pair_style zbl 4 4.8
pair_coeff * * ${zblz} ${zblz}
pair_coeff * * 73 ${zblz}
pair_coeff * * 73 73
# set up per-atom computes
compute b all sna/atom ${snap_options}
compute b all sna/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
compute vb all snav/atom ${snap_options}
compute vb all snav/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
compute db all snad/atom ${snap_options}
compute db all snad/atom 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
# perform sums over atoms
group snapgroup1 type 1
0 atoms in group snapgroup1
group snapgroup2 type 2
2 atoms in group snapgroup2
compute bsum1 snapgroup1 reduce sum c_b[*]
compute bsum2 snapgroup2 reduce sum c_b[*]
# fix bsum1 all ave/time 1 1 1 c_bsum1 file bsum1.dat mode vector
# fix bsum2 all ave/time 1 1 1 c_bsum2 file bsum2.dat mode vector
compute vbsum all reduce sum c_vb[*]
# fix vbsum all ave/time 1 1 1 c_vbsum file vbsum.dat mode vector
variable db_2_120 equal c_db[2][120]
# set up compute snap generating global array
compute snap all snap ${snap_options}
compute snap all snap 1 0.99363 2 2.3 2 1 0.96 rmin0 0 quadraticflag 1 bzeroflag 0 switchflag 0
fix snap all ave/time 1 1 1 c_snap[*] file compute.snap.dat mode vector
thermo 100
# test output: 1: total potential energy
# 2: xy component of stress tensor
# 3: Sum(0.5*(B_{222}^i)^2, all i of type 2)
# 4: xy component of Sum(Sum(r_j*(0.5*(dB_{222}^i)^2/dR[j]), all i of type 2), all j)
# 5: z component of -Sum(d(0.5*(B_{222}^i)^2/dR[2]), all i of type 2)
#
# followed by 5 counterparts from compute snap
thermo_style custom pe pxy c_bsum2[20] c_vbsum[240] v_db_2_120 c_snap[1][41] c_snap[13][41] c_snap[1][40] c_snap[13][40] c_snap[7][40]
thermo_modify norm no
# dump mydump_db all custom 1000 dump_db id c_db[*]
# dump_modify mydump_db sort id
# Run MD
run ${nsteps}
run 0
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 6.8
ghost atom cutoff = 6.8
binsize = 3.4, bins = 1 1 1
5 neighbor lists, perpetual/occasional/extra = 1 4 0
(1) pair zbl, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
(2) compute sna/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(3) compute snav/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(4) compute snad/atom, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
(5) compute snap, occasional
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (../domain.cpp:936)
Per MPI rank memory allocation (min/avg/max) = 19.7 | 19.74 | 19.78 Mbytes
PotEng Pxy c_bsum2[20] c_vbsum[240] v_db_2_120 c_snap[1][41] c_snap[13][41] c_snap[1][40] c_snap[13][40] c_snap[7][40]
322.86952 1505558.1 4.2492771e+08 7860489.6 -17625699 322.86952 1505558.1 4.2492771e+08 7860489.6 -17625699
Loop time of 2.80142e-06 on 4 procs for 0 steps with 2 atoms
107.1% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0 | 0 | 0 | 0.0 | 0.00
Output | 0 | 0 | 0 | 0.0 | 0.00
Modify | 0 | 0 | 0 | 0.0 | 0.00
Other | | 2.801e-06 | | |100.00
Nlocal: 0.5 ave 1 max 0 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Nghost: 734.5 ave 735 max 734 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Neighs: 82.5 ave 177 max 0 min
Histogram: 2 0 0 0 0 0 0 0 1 1
FullNghs: 165 ave 330 max 0 min
Histogram: 2 0 0 0 0 0 0 0 0 2
Total # of neighbors = 660
Ave neighs/atom = 330
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -10,19 +10,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* IDEAS
-DONE: Need to define a local peratom array for snad and snad on local and ghost atoms
-DONE: Reverse communicate local peratom array
-DONE: Copy peratom array into output array
-DONE: size_array_cols = nperdim (ncoeff [+quadratic])
-DONE: size_array_rows = 1 + total number of atoms + 6
-DONE: size_peratom = (3+6)*nperdim*ntypes
INCOMPLETE: Mappy from local to global
INCOMPLETE: modify->find_compute()
DONE: eliminate local peratom array for viral, replace with fdotr
*/
#include "compute_snap.h"
#include <cstring>
#include <cstdlib>
@ -400,18 +388,19 @@ void ComputeSnap::compute_array()
// linear contributions
int k = typeoffset_global;
for (int icoeff = 0; icoeff < ncoeff; icoeff++)
snap[0][icoeff+typeoffset_global] += snaptr->blist[icoeff];
snap[0][k++] += snaptr->blist[icoeff];
// quadratic contributions
if (quadraticflag) {
for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
double bveci = snaptr->blist[icoeff];
snap[0][icoeff+typeoffset_global] += 0.5*bveci*bveci;
snap[0][k++] += 0.5*bveci*bveci;
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
double bvecj = snaptr->blist[jcoeff];
snap[0][icoeff+typeoffset_global] += bveci*bvecj;
snap[0][k++] += bveci*bvecj;
}
}
}