runLAMMPS module
- class src.runLAMMPS.run_LAMMPS(folder, element, lattice_parameter, sigma, misorientation, inclination, size_along_gb_period, potential, mpi_location, lammps_location)[source]
Bases:
object
A class to set up, run, and post-process LAMMPS simulations for grain boundary disconnection energy calculations.
- folder
Directory for simulation input/output files.
- Type:
str
- element
Chemical element symbol (e.g. ‘Cu’).
- Type:
str
- lattice_parameter
Lattice parameter for the element.
- Type:
float
- sigma
Sigma value for grain boundary.
- Type:
int
- misorientation
Misorientation angle.
- Type:
float
- inclination
Grain boundary inclination.
- Type:
float
- size_along_gb_period
Size along grain boundary periodicity.
- Type:
int
- potential
Path to interatomic potential file.
- Type:
str
- mpi_location
Path to MPI binaries.
- Type:
str
- lammps_location
Path to LAMMPS binaries.
- Type:
str
- output_filename_gridsearch
Filename for grid search output.
- Type:
str or None
- gridsearch_output_setting
Grid search output setting flag.
- Type:
int or None
- gridsearch_output_folder
Folder for grid search outputs.
- Type:
str or None
- lammps_input_filename
Filename of the current LAMMPS input script.
- Type:
str or None
- neb_images
Number of NEB images (partitions).
- Type:
int or None
- number_of_images_provided
Number of images in NEB calculation.
- Type:
int or None
- burgers_vec
Burgers vector magnitude.
- Type:
float or None
- step_height
Step height used in NEB calculation.
- Type:
float or None
- neb_output_folder
Folder for NEB output files.
- Type:
str or None
- __init__(folder, element, lattice_parameter, sigma, misorientation, inclination, size_along_gb_period, potential, mpi_location, lammps_location)[source]
Initializes the run_LAMMPS instance with simulation parameters.
- Parameters:
folder (str) – Directory to store simulation files.
element (str) – Chemical element symbol.
lattice_parameter (float) – Lattice parameter.
sigma (int) – Sigma value for grain boundary.
misorientation (float) – Misorientation angle in degrees.
inclination (float) – Grain boundary inclination angle.
size_along_gb_period (int) – Size along grain boundary period.
potential (str) – Path to interatomic potential file.
mpi_location (str) – Path to MPI binaries.
lammps_location (str) – Path to LAMMPS binaries.
- post_process_gridsearch_data(plot_decision=False)[source]
Post-processes grid search results, sorting and optionally plotting the GB energy surface.
- Parameters:
plot_decision (bool, optional) – If True, generates and saves contour plots (default: False).
- post_process_neb_output(outfolder, plot_decision=False)[source]
Post-processes the NEB output dump files and optionally plots the energy profile.
- Parameters:
outfolder (str) – Folder to write processed output files.
plot_decision (bool, optional) – If True, generates and saves energy plot (default: False).
- run_grid_search(infile, outfolder, number_of_cores=6, step_increments=0.1, limit=1, output_setting=0)[source]
Runs a grid search of displacements using MPI-parallelized LAMMPS.
- Parameters:
infile (str) – Input data filename.
outfolder (str) – Output folder for results.
number_of_cores (int, optional) – Number of MPI cores to use (default: 6).
step_increments (float, optional) – Step size for grid search increments (default: 0.1).
limit (float, optional) – Maximum displacement limit (default: 1).
output_setting (int, optional) – Output verbosity setting (default: 0).
- Returns:
Filename of the grid search results.
- Return type:
str
- Raises:
RuntimeError – If the grid search LAMMPS run fails.
- run_minimization(file_name, disp_along_gb_period, disp_along_tilt_axis, minimization_along_gb_directions=False, number_of_cores=6)[source]
Runs a minimization calculation using LAMMPS.
- Parameters:
file_name (str) – Base filename for input/output files.
disp_along_gb_period (float) – Displacement along grain boundary period.
disp_along_tilt_axis (float) – Displacement along tilt axis.
minimization_along_gb_directions (bool, optional) – Whether to perform box relaxations (default: False).
- Returns:
Filename of the minimized structure output.
- Return type:
str
- Raises:
RuntimeError – If the minimization LAMMPS run fails.
- run_neb_calc(burgers_vector, step_height, number_of_steps, partitions=40, mode=1)[source]
Runs the NEB calculation using MPI-parallelized LAMMPS.
- Parameters:
burgers_vector (float) – Burgers vector magnitude.
step_height (float) – Step height.
number_of_steps (int) – Number of NEB steps.
partitions (int, optional) – Number of parallel partitions (default: 40).
mode (int, optional) – Mode flag for NEB input script generation (default: 1).
- Raises:
RuntimeError – If the NEB LAMMPS run fails.
- write_lammps_gridsearch_input(infile, outfolder, step_increments, limit, output_setting=0)[source]
Writes a LAMMPS input script for performing a grid search over displacements.
- Parameters:
infile (str) – Name of the input data file.
outfolder (str) – Output folder to store results.
step_increments (float) – Incremental displacement step size.
limit (float) – Maximum displacement limit in both directions.
output_setting (int) – Flag to enable detailed output; 1 enables additional dumps.
- write_lammps_neb_input_script(burgers_vector, step_height, num_steps, partitions, mode=1)[source]
Writes a LAMMPS input script for Nudged Elastic Band (NEB) calculations.
- Parameters:
burgers_vector (float) – Burgers vector magnitude for disconnection.
step_height (float) – Step height for the disconnection mode.
num_steps (int) – Number of NEB images (steps).
partitions (int) – Number of parallel partitions for NEB.
mode (int) – Mode flag controlling file naming and step count behavior.
- Returns:
Path to the output folder for NEB calculation results.
- Return type:
str
- write_minimization_input(file_name, dispy, dispz, minimization_along_gb_directions=False)[source]
Writes a LAMMPS input script for energy minimization with optional box relaxation.
- Parameters:
file_name (str) – Base filename for input/output.
dispy (float) – Displacement along grain boundary periodic direction.
dispz (float) – Displacement along tilt axis.
minimization_along_gb_directions (bool) – If True, performs additional minimization steps with box relaxation along y and z directions.