Beispiel #1
0
def load_rmg_database(
    rmg_database: Type[RMGDatabase],
    species_dict: dict,
    output_dict: dict,
) -> None:
    """
    Load the RMG database.

    Args:
        rmg_database (RMGDatabase, optional): The RMG database object.
        species_dict (dict): Keys are labels, values are ARCSpecies objects.
        output_dict (dict): Keys are labels, values are output file paths.
                            See Scheduler for a description of this dictionary.
    """
    load_thermo_libs, load_kinetic_libs = False, False
    if any([
            species.is_ts and output_dict[species.label]['convergence']
            for species in species_dict.values()
    ]):
        load_kinetic_libs = True
    if any([
            species.compute_thermo
            and output_dict[species.label]['convergence']
            for species in species_dict.values()
    ]):
        load_thermo_libs = True
    if rmg_database is not None and (load_kinetic_libs or load_thermo_libs):
        rmgdb.load_rmg_database(rmgdb=rmg_database,
                                load_thermo_libs=load_thermo_libs,
                                load_kinetic_libs=load_kinetic_libs)
Beispiel #2
0
 def __init__(self, project, project_directory, species_dict, rxn_list, output, use_bac, model_chemistry,
              lib_long_desc, rmgdatabase, t_min=None, t_max=None, t_count=None, freq_scale_factor=None):
     self.rmgdb = rmgdatabase
     self.project = project
     self.project_directory = project_directory
     self.species_dict = species_dict
     self.rxn_list = rxn_list
     self.output = output
     self.use_bac = use_bac
     self.sp_level, self.freq_level = process_model_chemistry(model_chemistry)
     self.freq_scale_factor = freq_scale_factor
     self.lib_long_desc = lib_long_desc
     load_thermo_libs, load_kinetic_libs = False, False
     if any([species.is_ts and species.final_xyz for species in self.species_dict.values()])\
             and any(['ALL converged' in out['status'] for out in output.values()]):
         load_kinetic_libs = True
     if any([species.generate_thermo for species in self.species_dict.values()])\
             and any(['ALL converged' in out['status'] for out in output.values()]):
         load_thermo_libs = True
     if any(['ALL converged' in spc_output_dict['status'] for spc_output_dict in output.values()]):
         rmgdb.load_rmg_database(rmgdb=self.rmgdb, load_thermo_libs=load_thermo_libs,
                                 load_kinetic_libs=load_kinetic_libs)
     t_min = t_min if t_min is not None else (300, 'K')
     t_max = t_max if t_max is not None else (3000, 'K')
     if isinstance(t_min, (int, float)):
         t_min = (t_min, 'K')
     if isinstance(t_max, (int, float)):
         t_max = (t_max, 'K')
     self.t_min = (t_min[0], str(t_min[1]))
     self.t_max = (t_max[0], str(t_max[1]))
     self.t_count = t_count if t_count is not None else 50
Beispiel #3
0
 def __init__(self,
              project,
              project_directory,
              species_dict,
              rxn_list,
              output,
              use_bac,
              model_chemistry,
              lib_long_desc,
              rmgdatabase,
              t_min=None,
              t_max=None,
              t_count=None):
     self.rmgdb = rmgdatabase
     self.project = project
     self.project_directory = project_directory
     self.species_dict = species_dict
     self.rxn_list = rxn_list
     self.output = output
     self.use_bac = use_bac
     self.model_chemistry = model_chemistry
     self.lib_long_desc = lib_long_desc
     load_thermo_libs, load_kinetic_libs = True, True
     if not any([
             species.is_ts and species.final_xyz
             for species in self.species_dict.values()
     ]):
         load_kinetic_libs = False  # don't load reaction libraries, not TS has converged
     if not any([
             species.generate_thermo
             for species in self.species_dict.values()
     ]):
         load_thermo_libs = False  # don't load thermo libraries, not thermo requested
     rmgdb.load_rmg_database(rmgdb=self.rmgdb,
                             load_thermo_libs=load_thermo_libs,
                             load_kinetic_libs=load_kinetic_libs)
     t_min = t_min if t_min is not None else (300, 'K')
     t_max = t_max if t_max is not None else (3000, 'K')
     if isinstance(t_min, (int, float)):
         t_min = (t_min, 'K')
     if isinstance(t_max, (int, float)):
         t_max = (t_max, 'K')
     self.t_min = (t_min[0], str(t_min[1]))
     self.t_max = (t_max[0], str(t_max[1]))
     self.t_count = t_count if t_count is not None else 50
Beispiel #4
0
 def setUpClass(cls):
     """
     A method that is run before all unit tests in this class.
     """
     cls.rmgdb = rmgdb.make_rmg_database_object()
     rmgdb.load_rmg_database(rmgdb=cls.rmgdb)