pyiron.lammps.interactive module

class pyiron.lammps.interactive.LammpsInteractive(project, job_name)[source]

Bases: pyiron.lammps.base.LammpsBase, pyiron.atomistics.job.interactive.GenericInteractive

calc_md(temperature=None, pressure=None, n_ionic_steps=1000, time_step=1.0, n_print=100, temperature_damping_timescale=100.0, pressure_damping_timescale=1000.0, seed=None, tloop=None, initial_temperature=None, langevin=False, delta_temp=None, delta_press=None)[source]

Set an MD calculation within LAMMPS. Nosé Hoover is used by default.

Parameters
  • temperature (None/float/list) – Target temperature value(-s). If set to None, an NVE calculation is performed. It is required when the pressure is set or langevin is set It can be a list of temperature values, containing the initial target temperature and the final target temperature (in between the target value is varied linearly).

  • pressure (None/float/numpy.ndarray/list) – Target pressure. If set to None, an NVE or an NVT calculation is performed. A list of up to length 6 can be given to specify xx, yy, zz, xy, xz, and yz components of the pressure tensor, respectively. These values can mix floats and None to allow only certain degrees of cell freedom to change. (Default is None, run isochorically.)

  • n_ionic_steps (int) – Number of ionic steps

  • time_step (float) – Step size in fs between two steps.

  • n_print (int) – Print frequency

  • temperature_damping_timescale (float) – The time associated with the thermostat adjusting the temperature. (In fs. After rescaling to appropriate time units, is equivalent to Lammps’ Tdamp.)

  • pressure_damping_timescale (float) – The time associated with the barostat adjusting the temperature. (In fs. After rescaling to appropriate time units, is equivalent to Lammps’ Pdamp.)

  • seed (int) – Seed for the random number generation (required for the velocity creation)

  • tloop

  • initial_temperature (None/float) – Initial temperature according to which the initial velocity field is created. If None, the initial temperature will be twice the target temperature (which would go immediately down to the target temperature as described in equipartition theorem). If 0, the velocity field is not initialized (in which case the initial velocity given in structure will be used). If any other number is given, this value is going to be used for the initial temperature.

  • langevin (bool) – (True or False) Activate Langevin dynamics

  • delta_temp (float) – Thermostat timescale, but in your Lammps time units, whatever those are. (DEPRECATED.)

  • delta_press (float) – Barostat timescale, but in your Lammps time units, whatever those are. (DEPRECATED.)

  • job_name (str) – Job name of the job to generate a unique random seed.

  • rotation_matrix (numpy.ndarray) – The rotation matrix from the pyiron to Lammps coordinate frame.

calc_minimize(e_tol=0.0, f_tol=0.0001, max_iter=100000, pressure=None, n_print=100, style='cg')[source]

Sets parameters required for minimization.

Parameters
  • e_tol (float) – If the magnitude of difference between energies of two consecutive steps is lower than or equal to e_tol, the minimisation terminates. (Default is 0.0 eV.)

  • f_tol (float) – If the magnitude of the global force vector at a step is lower than or equal to f_tol, the minimisation terminates. (Default is 1e-4 eV/angstrom.)

  • max_iter (int) – Maximum number of minimisation steps to carry out. If the minimisation converges before max_iter steps, terminate at the converged step. If the minimisation does not converge up to max_iter steps, terminate at the max_iter step. (Default is 100000.)

  • pressure (None/float/numpy.ndarray/list) – Target pressure. If set to None, an NVE or an NVT calculation is performed. A list of up to length 6 can be given to specify xx, yy, zz, xy, xz, and yz components of the pressure tensor, respectively. These values can mix floats and None to allow only certain degrees of cell freedom to change. (Default is None, run isochorically.)

  • n_print (int) – Write (dump or print) to the output file every n steps (Default: 100)

  • style ('cg'/'sd'/other values from Lammps docs) – The style of the numeric minimization, either conjugate gradient, steepest descent, or other keys permissible from the Lammps docs on ‘min_style’. (Default is ‘cg’ – conjugate gradient.)

  • rotation_matrix (numpy.ndarray) – The rotation matrix from the pyiron to Lammps coordinate frame.

collect_output()[source]

Returns:

from_hdf(hdf=None, group_name=None)[source]

Recreates instance from the hdf5 file

Parameters
  • hdf (str) – Path to the hdf5 file

  • group_name (str) – Name of the group which contains the object

get_structure(iteration_step=- 1, wrap_atoms=True)[source]

Gets the structure from a given iteration step of the simulation (MD/ionic relaxation). For static calculations there is only one ionic iteration step :param iteration_step: Step for which the structure is requested :type iteration_step: int :param wrap_atoms: True if the atoms are to be wrapped back into the unit cell :type wrap_atoms: bool

Returns

The required structure

Return type

pyiron.atomistics.structure.atoms.Atoms

interactive_cells_getter()[source]
interactive_cells_setter(cell)[source]
interactive_close()[source]

For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job. After the interactive execution, the job can be closed using the interactive_close function.

interactive_energy_pot_getter()[source]
interactive_energy_tot_getter()[source]
interactive_execute()[source]
interactive_fetch()[source]

For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job. To access the output data during the execution the interactive_fetch function is used.

interactive_forces_getter()[source]
interactive_indices_getter()[source]
interactive_indices_setter(indices)[source]
interactive_initialize_interface()[source]
interactive_positions_getter()[source]
interactive_positions_setter(positions)[source]
interactive_pressures_getter()[source]
interactive_steps_getter()[source]
interactive_stress_getter()[source]

This gives back an Nx3x3 array of stress/atom defined in http://lammps.sandia.gov/doc/compute_stress_atom.html Keep in mind that it is stress*volume in eV. Further discussion can be found on the website above.

Returns

Nx3x3 np array of stress/atom

Return type

numpy.array

interactive_structure_setter(structure)[source]
interactive_temperatures_getter()[source]
interactive_volume_getter()[source]
run_if_interactive()[source]

For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job.

run_if_interactive_non_modal()[source]

For jobs which executables are available as Python library, those can also be executed with a library call instead of calling an external executable. This is usually faster than a single core python job.

property structure

Returns:

update_potential()[source]