pyiron.thermodynamics.interfacemethod module¶
pyiron based implementation of the coexistence method. Currently this functionality is primarly used as part of the melting point simulation protocol which is available at: https://github.com/pyiron/pyiron_meltingpoint
-
pyiron.thermodynamics.interfacemethod.
analyse_minimized_structure
(ham)[source]¶ - Parameters
ham (GenericJob) –
Returns:
-
pyiron.thermodynamics.interfacemethod.
analyse_structure
(structure, mode='total', diamond=False)[source]¶ Use either common neighbor analysis or the diamond structure detector
- Parameters
structure (pyiron.structure.atoms.Atoms) – The structure to analyze.
mode ("total"/"numeric"/"str") –
Controls the style and level of detail of the output. - total : return number of atoms belonging to each structure - numeric : return a per atom list of numbers- 0 for unknown,
1 fcc, 2 hcp, 3 bcc and 4 icosa
str : return a per atom string of sructures
diamond (bool) – Flag to either use the diamond structure detector or the common neighbor analysis.
- Returns
(depends on mode)
-
pyiron.thermodynamics.interfacemethod.
calc_temp_iteration
(basis, temperature_next, project_parameter, timestep, nve_run_time_steps, fit_range, center, debug_plot=True)[source]¶ - Parameters
basis –
temperature_next –
project_parameter –
timestep –
nve_run_time_steps –
fit_range –
center –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
check_diamond
(structure)[source]¶ Utility function to check if the structure is fcc, bcc, hcp or diamond
- Parameters
structure (pyiron.structure.atoms.Atoms) – Atomistic Structure object to check
- Returns
true if diamond else false
- Return type
bool
-
pyiron.thermodynamics.interfacemethod.
check_for_holes
(temperature_next, strain_value_lst, nve_run_time_steps, project_parameter, debug_plot=True)[source]¶ - Parameters
temperature_next –
strain_value_lst –
nve_run_time_steps –
project_parameter –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
create_job_template
(job_name, structure, project_parameter)[source]¶ Create a job template using the project_parameter dictionary. The dictionary has to contain the following keys: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
job_name (str) – Name of the job object
structure (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
project_parameter (dict) – Dictionary with the project parameters
- Returns
New job object
- Return type
GenericJob
-
pyiron.thermodynamics.interfacemethod.
fix_iso
(job)[source]¶ Add couple xyz to the fix_ensemble inside LAMMPS
- Parameters
job (LAMMPS) – Lammps job object
- Returns
Return updated job object
- Return type
LAMMPS
-
pyiron.thermodynamics.interfacemethod.
fix_z_dir
(job)[source]¶ Rather than fixing all directions only fix the z-direction during an NPT simulation
- Parameters
job (LAMMPS) – Lammps job object
- Returns
Return updated job object
- Return type
LAMMPS
-
pyiron.thermodynamics.interfacemethod.
freeze_one_half
(basis)[source]¶ Split the structure into two parts along the z-axis and then freeze the position of the atoms of the upper part (z>0.5) by setting selective dynamics to False.
- Parameters
basis (pyiron.structure.atoms.Atoms) – Atomistic structure object
- Returns
Atomistic structure object with half of the atoms fixed
- Return type
pyiron.structure.atoms.Atoms
-
pyiron.thermodynamics.interfacemethod.
generate_random_seed
(project_parameter)[source]¶ Generate random seed for project parameters
- Parameters
project_parameter (dict) –
- Returns
The project parameters dictionary including the key ‘seed’
- Return type
dict
-
pyiron.thermodynamics.interfacemethod.
generate_structure
(project_parameter)[source]¶ - Parameters
project_parameter –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_center_point
(strain_result_lst=None, pressure_result_lst=None, center=None)[source]¶ - Parameters
strain_result_lst –
pressure_result_lst –
center –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_initial_melting_temperature_guess
(project_parameter, ham_minimize_vol, temperature_next=None)[source]¶ - Parameters
project_parameter –
ham_minimize_vol –
temperature_next –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_nve_job_name
(temperature_next, strain, steps_lst, nve_run_time_steps)[source]¶ - Parameters
temperature_next –
strain –
steps_lst –
nve_run_time_steps –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_press
(ham, step=20)[source]¶ - Parameters
ham –
step –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_strain_lst
(fit_range=0.02, points=21, strain_result_lst=None, pressure_result_lst=None, center=None)[source]¶ - Parameters
fit_range –
points –
strain_result_lst –
pressure_result_lst –
center –
Returns:
-
pyiron.thermodynamics.interfacemethod.
get_voronoi_volume
(temperature_next, strain_lst, nve_run_time_steps, project_parameter)[source]¶ - Parameters
temperature_next –
strain_lst –
nve_run_time_steps –
project_parameter –
Returns:
-
pyiron.thermodynamics.interfacemethod.
half_velocity
(job, temperature)[source]¶ Rather than setting twice the kinetic energy at the beginning of a molecular dynamics simulation reduce the velocity to half the initial velocity. This is required to continue MD claculation.
- Parameters
job (LAMMPS) – Lammps job object
temperature (float) – Temperature of the molecular dynamics calculation in K
- Returns
Return updated job object
- Return type
LAMMPS
-
pyiron.thermodynamics.interfacemethod.
initialise_iterators
(project_parameter)[source]¶ - Parameters
project_parameter –
Returns:
-
pyiron.thermodynamics.interfacemethod.
minimize_pos
(structure, project_parameter, max_iter=1000)[source]¶ Minimize the positions in a given structure using the job type defined in the project_parameters, which contains the following keys: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
structure (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
project_parameter (dict) – Dictionary wtih the project parameters
max_iter (int) – Maximum number of steps during minimization
- Returns
job object used to execute the calculation
-
pyiron.thermodynamics.interfacemethod.
minimize_vol
(structure, project_parameter, max_iter=1000)[source]¶ Minimize the volume for a given structure using the job type defined in the project_parameters, which contains the following keys: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
structure (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
project_parameter (dict) – Dictionary with the project parameters
max_iter (int) – Maximum number of steps during minimization
- Returns
job object used to execute the calculation
-
pyiron.thermodynamics.interfacemethod.
next_calc
(structure, temperature, project_parameter, run_time_steps=10000)[source]¶ Calculate NPT ensemble at a given temperature using the job defined in the project parameters: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
structure (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
temperature (float) – Temperature of the Molecular dynamics calculation
project_parameter (dict) – Dictionary with the project parameters
run_time_steps (int) – Number of Molecular dynamics steps
- Returns
Final Atomistic Structure object
-
pyiron.thermodynamics.interfacemethod.
next_step_funct
(number_of_atoms, key_max, structure_left, structure_right, temperature_left, temperature_right, distribution_initial_half, structure_after_minimization, run_time_steps, project_parameter)[source]¶ - Parameters
number_of_atoms –
key_max –
structure_left –
structure_right –
temperature_left –
temperature_right –
distribution_initial_half –
structure_after_minimization –
run_time_steps –
project_parameter –
Returns:
-
pyiron.thermodynamics.interfacemethod.
npt_liquid
(temperature_solid, temperature_liquid, basis, project_parameter, timestep=1.0)[source]¶ Calculate NPT ensemble at a given temperature while initally freezing the position of the atoms of the upper part (z>0.5) and afterwards calculating the full sample at a lower temperature. These steps are used to construct the solid liquid interface as part of the coexistence approach. For the calculations the job object is defined in the project parameters: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
temperature_solid (flaot) – Temperature to simulate the whole structure
temperature_liquid (float) – Temperature to simulate the upper half of the structure
basis (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
project_parameter (dict) – Dictionary with the project parameters
timestep (float) – Molecular dynamics time step
- Returns
job object used to execute the calculation
-
pyiron.thermodynamics.interfacemethod.
npt_solid
(temperature, basis, project_parameter, timestep=1.0)[source]¶ Calculate NPT ensemble at a given temperature using the job defined in the project parameters: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
temperature (float) – Temperature of the Molecular dynamics calculation
basis (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
project_parameter (dict) – Dictionary with the project parameters
timestep (float) – Molecular dynamics time step
- Returns
job object used to execute the calculation
-
pyiron.thermodynamics.interfacemethod.
plot_equilibration
(temperature_next, strain_lst, nve_run_time_steps, project_parameter, debug_plot=True)[source]¶ - Parameters
temperature_next –
strain_lst –
nve_run_time_steps –
project_parameter –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
plot_melting_point_prediction
(strain_value_lst, pressure_value_lst, temperature_value_lst, boundary_value=0.25, debug_plot=True)[source]¶ - Parameters
strain_value_lst –
pressure_value_lst –
temperature_value_lst –
boundary_value –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
plot_solid_liquid_ratio
(temperature_next, strain_lst, nve_run_time_steps, project_parameter, debug_plot=True)[source]¶ - Parameters
temperature_next –
strain_lst –
nve_run_time_steps –
project_parameter –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
ratio_selection
(strain_lst, ratio_lst, pressure_lst, temperature_lst, ratio_boundary, debug_plot=True)[source]¶ - Parameters
strain_lst –
ratio_lst –
pressure_lst –
temperature_lst –
ratio_boundary –
debug_plot –
Returns:
-
pyiron.thermodynamics.interfacemethod.
remove_selective_dynamics
(basis)[source]¶ If the selective dyanmics tag is set, allow all atoms to move by setting selective dynamics to True
- Parameters
basis (pyiron.structure.atoms.Atoms) – Atomistic structure object
- Returns
Atomistic structure object with selective dynamics set to True
- Return type
-
pyiron.thermodynamics.interfacemethod.
round_temperature_next
(temperature_next)[source]¶ Round temperature to the last two dicits
- Parameters
temperature_next (float) – Temperature
- Returns
rounded temperature
- Return type
float
-
pyiron.thermodynamics.interfacemethod.
set_server
(job, project_parameter)[source]¶ Set the potential, queue and cpu_cores defined in the project_parameter dictionary to the job object.
- Parameters
job (GenericJob) – Job object
project_parameter (dict) – Dictionary with the keys potential and cpu_cores and optionally queue
- Returns
Updated job object
- Return type
GenericJob
-
pyiron.thermodynamics.interfacemethod.
setup_liquid_job
(job_name, basis, temperature, project_parameter, timestep=1.0)[source]¶ Calculate NPT ensemble at a given temperature while freezing the position of the atoms of the upper part (z>0.5) amd the using the job defined in the project parameters: - job_type: Type of Simulation code to be used - project: Project object used to create the job - potential: Interatomic Potential - queue (optional): HPC Job queue to be used
- Parameters
job_name (str) – Job name for the liquid calculation
basis (pyiron.structure.atoms.Atoms) – Atomistic Structure object to be set to the job as input sturcture
temperature (float) – Temperature of the Molecular dynamics calculation
project_parameter (dict) – Dictionary with the project parameters
timestep (float) – Molecular dynamics time step
- Returns
job object used to execute the calculation
-
pyiron.thermodynamics.interfacemethod.
strain_circle
(basis_relative, temperature_next, nve_run_time_steps, project_parameter, timestep=1.0, strain_result_lst=None, pressure_result_lst=None, center=None, fit_range=0.02)[source]¶ - Parameters
basis_relative –
temperature_next –
nve_run_time_steps –
project_parameter –
timestep –
strain_result_lst –
pressure_result_lst –
center –
fit_range –
Returns:
-
pyiron.thermodynamics.interfacemethod.
validate_convergence
(pr, temperature_left, temperature_next, temperature_right, enable_iteration, timestep_iter, timestep_lst, timestep, fit_range_iter, fit_range_lst, fit_range, nve_run_time_steps_iter, nve_run_time_steps_lst, nve_run_time_steps, strain_result_lst, pressure_result_lst, step_count, step_dict, boundary_value, ratio_boundary, convergence_goal, output_file='melting.json')[source]¶ - Parameters
pr –
temperature_left –
temperature_next –
temperature_right –
enable_iteration –
timestep_iter –
timestep_lst –
timestep –
fit_range_iter –
fit_range_lst –
fit_range –
nve_run_time_steps_iter –
nve_run_time_steps_lst –
nve_run_time_steps –
strain_result_lst –
pressure_result_lst –
step_count –
step_dict –
boundary_value –
ratio_boundary –
convergence_goal –
output_file –
Returns: