def write_configuration_file(qoi_name,qoi_type,structures,target): qoidb = QoiDatabase() qoidb.add_qoi( qoi_name=qoi_name, qoi_type=qoi_type, structures=structures, target=target ) potential = OrderedDict() potential['potential_type'] = 'buckingham' potential['symbols'] = ['Mg','O'] potential['cutoff_global'] = 10.0 structures = OrderedDict() structures['structure_directory'] = 'test_PypospackEngine' structures['structures'] = OrderedDict() structures['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' configuration = PyposmatConfigurationFile() configuration.qois = qoidb.qois configuration.potential = potential configuration.structures = structures configuration.write(filename='pyposmat.config.in')
import scipy.stats import Ni__eam__morse_exp_universal as Ni_eam filename_out = 'pypospack.results.out' #------------------------------------------------------------------------------ # WRITE CONFIGURATION FILE #------------------------------------------------------------------------------ Ni_eam_configuration = PyposmatConfigurationFile() Ni_eam_configuration.qois = Ni_eam.Ni_qoi_db.qois Ni_eam_configuration.potential = Ni_eam.Ni_eam_potential_formalism Ni_eam_configuration.structures = Ni_eam.Ni_structure_db Ni_eam_configuration.sampling_type = Ni_eam.Ni_eam_sampling Ni_eam_configuration.sampling_distribution = Ni_eam.Ni_eam_parameter_distribution Ni_eam_configuration.write(filename='pypospack.config.in') Ni_eam_configuration.read(filename='pypospack.config.in') # <---------------- end make configuration file filename_in = 'pypospack.config.in' filename_out = 'pypospack.results.out' engine = PyposmatMonteCarloSampler(filename_in=filename_in, filename_out=filename_out) # <---------------- printout for debugging purposes print('base_directory:{}'.format(engine.base_directory)) print('input_filename:{}'.format(engine.pyposmat_filename_in)) print('output_filename:{}'.format(engine.pyposmat_filename_out)) # <---------------- the steps of engine.configure() tested individually # this is the step which configures the object from the # configuration file
print(80*'-') for qoi_name, value in MgO_qoi_constraints.items(): print('{:>20} {:>10}'.format(qoi_name,value)) MgO_structures = OrderedDict() MgO_structures['structure_directory'] = 'test__PyposmatMonteCarloSampler' MgO_structures['structures'] = OrderedDict() MgO_structures['structures']['MgO_NaCl'] = 'MgO_NaCl_unit.gga.relax.vasp' MgO_configuration = PyposmatConfigurationFile() MgO_configuration.qois = MgO_qoi_db.qois MgO_configuration.potential = MgO_potential MgO_configuration.structures = MgO_structures assert isinstance(MgO_configuration.configuration,OrderedDict) MgO_configuration.write(filename='pypospack.config.in') MgO_configuration.read(filename='pypospack.config.in') # <---------------- end make configuration file filename_in='pypospack.config.in' filename_out='pypospack.results.out' engine = PyposmatMonteCarloSampler( filename_in=filename_in, filename_out=filename_out) # <---------------- printout for debugging purposes print('base_directory:{}'.format(engine.base_directory)) print('input_filename:{}'.format(engine.pyposmat_filename_in)) print('output_filename:{}'.format(engine.pyposmat_filename_out)) # <---------------- the steps of engine.configure() tested individually # this is the step which configures the object from the
Si_sw_structures['structure_directory'] = 'test__PyposmatMonteCarloSampler' Si_sw_structures['structures'] = OrderedDict() Si_sw_structures['structures']['Si'] = 'Si_dia_unit.vasp' Si_sw_structures['structures']['Si_vac'] = 'Si_vac_333.vasp' #------------------------------------------------------------------------------ # WRITE CONFIGURATION FILE #------------------------------------------------------------------------------ Si_sw_configuration = PyposmatConfigurationFile() Si_sw_configuration.qois = Si_sw_qoi_db.qois Si_sw_configuration.potential = Si_sw_potential Si_sw_configuration.structures = Si_sw_structures Si_sw_configuration.sampling_type = sampling Si_sw_configuration.sampling_distribution = Si_sw_param_dist Si_sw_configuration.write(filename='pypospack.config.in') Si_sw_configuration.read(filename='pypospack.config.in') # <---------------- end make configuration file filename_in='pypospack.config.in' filename_out='pypospack.results.out' engine = PyposmatMonteCarloSampler( filename_in=filename_in, filename_out=filename_out) # <---------------- printout for debugging purposes print('base_directory:{}'.format(engine.base_directory)) print('input_filename:{}'.format(engine.pyposmat_filename_in)) print('output_filename:{}'.format(engine.pyposmat_filename_out)) # <---------------- the steps of engine.configure() tested individually # this is the step which configures the object from the