ReactionMechanismGenerator / ARC

ARC - Automatic Rate Calculator
https://reactionmechanismgenerator.github.io/ARC/index.html
MIT License
43 stars 21 forks source link

bc_length: ZeroDivisionError: float division by zero #638

Closed calvinp0 closed 1 year ago

calvinp0 commented 1 year ago

Describe the bug

Appears that the branch chain length is equating to zero

Traceback (most recent call last):
  File "/home/calvin.p/Code/ARC//ARC.py", line 69, in <module>
    main()
  File "/home/calvin.p/Code/ARC//ARC.py", line 65, in main
    arc_object.execute()
  File "/home/calvin.p/Code/ARC/arc/main.py", line 583, in execute
    fine_only=self.fine_only,
  File "/home/calvin.p/Code/ARC/arc/scheduler.py", line 486, in __init__
    self.schedule_jobs()
  File "/home/calvin.p/Code/ARC/arc/scheduler.py", line 575, in schedule_jobs
    self.spawn_post_opt_jobs(label=label, job_name=job_name)
  File "/home/calvin.p/Code/ARC/arc/scheduler.py", line 1459, in spawn_post_opt_jobs
    self.spawn_ts_jobs()
  File "/home/calvin.p/Code/ARC/arc/scheduler.py", line 1483, in spawn_ts_jobs
    tsg=tsg_index,
  File "/home/calvin.p/Code/ARC/arc/scheduler.py", line 832, in run_job
    job.execute()
  File "/home/calvin.p/Code/ARC/arc/job/adapter.py", line 317, in execute
    self.execute_incore()
  File "/home/calvin.p/Code/ARC/arc/job/adapters/ts/heuristics.py", line 280, in execute_incore
    dihedral_increment=self.dihedral_increment,
  File "/home/calvin.p/Code/ARC/arc/job/adapters/ts/heuristics.py", line 1012, in h_abstraction
    reactants_reversed=reactants_reversed,
  File "/home/calvin.p/Code/ARC/arc/job/adapters/ts/heuristics.py", line 469, in combine_coordinates_with_redundant_atoms
    reactants_reversed=reactants_reversed,
  File "/home/calvin.p/Code/ARC/arc/job/adapters/ts/heuristics.py", line 668, in get_modified_params_from_zmat_2
    reactants_reversed=reactants_reversed,
  File "/home/calvin.p/Code/ARC/arc/job/adapters/ts/heuristics.py", line 703, in get_new_zmat_2_map
    spc_from_zmat_2 = ARCSpecies(label='spc_from_zmat_2', xyz=zmat_2_mod)
  File "/home/calvin.p/Code/ARC/arc/species/species.py", line 434, in __init__
    self.process_xyz(xyz)
  File "/home/calvin.p/Code/ARC/arc/species/species.py", line 1589, in process_xyz
    xyzs.append(remove_dummies(check_xyz_dict(xyz)))
  File "/home/calvin.p/Code/ARC/arc/species/converter.py", line 695, in check_xyz_dict
    xyz_dict = zmat_to_xyz(zmat=xyz_dict, keep_dummy=False)
  File "/home/calvin.p/Code/ARC/arc/species/converter.py", line 845, in zmat_to_xyz
    coords, symbols = zmat_to_coords(zmat, keep_dummy=keep_dummy)
  File "/home/calvin.p/Code/ARC/arc/species/zmat.py", line 1021, in zmat_to_coords
    coords = _add_nth_atom_to_coords(zmat=zmat, 

coords=coords, i=i, coords_to_skip=coords_to_skip)
  File "/home/calvin.p/Code/ARC/arc/species/zmat.py", line 1098, in _add_nth_atom_to_coords
    ubc = [(coords[c_index][0] - coords[b_index][0]) / bc_length,
ZeroDivisionError: float division by zero

How to reproduce Insert code to reproduce this behavior.

Expected behavior A clear and concise description of what you expected to happen.

Additional context

Here is my input file: input.zip

However, this has been occurring on multiple input files

Possibly related to #565

calvinp0 commented 1 year ago

image

As can be seen in the picture, the coords of zmat 1 and zmat 2 are somewhat similar (not the vars) - whereas we expected zmat 2 to be similar in construction to this (if I understand correctly)

        zmat2 = {'symbols': ('H', 'H', 'H', 'H', 'C'),
                 'coords': ((None, None, None),  # H2, redundant H atom, will be united with H1
                            ('R_5_4' * r2_stretch, a2 (B-H-A) = 'A_5_4_0', d2 (B-H-A-C) = 'D_5_4_0_1'),  # 5, atom B
                            ('R_6_5', 'A_6_5_4', d3 (D-B-H-A) = 'D_6_5_4_0'),  # 6, atom D
                            ('R_7_6', 'A_7_6_4', 'D_7_6_4_5'),  # 7
                            ('R_8_7', 'A_8_7_6', 'D_8_7_6_5')),  # 8
alongd commented 1 year ago

I have a stall PR that should fix this (https://github.com/ReactionMechanismGenerator/ARC/pull/595), I'll try to revive it