def __init__(self, parameters, **kwargs): BatchJob.__init__(self, **kwargs) self.params = parameters self.paramNames = parameters.keys() # Check lengths: npar = len(self.paramNames) nval = np.array([len(self.params[k]) for k in self.params]) if not np.all(nval == nval[0]): print "ConvergenceTest initialization error: \n" + \ " The number of values must be the same for all the parameters specified!" sys.exit(1) # Add batch steps for i in range(1, nval[0] + 1): print "Adding step", i p = {} for k in self.paramNames: p[k] = str(self.params[k][i - 1]) step = ConvergenceTestStep(i, p) for template_name in BatchStep.input_files.keys(): # use index-less 'template' file step[template_name] = template_name self.add_step(step) self.print_info()
def __init__(self, lattice_parameters, **kwargs): """ Create a VolumeTestCubicUnitCell object. Parameters ---------- lattice_parameters : array of lattice parameters to test. A set of POSCAR files named POSCAR.1, POSCAR.2, ... will be created based on the file POSCAR with the second line replaced with each of these values. The remaining parameters are passed over to BatchJob. Please see BatchJob for help on these. """ BatchJob.__init__(self, **kwargs) self.paramName = 'VOL' # summary file header for idx,param in enumerate(lattice_parameters): step = VolumeTestStep(idx+1, float(param)) step.latticeparameter = param for template_name in BatchStep.input_files.keys(): # use index-less 'template' file step[template_name] = template_name self.add_step(step) self.print_info()
def __init__(self, lattice_parameters, **kwargs): """ Create a VolumeTestCubicUnitCell object. Parameters ---------- lattice_parameters : array of lattice parameters to test. A set of POSCAR files named POSCAR.1, POSCAR.2, ... will be created based on the file POSCAR with the second line replaced with each of these values. The remaining parameters are passed over to BatchJob. Please see BatchJob for help on these. """ BatchJob.__init__(self, **kwargs) self.paramName = 'VOL' # summary file header for idx, param in enumerate(lattice_parameters): step = VolumeTestStep(idx + 1, float(param)) step.latticeparameter = param for template_name in BatchStep.input_files.keys(): # use index-less 'template' file step[template_name] = template_name self.add_step(step) self.print_info()
def __init__(self, parameters, **kwargs): BatchJob.__init__(self, **kwargs) self.params = parameters self.paramNames = parameters.keys() # Check lengths: npar = len(self.paramNames) nval = np.array([len(self.params[k]) for k in self.params]) if not np.all(nval == nval[0]): print "ConvergenceTest initialization error: \n" + \ " The number of values must be the same for all the parameters specified!" sys.exit(1) # Add batch steps for i in range(1,nval[0]+1): print "Adding step",i p = {} for k in self.paramNames: p[k] = str(self.params[k][i-1]) step = ConvergenceTestStep(i,p) for template_name in BatchStep.input_files.keys(): # use index-less 'template' file step[template_name] = template_name self.add_step(step) self.print_info()