Skip to content

Commit

Permalink
enable surface mechanisms in flux diagram tool
Browse files Browse the repository at this point in the history
  • Loading branch information
sevyharris committed Nov 8, 2024
1 parent 43d5bf8 commit ea113b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions rmgpy/tools/fluxdiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ def load_chemkin_output(output_file, reaction_model):

def create_flux_diagram(input_file, chemkin_file, species_dict, save_path=None, species_path=None, java=False,
settings=None, chemkin_output='', central_species_list=None, superimpose=False,
save_states=False, read_states=False, diffusion_limited=True, check_duplicates=True):
save_states=False, read_states=False, diffusion_limited=True, check_duplicates=True,
surface_path=False):
"""
Generates the flux diagram based on a condition 'input_file', chemkin.inp chemkin_file,
a species_dict txt file, plus an optional chemkin_output file.
Expand All @@ -546,7 +547,7 @@ def create_flux_diagram(input_file, chemkin_file, species_dict, save_path=None,

print('Loading RMG job...')
rmg = load_rmg_job(input_file, chemkin_file, species_dict,
generate_images=generate_images, use_java=java, check_duplicates=check_duplicates)
generate_images=generate_images, use_java=java, check_duplicates=check_duplicates, surface_path=surface_path)

if save_path is None:
save_path = os.path.join(rmg.output_directory, 'flux')
Expand Down
8 changes: 6 additions & 2 deletions rmgpy/tools/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def load_rmg_job(
use_java=False,
use_chemkin_names=False,
check_duplicates=True,
surface_path=False,
):
# The argument is an RMG-Py input file
rmg = load_rmg_py_job(
Expand All @@ -59,13 +60,14 @@ def load_rmg_job(
generate_images,
use_chemkin_names=use_chemkin_names,
check_duplicates=check_duplicates,
surface_path=surface_path,
)

return rmg


def load_rmg_py_job(input_file, chemkin_file=None, species_dict=None, generate_images=True,
use_chemkin_names=False, check_duplicates=True):
use_chemkin_names=False, check_duplicates=True, surface_path=False):
"""
Load the results of an RMG-Py job generated from the given `input_file`.
"""
Expand All @@ -83,7 +85,9 @@ def load_rmg_py_job(input_file, chemkin_file=None, species_dict=None, generate_i
species_dict = os.path.join(os.path.dirname(input_file), 'chemkin', 'species_dictionary.txt')
species_list, reaction_list = load_chemkin_file(chemkin_file, species_dict,
use_chemkin_names=use_chemkin_names,
check_duplicates=check_duplicates)
check_duplicates=check_duplicates,
surface_path=surface_path,
)

# Created "observed" versions of all reactive species that are not explicitly
# identified as "constant" species
Expand Down

0 comments on commit ea113b7

Please sign in to comment.