pyiron.lammps package

Submodules

pyiron.lammps.control module

class pyiron.lammps.control.LammpsControl(input_file_name=None, **qwargs)[source]

Bases: pyiron.base.generic.parameters.GenericParameters

calc_md(temperature=None, pressure=None, n_ionic_steps=1000, dt=None, time_step=None, n_print=100, delta_temp=100.0, delta_press=None, seed=None, tloop=None, rescale_velocity=True, langevin=False)[source]
calc_minimize(e_tol=0.0, f_tol=1e-08, max_iter=100000, pressure=None, n_print=100)[source]
calc_static()[source]
dataset
load_default(file_content=None)[source]

Load defaults resets the dataset in the background to be empty

pyiron.lammps.lammps module

class pyiron.lammps.lammps.Input[source]

Bases: object

from_hdf(hdf5)[source]
Parameters:hdf5

Returns:

to_hdf(hdf5)[source]
Parameters:hdf5

Returns:

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

Bases: pyiron.atomistics.job.atomistic.AtomisticGenericJob

Class to setup and run and analyze LAMMPS simulations which is a derivative of atomistics.job.generic.GenericJob. The functions in these modules are written in such the function names and attributes are very generic (get_structure(), molecular_dynamics(), version) but the functions are written to handle LAMMPS specific input/output.

Parameters:
  • project (pyiron.project.Project instance) – Specifies the project path among other attributes
  • job_name (str) – Name of the job
input

Instance which handles the input

Type:lammps.Input instance
calc_md(temperature=None, pressure=None, n_ionic_steps=1000, dt=None, time_step=None, n_print=100, delta_temp=100.0, delta_press=None, seed=None, tloop=None, rescale_velocity=True, langevin=False)[source]
Parameters:
  • temperature
  • pressure
  • n_ionic_steps
  • dt
  • time_step
  • n_print
  • delta_temp
  • delta_press
  • seed
  • tloop
  • rescale_velocity
calc_minimize(e_tol=0.0, f_tol=1e-08, max_iter=100000, pressure=None, n_print=100)[source]
Parameters:
  • e_tol
  • f_tol
  • max_iter
  • pressure
  • n_print

Returns:

calc_static()[source]

Returns:

collect_dump_file(file_name='dump.out', cwd=None)[source]

general purpose routine to extract static from a lammps dump file

Parameters:
  • file_name
  • cwd

Returns:

collect_errors(file_name, cwd=None)[source]
Parameters:
  • file_name
  • cwd

Returns:

collect_h5md_file(file_name='dump.h5', cwd=None)[source]
Parameters:
  • file_name
  • cwd

Returns:

collect_logfiles()[source]

Returns:

collect_output()[source]

Returns:

collect_output_log(file_name='log.lammps', cwd=None)[source]

general purpose routine to extract static from a lammps log file

Parameters:
  • file_name
  • cwd

Returns:

convergence_check()[source]

Validate the convergence of the calculation.

Returns:If the calculation is converged
Return type:(bool)
cutoff_radius

type: Returns

enable_h5md()[source]

Returns:

from_hdf(hdf=None, group_name=None)[source]
Parameters:
  • hdf
  • group_name

Returns:

get_final_structure()[source]

Returns:

get_potentials_for_structure()[source]

Returns:

get_structure(iteration_step=-1)[source]
Parameters:iteration_step

Returns:

list_potentials()[source]
Returns:
Return type:list
next(snapshot=-1, job_name=None, job_type=None)[source]

Restart a new job created from an existing Lammps calculation. :param project: Project instance at which the new job should be created :type project: pyiron.project.Project instance :param snapshot: Snapshot of the calculations which would be the initial structure of the new job :type snapshot: int :param job_name: Job name :type job_name: str :param job_type: Job type. If not specified a Lammps job type is assumed :type job_type: str

Returns:New job
Return type:new_ham (lammps.lammps.Lammps instance)
potential

Execute view_potential() or list_potential() in order to see the pre-defined potential files

Returns:

read_restart_file(filename='restart.out')[source]
Parameters:filename

Returns:

restart(snapshot=-1, job_name=None, job_type=None)[source]

Restart a new job created from an existing Lammps calculation. :param project: Project instance at which the new job should be created :type project: pyiron.project.Project instance :param snapshot: Snapshot of the calculations which would be the initial structure of the new job :type snapshot: int :param job_name: Job name :type job_name: str :param job_type: Job type. If not specified a Lammps job type is assumed :type job_type: str

Returns:New job
Return type:new_ham (lammps.lammps.Lammps instance)
set_potential(file_name)[source]
Parameters:file_name

Returns:

to_hdf(hdf=None, group_name=None)[source]
Parameters:
  • hdf
  • group_name

Returns:

validate_ready_to_run()[source]

Returns:

view_potentials()[source]

Returns:

write_input()[source]

Call routines that generate the code specific input files

Returns:

write_restart_file(filename='restart.out')[source]
Parameters:filename

Returns:

pyiron.lammps.lammps.to_amat(l_list)[source]
Parameters:l_list

Returns:

pyiron.lammps.lammpsinterface module

class pyiron.lammps.lammpsinterface.LammpsInt(project, job_name)[source]

Bases: pyiron.atomistics.job.interactive.GenericInteractive, pyiron.lammps.lammps.Lammps

