variable alat equal 4.05 variable N_box equal 1 ###################################################################### # Simulation setup ###################################################################### units metal dimension 3 boundary p p p atom_style atomic atom_modify map array lattice fcc ${alat} region simbox block 0 ${N_box} 0 ${N_box} 0 ${N_box} units lattice create_box 1 simbox lattice fcc ${alat} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 create_atoms 1 region simbox pair_style eam/fs pair_coeff * * Al1.eam.fs Al neighbor 2.0 bin neigh_modify delay 0 check yes ###################################################################### # Values to be computed ###################################################################### compute energy_per_atom all pe/atom compute total_energy_sum all reduce sum c_energy_per_atom compute total_energy all pe ###################################################################### # Minimization ###################################################################### reset_timestep 0 fix 1 all box/relax iso 0.0 vmax 0.001 thermo 1 thermo_style custom step pe c_total_energy c_total_energy_sum min_style cg minimize 1e-15 1e-15 5000 10000 unfix 1 ###################################################################### # Output ###################################################################### variable __E_from_pe equal "c_total_energy" variable E_from_pe equal ${__E_from_pe} variable __E_from_sum equal "c_total_energy_sum" variable E_from_sum equal ${__E_from_sum} print "############################################################" print "Energy from PE (direct): ${E_from_pe}" print "Energy from PE/ATOM (summation): ${E_from_sum}" print "############################################################"