LAMMPS Calculator and MD¶
-
class
flare.md.lammps.
LAMMPS_MD
(atoms, timestep, trajectory=None, **kwargs)¶ Run MD with LAMMPS based on the ase.md.md.MolecularDynamics. It includes using LAMMPS_MOD to run multiple steps, and supports Bayesian active learning with flare.
Parameters: parameters (dict) – LAMMPS input commands. -
backup
(curr_trj)¶ Back up the current trajectory into .xyz file. The atomic positions, velocities, forces and uncertainties are read from lammps trajectory. The step, potential energy and stress are read from thermo.txt
Parameters: curr_trj (list[ase.Atoms]) – lammps trajectory of current run read by ASE.
-
step
(std_tolerance, N_steps)¶ Run lammps until the uncertainty interrupts. Notice this method neither runs only a single MD step, nor finishes all the
N_steps
. The MD exits only when 1) the maximal atomic uncertainty goes beyondstd_tolerance
, or 2) all theN_steps
are finished without uncertainty beyondstd_tolerance
.Parameters: - std_tolerance (float) – the threshold for atomic uncertainty, above which the MD will be interrupted and DFT will be called.
- N_steps (int) – number of MD steps left to run.
-
-
class
flare.md.lammps.
LAMMPS_MOD
(**kwargs)¶ A modified ASE LAMMPS calculator based on ase.lammpsrun.LAMMPS, to allow for more flexible input parameters, including compute, fix/nvt, fix/npt etc.
Supported customized commands for LAMMPS input: - mass (set by arg masses) - package - atom_style, bond_style, angle_style, dihedral_style, improper_style, kspace_style - units (default: metal) - boundary - neighbor - newton - kim_interactions - pair_style (default: lj/cut 2.5) - pair_coeff (default: * * 1 1) - *compute - *region - *dump - group - fix - timestep - minimize - run
Note: - additional commands needed at the beginning can be specified in the arg model_init - additional commands needed after “pair_coeff” can be specified in the arg model_post
Non-customized input commands: - atom_modify sort 0 0.0 - read_data - fix fix_nve all nve - dump dump_all all custom trj_file (dump_period) id type x y z vx vy vz fx fy fz - thermo_style custom (thermo_args) - thermo_modify flush yes format float %23.16g - thermo 1
Customized parameters: - dump_period - thermo_args - specorder
-
calculate
(atoms=None, properties=None, system_changes=None, set_atoms=False)¶ Modify parameters
-
-
flare.md.lammps.
check_sgp_match
(atoms, sgp_calc, logger, specorder, command)¶ Check if the lammps trajectory or calculator matches the SGP predictions
-
flare.md.lammps.
get_kinetic_stress
(atoms)¶ LAMMPS stress tensor = virial + kinetic, kinetic = sum(m_k * v_ki * v_kj) / V. We subtract the kinetic term and keep only the virial term. In the calculator, results[“stress”] += kinetic_atoms gives virial.