Commit 37e5df86 authored by Sievers's avatar Sievers
Browse files

Merge branch 'chem_snap' of https://github.com/charlessievers/lammps into chem_snap

parents e7e82cfb 9a2348ff
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
# DATE: 2019-09-18 CONTRIBUTOR: Mary Alice Cusentino mcusent@sandia.gov CITATION: M.A. Wood, M.A. Cusentino, B.D. Wirth, and A.P. Thompson, "Data-driven material models for atomistic simulation", Physical Review B 99, 184305 (2019) 
# Definition of SNAP+ZBL potential.
set type 1 charge 1e-08
set type 2 charge -1e-08
variable zblcutinner equal 4
variable zblcutouter equal 4.2
variable zblz1 equal 49
variable zblz2 equal 15
variable rcoul equal 10

# Specify hybrid with SNAP, ZBL, and long-range Coulomb

pair_style hybrid/overlay coul/long ${rcoul} &
zbl ${zblcutinner} ${zblcutouter} &
snap
pair_coeff * * coul/long
pair_coeff 1 1 zbl ${zblz1} ${zblz1}
pair_coeff 1 2 zbl ${zblz1} ${zblz2}
pair_coeff 2 2 zbl ${zblz2} ${zblz2}
pair_coeff * * snap InP_Cusentino_PRB2020.snapcoeff InP_Cusentino_PRB2020.snapparam In P 
kspace_style ewald 1.0e-5
+487 −0

File added.

Preview size limit exceeded, changes collapsed.

+13 −0
Original line number Diff line number Diff line

    # required
    rcutfac 1.0
    twojmax 6

    #  optional
    rfac0 0.99363
    rmin0 0.0
    bzeroflag 1
    quadraticflag 0
    wselfallflag 1
    alloyflag 1
    
 No newline at end of file
+47 −0
Original line number Diff line number Diff line
# Demonstrate SNAP InP potential

# Initialize simulation

variable nsteps index 100
variable nrep equal 4
variable a equal 5.83
units           metal
atom_style      charge

# generate the box and atom positions using a FCC lattice

variable nx equal ${nrep}
variable ny equal ${nrep}
variable nz equal ${nrep}

boundary        p p p

lattice         diamond $a
region          box block 0 ${nx} 0 ${ny} 0 ${nz}
create_box      2 box
create_atoms    1 box basis 5 2 basis 6 2 basis 7 2 basis 8 2

mass 1 114.76
mass 2 30.98

# choose potential

include InP_Cusentino_PRB2020.snap

# Setup output

thermo          10
thermo_modify norm yes

# Set up NVE run

timestep 0.5e-3
neighbor 1.0 bin
neigh_modify once no every 1 delay 0 check yes

# Run MD

velocity all create 300.0 4928459
fix 1 all nve
run             ${nsteps}
+6 −4
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) :
  extarray = 0;

  double rfac0, rmin0;
  int twojmax, switchflag, bzeroflag, bnormflag;
  int twojmax, switchflag, bzeroflag;
  radelem = NULL;
  wjelem = NULL;

@@ -55,7 +55,6 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) :
  rmin0 = 0.0;
  switchflag = 1;
  bzeroflag = 1;
  bnormflag = 0;
  quadraticflag = 0;
  alloyflag = 0;
  wselfallflag = 0;
@@ -114,10 +113,9 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) :
      quadraticflag = atoi(arg[iarg+1]);
      iarg += 2;
    } else if (strcmp(arg[iarg],"alloyflag") == 0) {
      if (iarg+2+ntypes > narg)
      if (iarg+2 > narg)
        error->all(FLERR,"Illegal compute snap command");
      alloyflag = 1;
      bnormflag = 1;
      memory->create(map,ntypes+1,"compute_snap:map");
      nelements = force->inumeric(FLERR,arg[iarg+1]);
      for(int i = 0; i < ntypes; i++) {
@@ -169,6 +167,8 @@ ComputeSnap::~ComputeSnap()
  memory->destroy(wjelem);
  memory->destroy(cutsq);
  delete snaptr;

  if (alloyflag) memory->destroy(map);
}

/* ---------------------------------------------------------------------- */
@@ -541,6 +541,8 @@ double ComputeSnap::memory_usage()
    sizeof(double);                                     // snapall
  bytes += nmax*size_peratom * sizeof(double);          // snap_peratom
  bytes += snaptr->memory_usage();                      // SNA object
  int n = atom->ntypes+1;
  bytes += n*sizeof(int);        // map

  return bytes;
}
Loading