calc_md(temperature=None, pressure=None, n_ionic_steps=1000, time_step=None, n_print=100, delta_temp=1.0, delta_press=None, seed=None, tloop=None, rescale_velocity=True)[source]

Args: temperature: pressure: n_ionic_steps: dt: time_step: n_print: delta_temp: delta_press: seed: tloop: rescale_velocity:

calc_minimize(e_tol=1e-08, f_tol=1e-08, max_iter=1000, pressure=None, n_print=1)[source]
Parameters:
  • e_tol
  • f_tol
  • max_iter
  • pressure
  • n_print

Returns:

collect_output()[source]

Collect the output files of the external executable and store the information in the HDF5 file. This method has to be implemented in the individual hamiltonians.

interactive_cells_getter()[source]
interactive_cells_setter(cell)[source]
interactive_close()[source]
interactive_energy_pot_getter()[source]
interactive_energy_tot_getter()[source]
interactive_fetch()[source]
interactive_forces_getter()[source]
interactive_indices_getter()[source]
interactive_indices_setter(indices)[source]
interactive_open()[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 np 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.

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.

update_potential()[source]
class pyiron.lammps.lammpsinterface.LammpsInt2(project, job_name)[source]

Bases: pyiron.lammps.lammpsinterface.LammpsInt

class pyiron.lammps.lammpsinterface.LammpsLibrary[source]

Bases: object

close()[source]
command(command)[source]
extract_compute(*args)[source]
gather_atoms(*args)[source]
get_thermo(*args)[source]
static interactive_close(conn, job)[source]
static interactive_extract_compute(conn, job, *args)[source]
static interactive_get_thermo(conn, job, *args)[source]
static interactive_lib_command(conn, job, command)[source]
static interactive_run(conn, job)[source]
static interactive_scatter_atoms(conn, job, *args)[source]
static interative_gather_atoms(conn, job, *args)[source]
scatter_atoms(*args)[source]

pyiron.lammps.potential module

class pyiron.lammps.potential.LammpsPotential(input_file_name=None)[source]

Bases: pyiron.base.generic.parameters.GenericParameters

This module helps write commands which help in the control of parameters related to the potential used in LAMMPS simulations

copy_pot_files(working_directory)[source]
df
files
from_hdf(hdf, group_name=None)[source]

Restore the GenericParameters from an HDF5 file

Parameters:
  • hdf (ProjectHDFio) – HDF5 group object
  • group_name (str) – HDF5 subgroup name - optional
get_element_lst()[source]
remove_structure_block()[source]
to_hdf(hdf, group_name=None)[source]

Store the GenericParameters in an HDF5 file

Parameters:
  • hdf (ProjectHDFio) – HDF5 group object
  • group_name (str) – HDF5 subgroup name - optional
class pyiron.lammps.potential.LammpsPotentialFile(potential_df=None, default_df=None, selected_atoms=None)[source]

Bases: pyiron.atomistics.job.potentials.PotentialAbstract

The Potential class is derived from the PotentialAbstract class, but instead of loading the potentials from a list, the potentials are loaded from a file.

Parameters:
  • potential_df
  • default_df
  • selected_atoms
default()[source]
find_default(element)[source]

Find the potentials

Parameters:
  • element (set, str) – element or set of elements for which you want the possible LAMMPS potentials
  • path (bool) – choose whether to return the full path to the potential or just the potential name
Returns:

of possible potentials for the element or the combination of elements

Return type:

list

pyiron.lammps.structure module

class pyiron.lammps.structure.LammpsStructure(input_file_name=None)[source]

Bases: pyiron.base.generic.parameters.GenericParameters

Parameters:input_file_name
el_eam_lst

type: Returns

load_default()[source]

Returns:

potential
rotate_positions(structure)[source]

Rotate all atomic positions in given structure according to new Prism cell

Parameters:structure – Atoms-like object. Should has .positions attribute
Returns:List of rotated coordinates
Return type:(list)
simulation_cell()[source]

Returns:

structure

type: Returns

structure_atomic()[source]

Write routine to create atom structure static file that can be loaded by LAMMPS

Returns:

structure_bond()[source]

Returns:

structure_full()[source]

Write routine to create atom structure static file for atom_type=’full’ that can be loaded by LAMMPS

Returns:

class pyiron.lammps.structure.UnfoldingPrism(cell, pbc=(True, True, True), digits=10)[source]

Bases: ase.calculators.lammpsrun.Prism

Create a lammps-style triclinic prism object from a cell

The main purpose of the prism-object is to create suitable string representations of prism limits and atom positions within the prism. When creating the object, the digits parameter (default set to 10) specify the precision to use. lammps is picky about stuff being within semi-open intervals, e.g. for atom positions (when using create_atom in the in-file), x must be within [xlo, xhi).

Parameters:
  • cell
  • pbc
  • digits
pos_to_lammps(position)[source]

Rotate an ase-cell position to the lammps cell orientation

Parameters:position
Returns:tuple of float.
unfold_cell(cell)[source]

Unfold LAMMPS cell to original

Parameters:cell – LAMMPS cell,
Returns:unfolded cell
pyiron.lammps.structure.write_lammps_datafile(structure, file_name='lammps.data', cwd=None)[source]

Module contents