Skip to content

Commit

Permalink
Only add a species to the thermo library if requested (#612)
Browse files Browse the repository at this point in the history
Here we add a new attribute to ARCSpecies, `include_in_thermo_lib`
We already have an attribute called `compute_thermo`, which will cause
ARC not to process the species via statmech. The new attribute will make
ARC compute thermo data, but it won't be included in the final RMG
thermo library output.
The rational is to facilitate a new T3 feature where species that
participate in reactions we compute will not end up in the thermo
library if their thermo data is already known to a satisfactory
precision. However, for post-analysis purposes, it could still be
beneficial to have the thermo data already process by ARC/Arkane.
  • Loading branch information
alongd committed Mar 18, 2023
2 parents 3ef2a75 + 6e1dac2 commit 6d91cd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arc/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def save_thermo_lib(species_list: list,
lib_path = os.path.join(path, 'thermo', f'{name}.py')
thermo_library = ThermoLibrary(name=name, long_desc=lib_long_desc)
for i, spc in enumerate(species_list):
if spc.thermo is not None:
if spc.thermo is not None and spc.include_in_thermo_lib:
spc.long_thermo_description += f'\nExternal symmetry: {spc.external_symmetry}, ' \
f'optical isomers: {spc.optical_isomers}\n'
spc.long_thermo_description += f'\nGeometry:\n{xyz_to_str(spc.final_xyz)}'
Expand Down
7 changes: 7 additions & 0 deletions arc/species/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class ARCSpecies(object):
bond_corrections (dict, optional): The bond additivity corrections (BAC) to be used. Determined from the
structure if not directly given.
compute_thermo (bool, optional): Whether to calculate thermodynamic properties for this species.
include_in_thermo_lib (bool, optional): Whether to include in the output RMG library.
e0_only (bool, optional): Whether to only run statmech (w/o thermo) to compute E0.
species_dict (dict, optional): A dictionary to create this object from (used when restarting ARC).
yml_path (str, optional): Path to an Arkane YAML file representing a species (for loading the object).
Expand Down Expand Up @@ -225,6 +226,7 @@ class ARCSpecies(object):
t1 (float): The T1 diagnostic parameter from Molpro.
neg_freqs_trshed (list): A list of negative frequencies this species was troubleshooted for.
compute_thermo (bool): Whether to calculate thermodynamic properties for this species.
include_in_thermo_lib (bool): Whether to include in the output RMG library.
e0_only (bool): Whether to only run statmech (w/o thermo) to compute E0.
thermo (HeatCapacityModel): The thermodata calculated by ARC.
rmg_thermo (HeatCapacityModel): The thermodata generated by RMG for comparison.
Expand Down Expand Up @@ -294,6 +296,7 @@ def __init__(self,
charge: Optional[int] = None,
checkfile: Optional[str] = None,
compute_thermo: Optional[bool] = None,
include_in_thermo_lib: Optional[bool] = True,
consider_all_diastereomers: bool = True,
directed_rotors: Optional[dict] = None,
e0_only: bool = False,
Expand Down Expand Up @@ -388,6 +391,7 @@ def __init__(self,
self.chosen_ts_method = None
self.chosen_ts_list = list()
self.compute_thermo = compute_thermo if compute_thermo is not None else not self.is_ts
self.include_in_thermo_lib = include_in_thermo_lib
self.e0_only = e0_only
self.long_thermo_description = ''
self.opt_level = None
Expand Down Expand Up @@ -620,6 +624,8 @@ def as_dict(self,
species_dict['multiplicity'] = self.multiplicity
species_dict['charge'] = self.charge
species_dict['compute_thermo'] = self.compute_thermo
if not self.include_in_thermo_lib:
species_dict['include_in_thermo_lib'] = self.include_in_thermo_lib
species_dict['number_of_rotors'] = self.number_of_rotors
if self.external_symmetry is not None:
species_dict['external_symmetry'] = self.external_symmetry
Expand Down Expand Up @@ -786,6 +792,7 @@ def from_dict(self, species_dict):
self.multiplicity = species_dict['multiplicity'] if 'multiplicity' in species_dict else None
self.charge = species_dict['charge'] if 'charge' in species_dict else 0
self.compute_thermo = species_dict['compute_thermo'] if 'compute_thermo' in species_dict else not self.is_ts
self.include_in_thermo_lib = species_dict['include_in_thermo_lib'] if 'include_in_thermo_lib' in species_dict else True
self.e0_only = species_dict['e0_only'] if 'e0_only' in species_dict else False
self.number_of_radicals = species_dict['number_of_radicals'] if 'number_of_radicals' in species_dict else None
self.opt_level = species_dict['opt_level'] if 'opt_level' in species_dict else None
Expand Down

0 comments on commit 6d91cd7

Please sign in to comment.