pyiron.lammps.base module

class pyiron.lammps.base.Input[source]

Bases: object

from_hdf(hdf5)[source]
Parameters

hdf5

Returns:

to_hdf(hdf5)[source]
Parameters

hdf5

Returns:

class pyiron.lammps.base.LammpsBase(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, 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.01, 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:

compress(files_to_compress=None)[source]

Compress the output files of a job object.

Parameters

files_to_compress (list) –

convergence_check()[source]

Validate the convergence of the calculation.

Returns

If the calculation is converged

Return type

(bool)

property cutoff_radius

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:

list_potentials()[source]

List of interatomic potentials suitable for the current atomic structure.

use self.potentials_view() to get more details.

Returns

potential names

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)

property potential

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

Returns:

property potential_available
property potential_list

List of interatomic potentials suitable for the current atomic structure.

use self.potentials_view() to get more details.

Returns

potential names

Return type

list

property potential_view

List all interatomic potentials for the current atomistic sturcture including all potential parameters.

To quickly get only the names of the potentials you can use: self.potentials_list()

Returns

Dataframe including all potential parameters.

Return type

pandas.Dataframe

property publication
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_input_to_read_only()[source]

This function enforces read-only mode for the input classes, but it has to be implement in the individual classes.

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]

List all interatomic potentials for the current atomistic sturcture including all potential parameters.

To quickly get only the names of the potentials you can use: self.potentials_list()

Returns

Dataframe including all potential parameters.

Return type

pandas.Dataframe

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.base.to_amat(l_list)[source]
Parameters

l_list

Returns: