Files
lammps/examples/PACKAGES/apip/in.vacancy.dynamic.lambda
2025-04-10 16:05:16 +02:00

100 lines
4.1 KiB
Plaintext

##################################################
# parameters of the adaptive-precision potential #
##################################################
# We couple an EAM potential with an ACE potential.
variable eamfs_file string "Cu_300K_Immel_2023.eam.fs"
variable ace_file1 string "Cu-1.yace"
variable ace_file2 string "../../../potentials/Cu-PBE-core-rep.ace"
# The csp is used as detection mechanism for atoms of interest.
variable csp_lattice string "fcc"
variable csp_cutoff equal 6.0
# The range [r_sw_lo, r_sw_hi] determines where the switching parameter changes from 0 to 1.
variable r_sw_lo equal 2.0
variable r_sw_hi equal 3.0
# Thresholds between which the switching parameter changes from 1 to 0 based on the csp.
variable lambda_input_thr_lo equal 2.5
variable lambda_input_thr_hi equal 3.0
# Number of averaged steps.
variable lambda_input_histlen equal 110
variable lambda_histlen equal 110
# Minimum required change of the switching parameter
variable min_delta_lambda equal 1/${lambda_histlen}
# number of atoms rescaled by the lambda_thermostat
variable N_rescaling equal 600
## basic stuff
units metal
atom_style apip # own atom style required for APIP
timestep 0.001
# copper at room temperature with a vacancy
read_data data.vacancy
fix nve all nve
## Use adaptive-precision ace-ace potential without lambda_thermostat.
## Calculate atomic weight that could be used for load balancing.
#pair_style hybrid/overlay pace/apip/fast pace/apip/precise lambda_input/csp ${csp_lattice} cutoff ${csp_cutoff} lambda/zone ${r_sw_hi}
#pair_coeff * * pace/apip/fast ${ace_file1} Cu
#pair_coeff * * pace/apip/precise ${ace_file2} Cu
#pair_coeff * * lambda_input/csp
#pair_coeff * * lambda/zone
#fix lambda all lambda ${lambda_input_thr_lo} ${lambda_input_thr_hi} time_averaged_zone ${r_sw_lo} ${r_sw_hi} ${lambda_input_histlen} ${lambda_histlen} min_delta_lambda ${min_delta_lambda}
#fix weight_atom all apip_atom_weight 100 ace ace lambda_input lambda/zone all
# Use adaptive-precision eam-ace potential without lambda_thermostat.
# Calculate atomic weight that could be used for load balancing.
pair_style hybrid/overlay eam/fs/apip pace/apip lambda_input/csp ${csp_lattice} cutoff ${csp_cutoff} lambda/zone ${r_sw_hi}
pair_coeff * * eam/fs/apip ${eamfs_file} Cu
pair_coeff * * pace/apip ${ace_file2} Cu
pair_coeff * * lambda_input/csp
pair_coeff * * lambda/zone
fix lambda all lambda ${lambda_input_thr_lo} ${lambda_input_thr_hi} time_averaged_zone ${r_sw_lo} ${r_sw_hi} ${lambda_input_histlen} ${lambda_histlen} min_delta_lambda ${min_delta_lambda}
fix weight_atom all apip_atom_weight 100 eam ace lambda_input lambda/zone all
## One can comment out fix lambda_thermostat to see the energy change caused by the neglection of the
## gradient of the switching function. This neglection can be compensated by the local thermostat and the
## energy can be conserved within numerical precision.
fix lambda_thermostat all lambda_thermostat N_rescaling ${N_rescaling} store_atomic_forces 100
# get statistics about lambda
variable flag_simple atom lambda==1
variable flag_switch atom lambda<1&&lambda>0
variable flag_complex atom lambda==0
compute lambda_types all reduce sum v_flag_simple v_flag_switch v_flag_complex
thermo_style custom step etotal c_lambda_types[*]
thermo 1
run 100
# dump atoms
#write_dump all custom dump/vacancy.dump.* id type x y z fx fy fz lambda lambda_input f_weight_atom f_lambda_thermostat[*]
## A smooth restart of the simulation is possible as the history of lambda and lambda_input is stored.
#write_restart vacancy_ap.restart
#clear
#read_restart vacancy_ap.restart
#pair_style hybrid/overlay eam/fs/apip pace/apip lambda_input/csp fcc cutoff 6.0 lambda/zone 12.0
#pair_coeff * * eam/fs/apip "Cu_300K_Immel_2023.eam.fs" Cu
#pair_coeff * * pace/apip "../../../potentials/Cu-PBE-core-rep.ace" Cu
#pair_coeff * * lambda_input/csp
#pair_coeff * * lambda/zone
#fix lambda all lambda 2.5 3.0 time_averaged_zone 4.0 12.0 110 110 min_delta_lambda $(1/110)
#fix lambda_thermostat all lambda_thermostat N_rescaling ${N_rescaling} store_atomic_forces 100
#fix nve all nve
#thermo_style custom step etotal
#thermo 1
#run 10
#shell rm vacancy_ap.restart