binary example
This commit is contained in:
@ -17,9 +17,15 @@ Physical Review Letters 276, 1 2018
|
||||
|
||||
Also see https://github.com/tomswinburne/pafi/ for PAFI++ code which uses the USER-PAFI package when loading LAMMPS as a C++ library
|
||||
|
||||
To run example:
|
||||
To compile:
|
||||
|
||||
mpirun -np NUMPROCS lmp_machine < pafi.lammps
|
||||
make yes-user-pafi # for PAFI
|
||||
make yes-manybody # for EAM potential
|
||||
make machine mode=lib # for library version (machine= e.g. mpi)
|
||||
make machine # for binary (machine= e.g. mpi)
|
||||
|
||||
where NUMPROCS = # of procs and lmp_machine = e.g. lmp_mpi
|
||||
To run the example from this folder:
|
||||
```
|
||||
mpirun -np NPROCS /path/to/lammps/src/lmp_machine < pafi.lammps
|
||||
```
|
||||
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
units metal
|
||||
|
||||
atom_style atomic
|
||||
|
||||
atom_modify map array sort 0 0.0
|
||||
neigh_modify every 2 delay 10 check yes page 1000000 one 100000
|
||||
|
||||
|
||||
## read in path data using fix property/atom
|
||||
fix pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz
|
||||
read_data test.dat fix pa NULL PafiPath
|
||||
run 0
|
||||
|
||||
## EAM potential
|
||||
pair_style eam/fs
|
||||
pair_coeff * * ../Fe.eam.fs Fe
|
||||
mass * 55.85
|
||||
thermo 100
|
||||
|
||||
compute pe all pe
|
||||
variable pe equal pe
|
||||
run 0
|
||||
print "energy=${pe}"
|
||||
|
||||
## compute property/atom to access relevant fields
|
||||
compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz
|
||||
run 0
|
||||
|
||||
## fix name group-id hp compute-id temperature damp seed overdamped 0/1 com 0/1
|
||||
fix hp all hp pa 400.0 0.1 234 overdamped 1 com 1
|
||||
|
||||
run 1000
|
||||
|
||||
## minimize under same constraint (temperature effectively zero)
|
||||
min_style fire
|
||||
|
||||
minimize 0 0 1000 1000
|
||||
print "energy=${pe}"
|
||||
|
||||
## minimize without constraint
|
||||
unfix hp
|
||||
minimize 0 0 1000 1000
|
||||
print "energy=${pe}"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,10 +2,6 @@ units metal
|
||||
|
||||
atom_style atomic
|
||||
|
||||
atom_modify map array sort 0 0.0
|
||||
neigh_modify every 2 delay 10 check yes page 1000000 one 100000
|
||||
|
||||
|
||||
## read in path data using fix property/atom
|
||||
fix pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz
|
||||
read_data test.dat fix pa NULL PafiPath
|
||||
@ -13,7 +9,7 @@ run 0
|
||||
|
||||
## EAM potential
|
||||
pair_style eam/fs
|
||||
pair_coeff * * Fe.eam.fs Fe
|
||||
pair_coeff * * ../Fe.eam.fs Fe
|
||||
mass * 55.85
|
||||
thermo 100
|
||||
|
||||
@ -22,23 +18,31 @@ variable pe equal pe
|
||||
run 0
|
||||
print "energy=${pe}"
|
||||
|
||||
## compute property/atom to access 9 fields
|
||||
## compute property/atom to access relevant fields
|
||||
compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz
|
||||
run 0
|
||||
|
||||
## fix name group-id hp compute-id temperature damp seed overdamped 0/1 com 0/1
|
||||
fix hp all hp pa 400.0 0.1 234 overdamped 1 com 1
|
||||
fix hp all hp pa 400.0 0.1 434 overdamped 1 com 1
|
||||
run 0
|
||||
variable dn equal f_hp[4]*f_hp[4] # should be zero
|
||||
fix af all ave/time 1 1000 1000 f_hp[1] f_hp[2] f_hp[3] v_dn
|
||||
|
||||
variable adn equal f_af[4] # should be zero
|
||||
variable apf equal f_af[1]
|
||||
run 1000
|
||||
|
||||
## minimize under same constraint
|
||||
print "Squared displacement normal to hyperplane = ${adn} A^2"
|
||||
print "average projected force = ${apf} eV/A"
|
||||
## minimize under same constraint (temperature effectively zero)
|
||||
min_style fire
|
||||
|
||||
minimize 0 0 1000 1000
|
||||
print "energy=${pe}"
|
||||
|
||||
## minimize without constraint
|
||||
unfix af
|
||||
unfix hp
|
||||
minimize 0 0 1000 1000
|
||||
print "energy=${pe}"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user