Skip to content

Commit f44482c

Browse files
authored
Add files via upload
1 parent 494b089 commit f44482c

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

multioptpy/Calculator/ase_calculation_tools.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def calc_exact_hess(self, calc_obj, positions, element_list):
9191
if self.software_type == "gaussian":
9292
print("Calculating exact Hessian using Gaussian...")
9393
exact_hess = calc_obj.calc_analytic_hessian() # in hartree/Bohr^2
94-
94+
elif self.software_type == "orca":
95+
hess_path = calc_obj.run_frequency_analysis()
96+
exact_hess = calc_obj.get_hessian_matrix(hess_path)
9597
else:
9698
vib = Vibrations(atoms=calc_obj.atom_obj, delta=0.001, name="z_hess_"+timestamp)
9799
vib.run()
@@ -126,7 +128,7 @@ def single_point(self, file_directory, element_list, iter, electric_charge_and_m
126128
file_list = glob.glob(file_directory+"/*_[0-9].xyz")
127129

128130
for num, input_file in enumerate(file_list):
129-
try:
131+
if True:#try:
130132
if geom_num_list is None:
131133
positions, _, electric_charge_and_multiplicity = xyz2list(input_file, electric_charge_and_multiplicity)
132134
else:
@@ -157,11 +159,11 @@ def single_point(self, file_directory, element_list, iter, electric_charge_and_m
157159
elif iter % self.FC_COUNT == 0 or self.hessian_flag:
158160
# exact numerical hessian
159161
_ = self.calc_exact_hess(calc_obj, positions, element_list)
160-
except Exception as error:
161-
print(error)
162-
print("This molecule could not be optimized.")
163-
finish_frag = True
164-
return np.array([0]), np.array([0]), np.array([0]), finish_frag
162+
#except Exception as error:
163+
# print(error)
164+
# print("This molecule could not be optimized.")
165+
# finish_frag = True
166+
# return np.array([0]), np.array([0]), np.array([0]), finish_frag
165167

166168
positions /= self.bohr2angstroms
167169
self.energy = e
@@ -288,7 +290,10 @@ def calculate(self, file_directory, optimize_num, pre_total_velocity, config):
288290
timestamp = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S_%f")[:-2]
289291
if software_type == "gaussian":
290292
exact_hess = calc_obj.calc_analytic_hessian() # in hartree/Bohr^2
291-
exact_hess = exact_hess
293+
294+
elif software_type == "orca":
295+
hess_path = calc_obj.run_frequency_analysis()
296+
exact_hess = calc_obj.get_hessian_matrix(hess_path)
292297
else:
293298
vib = Vibrations(atoms=calc_obj.atom_obj, delta=0.001, name="z_hess_"+timestamp)
294299
vib.run()

0 commit comments

Comments
 (0)