Merge branch 'mliappy_unified' of github.com:Boogie3D/lammps into mliappy_unified
This commit is contained in:
@ -1105,7 +1105,7 @@ contains !! Wrapper functions local to this module {{{1
|
||||
C_xy = xy
|
||||
C_xz = xz
|
||||
C_yz = yz
|
||||
call lammps_actual_reset_box (ptr, C_boxlo, C_boxhi, C_xy, C_xz, C_yz)
|
||||
call lammps_actual_reset_box (ptr, C_boxlo, C_boxhi, C_xy, C_yz, C_xz)
|
||||
end subroutine lammps_reset_box
|
||||
|
||||
! lammps_gather_atoms {{{2
|
||||
|
||||
@ -40,7 +40,7 @@ the dynamically-linkable library (liblammps_fortran.so).
|
||||
(2) Copy said library to your Fortran program's source directory or replace
|
||||
${LAMMPS_LIB} with its full path in the instructions below.
|
||||
(3) Compile (but don't link!) LAMMPS.F90. Example:
|
||||
mpif90 -c LAMMPS.f90
|
||||
mpifort -c LAMMPS.f90
|
||||
OR
|
||||
gfortran -c LAMMPS.F90
|
||||
NOTE: you may get a warning such as,
|
||||
@ -72,8 +72,8 @@ the dynamically-linkable library (liblammps_fortran.so).
|
||||
were part of the usual LAMMPS library interface (if you have the module
|
||||
file visible to the compiler, that is).
|
||||
(6) Compile (but don't link) your Fortran program. Example:
|
||||
mpif90 -c myfreeformatfile.f90
|
||||
mpif90 -c myfixedformatfile.f
|
||||
mpifort -c myfreeformatfile.f90
|
||||
mpifort -c myfixedformatfile.f
|
||||
OR
|
||||
gfortran -c myfreeformatfile.f90
|
||||
gfortran -c myfixedformatfile.f
|
||||
@ -83,12 +83,12 @@ the dynamically-linkable library (liblammps_fortran.so).
|
||||
IMPORTANT: If the Fortran module from part (3) is not in the current
|
||||
directory or in one searched by the compiler for module files, you will
|
||||
need to include that location via the -I flag to the compiler, like so:
|
||||
mpif90 -I${LAMMPS_SRC}/examples/COUPLE/fortran2 -c myfreeformatfile.f90
|
||||
mpifort -I${LAMMPS_SRC}/examples/COUPLE/fortran2 -c myfreeformatfile.f90
|
||||
|
||||
(7) Link everything together, including any libraries needed by LAMMPS (such
|
||||
as the C++ standard library, the C math library, the JPEG library, fftw,
|
||||
etc.) For example,
|
||||
mpif90 LAMMPS.o LAMMPS-wrapper.o ${my_object_files} \
|
||||
mpifort LAMMPS.o LAMMPS-wrapper.o ${my_object_files} \
|
||||
${LAMMPS_LIB} -lmpi_cxx -lstdc++ -lm
|
||||
OR
|
||||
gfortran LAMMPS.o LAMMPS-wrapper.o ${my_object_files} \
|
||||
@ -105,17 +105,17 @@ You should now have a working executable.
|
||||
(1) Compile LAMMPS as a dynamic library
|
||||
(make makeshlib && make -f Makefile.shlib [targetname]).
|
||||
(2) Compile, but don't link, LAMMPS.F90 using the -fPIC flag, such as
|
||||
mpif90 -fPIC -c LAMMPS.f90
|
||||
mpifort -fPIC -c LAMMPS.f90
|
||||
(3) Compile, but don't link, LAMMPS-wrapper.cpp in the same manner, e.g.
|
||||
mpicxx -fPIC -c LAMMPS-wrapper.cpp
|
||||
(4) Make the dynamic library, like so:
|
||||
mpif90 -fPIC -shared -o liblammps_fortran.so LAMMPS.o LAMMPS-wrapper.o
|
||||
mpifort -fPIC -shared -o liblammps_fortran.so LAMMPS.o LAMMPS-wrapper.o
|
||||
(5) Compile your program, such as,
|
||||
mpif90 -I${LAMMPS_SRC}/examples/COUPLE/fortran2 -c myfreeformatfile.f90
|
||||
mpifort -I${LAMMPS_SRC}/examples/COUPLE/fortran2 -c myfreeformatfile.f90
|
||||
where ${LAMMPS_SRC}/examples/COUPLE/fortran2 contains the .mod file from
|
||||
step (3)
|
||||
(6) Link everything together, such as
|
||||
mpif90 ${my_object_files} -L${LAMMPS_SRC} \
|
||||
mpifort ${my_object_files} -L${LAMMPS_SRC} \
|
||||
-L${LAMMPS_SRC}/examples/COUPLE/fortran2 -llammps_fortran \
|
||||
-llammps_openmpi -lmpi_cxx -lstdc++ -lm
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ spkpath.h contains path to SPPARKS home directory
|
||||
After editing the Makefile, lmppath.h, and spkpath.h to make them
|
||||
suitable for your box, type:
|
||||
|
||||
g++ -f Makefile.g++
|
||||
make -f Makefile.g++
|
||||
|
||||
and you should get the lmpspk executable.
|
||||
|
||||
|
||||
@ -1,66 +1,66 @@
|
||||
# 2d NEB surface simulation, hop from surface to become adatom
|
||||
|
||||
dimension 2
|
||||
boundary p s p
|
||||
dimension 2
|
||||
boundary p s p
|
||||
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
|
||||
variable u uloop 20
|
||||
variable u uloop 20
|
||||
|
||||
# create geometry with flat surface
|
||||
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 10 -0.25 0.25
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 10 -0.25 0.25
|
||||
|
||||
#create_box 3 box
|
||||
#create_atoms 1 box
|
||||
#mass * 1.0
|
||||
#create_box 3 box
|
||||
#create_atoms 1 box
|
||||
#mass * 1.0
|
||||
#write_data initial.hop1
|
||||
|
||||
read_data initial.hop1
|
||||
|
||||
# LJ potentials
|
||||
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
|
||||
# initial minimization to relax surface
|
||||
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
reset_timestep 0
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
reset_timestep 0
|
||||
|
||||
# define groups
|
||||
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
|
||||
timestep 0.05
|
||||
timestep 0.05
|
||||
|
||||
# group of NEB atoms - either block or single atom ID 412
|
||||
|
||||
region surround block 10 18 17 20 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 412
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
region surround block 10 18 17 20 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 412
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0 parallel ideal
|
||||
fix 3 all enforce2d
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0 parallel ideal
|
||||
fix 3 all enforce2d
|
||||
|
||||
thermo 100
|
||||
thermo 100
|
||||
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
|
||||
# run NEB for 2000 steps or to force tolerance
|
||||
|
||||
min_style quickmin
|
||||
min_style quickmin
|
||||
|
||||
neb 0.0 0.1 1000 1000 100 final final.hop1
|
||||
neb 0.0 0.1 1000 1000 100 final final.hop1
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
# 2d NEB surface simulation, hop from surface to become adatom
|
||||
|
||||
dimension 2
|
||||
boundary p s p
|
||||
dimension 2
|
||||
boundary p s p
|
||||
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
|
||||
variable u uloop 20
|
||||
variable u uloop 20
|
||||
|
||||
# create geometry with flat surface
|
||||
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 10 -0.25 0.25
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 10 -0.25 0.25
|
||||
|
||||
read_data initial.hop1.end
|
||||
|
||||
# LJ potentials
|
||||
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
|
||||
# define groups
|
||||
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
|
||||
timestep 0.05
|
||||
timestep 0.05
|
||||
|
||||
# group of NEB atoms - either block or single atom ID 412
|
||||
|
||||
region surround block 10 18 17 20 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 412
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
region surround block 10 18 17 20 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 412
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0 parallel ideal end first 1.0
|
||||
fix 3 all enforce2d
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0 parallel ideal end first 1.0
|
||||
fix 3 all enforce2d
|
||||
|
||||
thermo 100
|
||||
thermo 100
|
||||
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
|
||||
# run NEB for 2000 steps or to force tolerance
|
||||
|
||||
min_style quickmin
|
||||
min_style quickmin
|
||||
|
||||
neb 0.0 0.1 1000 1000 100 final final.hop1
|
||||
neb 0.0 0.1 1000 1000 100 final final.hop1
|
||||
|
||||
@ -1,68 +1,68 @@
|
||||
# 2d NEB surface simulation, hop of adatom on surface
|
||||
|
||||
dimension 2
|
||||
boundary p s p
|
||||
dimension 2
|
||||
boundary p s p
|
||||
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
atom_style atomic
|
||||
neighbor 0.3 bin
|
||||
neigh_modify delay 5
|
||||
atom_modify map array sort 0 0.0
|
||||
|
||||
variable u uloop 20
|
||||
variable u uloop 20
|
||||
|
||||
# create geometry with adatom
|
||||
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 11 -0.25 0.25
|
||||
region box1 block 0 20 0 10 -0.25 0.25
|
||||
lattice hex 0.9
|
||||
region box block 0 20 0 11 -0.25 0.25
|
||||
region box1 block 0 20 0 10 -0.25 0.25
|
||||
|
||||
#create_box 3 box
|
||||
#create_atoms 1 region box1
|
||||
#create_atoms 1 single 11.5 10.5 0
|
||||
#mass * 1.0
|
||||
#create_box 3 box
|
||||
#create_atoms 1 region box1
|
||||
#create_atoms 1 single 11.5 10.5 0
|
||||
#mass * 1.0
|
||||
#write_data initial.hop2
|
||||
|
||||
read_data initial.hop2
|
||||
|
||||
# LJ potentials
|
||||
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
pair_style lj/cut 2.5
|
||||
pair_coeff * * 1.0 1.0 2.5
|
||||
pair_modify shift yes
|
||||
|
||||
# initial minimization to relax surface
|
||||
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
reset_timestep 0
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
reset_timestep 0
|
||||
|
||||
# define groups
|
||||
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
region 1 block INF INF INF 1.25 INF INF
|
||||
group lower region 1
|
||||
group mobile subtract all lower
|
||||
set group lower type 2
|
||||
|
||||
timestep 0.05
|
||||
timestep 0.05
|
||||
|
||||
# group of NEB atoms - either block or single atom ID 421
|
||||
|
||||
region surround block 10 18 17 21 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 421
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
region surround block 10 18 17 21 0 0 units box
|
||||
group nebatoms region surround
|
||||
#group nebatoms id 421
|
||||
set group nebatoms type 3
|
||||
group nonneb subtract all nebatoms
|
||||
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0
|
||||
fix 3 all enforce2d
|
||||
fix 1 lower setforce 0.0 0.0 0.0
|
||||
fix 2 nebatoms neb 1.0
|
||||
fix 3 all enforce2d
|
||||
|
||||
thermo 100
|
||||
thermo 100
|
||||
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
#dump 1 nebatoms atom 10 dump.neb.$u
|
||||
#dump 2 nonneb atom 10 dump.nonneb.$u
|
||||
|
||||
# run NEB for 2000 steps or to force tolerance
|
||||
|
||||
min_style fire
|
||||
min_style fire
|
||||
|
||||
neb 0.0 0.05 1000 1000 100 final final.hop2
|
||||
neb 0.0 0.05 1000 1000 100 final final.hop2
|
||||
|
||||
@ -5,7 +5,7 @@ units metal
|
||||
atom_style atomic
|
||||
atom_modify map array
|
||||
boundary p p p
|
||||
atom_modify sort 0 0.0
|
||||
atom_modify sort 0 0.0
|
||||
|
||||
# coordination number cutoff
|
||||
|
||||
@ -45,7 +45,7 @@ group Si type 1
|
||||
group del id 300
|
||||
delete_atoms group del compress no
|
||||
group vacneigh id 174 175 301 304 306 331 337
|
||||
|
||||
|
||||
# choose potential
|
||||
|
||||
pair_style sw
|
||||
@ -53,26 +53,26 @@ pair_coeff * * Si.sw Si
|
||||
|
||||
# set up neb run
|
||||
|
||||
variable u uloop 20
|
||||
variable u uloop 20
|
||||
|
||||
# initial minimization to relax vacancy
|
||||
|
||||
displace_atoms all random 0.1 0.1 0.1 123456
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
|
||||
reset_timestep 0
|
||||
|
||||
# only output atoms near vacancy
|
||||
|
||||
#dump events vacneigh custom 1000 dump.neb.sivac.$u id type x y z
|
||||
|
||||
# initial minimization to relax vacancy
|
||||
fix 1 all neb 1.0
|
||||
|
||||
displace_atoms all random 0.1 0.1 0.1 123456
|
||||
minimize 1.0e-6 1.0e-4 1000 10000
|
||||
|
||||
reset_timestep 0
|
||||
|
||||
fix 1 all neb 1.0
|
||||
|
||||
thermo 100
|
||||
thermo 100
|
||||
|
||||
# run NEB for 2000 steps or to force tolerance
|
||||
|
||||
timestep 0.01
|
||||
min_style quickmin
|
||||
min_style quickmin
|
||||
|
||||
neb 0.0 0.01 100 100 10 final final.sivac
|
||||
neb 0.0 0.01 100 100 10 final final.sivac
|
||||
|
||||
Reference in New Issue
Block a user