def test_custom_smd_write(self): dict_set = GSMDictSet(basis_set='6-31g*', scf_algorithm='diis', dft_rung=5, smd_solvent="custom", custom_smd="90.00,1.415,0.00,0.735,20.2,0.00,0.00", max_scf_cycles=35) dict_set.write("mol.qin") test_dict = QCTemplate.from_file("mol.qin").as_dict() rem = { "job_type": "force", "basis": "6-31G*", "max_scf_cycles": '35', "method": "wb97mv", "gen_scfman": 'true', "scf_algorithm": "diis", "xc_grid": '3', "solvent_method": "smd", "ideriv": "1", 'symmetry': 'false', 'sym_ignore': 'true', 'resp_charges': 'true' } qc_input = QCTemplate(rem=rem, smx={"solvent": "other"}) for k, v in qc_input.as_dict().items(): self.assertEqual(v, test_dict[k]) os.remove("mol.qin") with open("solvent_data") as sd: lines = sd.readlines() self.assertEqual(lines[0], "90.00,1.415,0.00,0.735,20.2,0.00,0.00") os.remove("solvent_data")
def test_pcm_write(self): dict_set = GSMDictSet(basis_set='6-31g*', scf_algorithm='diis', dft_rung=5, pcm_dielectric=10.0, max_scf_cycles=35) dict_set.write("mol.qin") test_dict = QCTemplate.from_file("mol.qin").as_dict() rem = { "job_type": "force", "basis": "6-31G*", "max_scf_cycles": '35', "method": "wb97mv", "gen_scfman": 'true', "scf_algorithm": "diis", "xc_grid": '3', "solvent_method": "pcm", 'symmetry': 'false', 'sym_ignore': 'true', 'resp_charges': 'true' } pcm = { "heavypoints": "194", "hpoints": "194", "radii": "uff", "theory": "cpcm", "vdwscale": "1.1" } qc_input = QCTemplate(rem=rem, pcm=pcm, solvent={"dielectric": "10.0"}) for k, v in qc_input.as_dict().items(): self.assertEqual(v, test_dict[k]) os.remove("mol.qin")