1010
1111
1212class TestDriver (SingleCrystalTestDriver ):
13- def _calculate (self , timestep : float , number_sampling_timesteps : int = 100 , repeat : Sequence [int ] = (0 , 0 , 0 ),
14- lammps_command = "lmp" , msd_threshold : float = 0.1 , random_seed : int = 1 , ** kwargs ) -> None :
13+ def _calculate (self , timestep_ps : float , number_sampling_timesteps : int = 100 , repeat : Sequence [int ] = (0 , 0 , 0 ),
14+ lammps_command = "lmp" , msd_threshold_angstrom_squared_per_hundred_timesteps : float = 0.1 ,
15+ random_seed : int = 1 , ** kwargs ) -> None :
1516 """
1617 Compute crystal structure at constant pressure and temperature (NPT) with a Lammps molecular-dynamics simulation.
1718
@@ -32,10 +33,10 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
3233
3334 All output files are written to the "output" directory.
3435
35- :param timestep :
36+ :param timestep_ps :
3637 Time step in picoseconds.
3738 Should be bigger than zero.
38- :type timestep : float
39+ :type timestep_ps : float
3940 :param number_sampling_timesteps:
4041 Sample thermodynamic variables every number_sampling_timesteps timesteps in Lammps.
4142 Should be bigger than zero.
@@ -51,11 +52,11 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
5152 Command to run Lammps.
5253 Default is "lmp".
5354 :type lammps_command: str
54- :param msd_threshold :
55+ :param msd_threshold_angstrom_squared_per_hundred_timesteps :
5556 Mean-squared displacement threshold in Angstroms^2 per 100*timestep to detect melting or vaporization.
5657 Default is 0.1.
5758 Should be bigger than zero.
58- :type msd_threshold : float
59+ :type msd_threshold_angstrom_squared_per_hundred_timesteps : float
5960 :param random_seed:
6061 Random seed for Lammps simulation.
6162 Default is 1.
@@ -93,7 +94,7 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
9394 raise ValueError ("The off-diagonal entries of the stress tensor have to be zero so that a hydrostatic "
9495 "pressure is used." )
9596
96- if not timestep > 0.0 :
97+ if not timestep_ps > 0.0 :
9798 raise ValueError ("Timestep has to be larger than zero." )
9899
99100 if not number_sampling_timesteps > 0 :
@@ -105,7 +106,7 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
105106 if not all (r >= 0 for r in repeat ):
106107 raise RuntimeError ("All number of repeats must be bigger than zero." )
107108
108- if not msd_threshold > 0.0 :
109+ if not msd_threshold_angstrom_squared_per_hundred_timesteps > 0.0 :
109110 raise RuntimeError ("The mean-squared displacement threshold has to be bigger than zero." )
110111
111112 if not random_seed > 0 :
@@ -172,8 +173,9 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
172173
173174 # Run single Lammps simulation.
174175 log_filename , restart_filename , average_position_filename , average_cell_filename = run_lammps (
175- self .kim_model_name , temperature_K , pressure_bar , timestep , number_sampling_timesteps , species ,
176- msd_threshold , lammps_command = lammps_command , random_seed = random_seed )
176+ self .kim_model_name , temperature_K , pressure_bar , timestep_ps , number_sampling_timesteps , species ,
177+ msd_threshold_angstrom_squared_per_hundred_timesteps , lammps_command = lammps_command ,
178+ random_seed = random_seed )
177179
178180 # Check that crystal did not melt or vaporize.
179181 with open (log_filename , "r" ) as f :
0 commit comments