# pyiron.lammps.interactive module¶

class pyiron.lammps.interactive.LammpsInteractive(project, job_name)[source]
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) – Target temperature. If set to None, an NVE calculation is performed. It is required when the pressure is set or langevin is set pressure (None/float) – Target pressure. If set to None, an NVE or an NVT calculation is performed. (This tag will allow for a list in the future as it is done for calc_minimize()) n_ionic_steps (int) – Number of ionic steps time_step (float) – Step size between two steps. In fs if units==metal 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.)
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 (float/list/tuple/numpy.ndarray) – Pressure in GPa at which minimisation is to be carried out. If None, isochoric (constant volume) condition will be used. If a float, cell shape changes are allowed. in each of the three primary axes, but no shearing occurs. If array-like, (up to) the first six elements will be interpreted as the x, y, z, xy, xz, and yz components of the pressure tensor, respectively. If this component-wise mode is used, cell changes corresponding to any one element of the stress tensor can be selectively disabled by setting this element to None. (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.)
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 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 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.

structure

type: Returns

update_potential()[source]
class pyiron.lammps.interactive.LammpsLibrary(cores=1, working_directory='.')[source]

Bases: object

close()[source]
command(command)[source]

Send a command to the lammps library

Parameters: command (str) –
extract_compute(*args)[source]

Extract compute from the lammps library

Parameters: *args –

Returns:

gather_atoms(*args)[source]

Gather atoms from the lammps library

Parameters: *args – np.array
get_thermo(*args)[source]

Get thermo from the lammps library

Parameters: *args –

Returns:

scatter_atoms(*args)[source]

Scatter atoms for the lammps library

Parameters: *args –