def write_configuration_file(filename='pyposmat.config'): configuration = PyposmatConfigurationFile() configuration.qois = qoi_db.qois configuration.qoi_constraints = qoi_constraints configuration.structures = structure_db configuration.potential = potential_formalism configuration.sampling_type = sampling configuration.sampling_distribution = parameter_distribution configuration.sampling_constraints = parameter_constraints configuration.write(filename=filename)
qoi_db.add_qoi(qoi_name="MgO_NaCl.G", qoi_type='shear_modulus', structures=OrderedDict([('ideal', 'MgO_NaCl')]), target=92.66) qoi_db.add_qoi(qoi_name="MgO_NaCl.001s", qoi_type="E_surface", structures=OrderedDict([ ('slab', 'MgO_NaCl_001s'), ('ideal', 'MgO_NaCl'), ], ), target=0.05595) qoi_constraints = OrderedDict() #------------------------------------------------------------------------------ # WRITE CONFIGURATION FILE # this is currently creating a race condition, where the file is being written # by multiple ranks to the same location. #------------------------------------------------------------------------------ if __name__ == '__main__': from pypospack.pyposmat.data import PyposmatConfigurationFile pyposmat_filename_in = 'pyposmat.config.in' configuration = PyposmatConfigurationFile() configuration.qois = qoi_db.qois configuration.qoi_constraints = qoi_constraints configuration.structures = structure_db configuration.potential = potential_formalism configuration.sampling_type = sampling configuration.sampling_distribution = parameter_distribution configuration.sampling_constraints = parameter_constraints configuration.write(filename=pyposmat_filename_in)