Internal API

Contents

Index

Internal Interface

Reaction handling

GKMC.possible_reactions — Function
possible_reactions(m::MolecularGraph)

Return a tuple of tuples representing the possible reactions from the current aliphatic site.

source
GKMC.scramble! — Function
scramble!(m::MolecularGraph, mol::String, source::String, destination::String)

Move isotope mol from carbon source to the neighbouring carbon destination.

Return the modified molecular graph m.

Throw an AssertionError if source and destination are not neighbouring carbons, or if the graph does not contain exactly one carbon with either identifier. Throw an ArgumentError if carbon source does not contain isotope mol.

source
GKMC.dissociate! — Function
dissociate!(m::MolecularGraph, mol::String, source::String)

Dissociate isotope mol from carbon source.

Return the modified molecular graph m.

Throw an ArgumentError if carbon source does not contain isotope mol.

source

Molecular graph helpers

GKMC.carbon_by_id — Function
carbon_by_id(m::MolecularGraph, id::String)

Return the Carbon with identifier id.

source
GKMC.find_aliphatic_carbon — Function
find_aliphatic_carbon(m::MolecularGraph)

Return the integer vertex index of the only aliphatic carbon. An aliphatic carbon is identified as a carbon whose graph degree plus number of attached subsituents equals four.

source
GKMC.load_molecule — Function
load_molecule(path::AbstractString)

Return a MolecularGraph from a parsed GraphML XML file.

source
GKMC.load_graph — Function
load_graph(xgraph::EzXML.Node, ns::Vector{Pair{String,String}})

Return a SimpleGraph from a GraphML graph element.

source

Rate tables

GKMC.get_rate — Function
get_rate(rate_tables::Dict, reaction::Tuple, energy::Unitful.Energy)

Return the rate_at_energy for a specified reaction from a rate_table

source
GKMC.rate_at_energy — Function
rate_at_energy(rate_table::RateTable, energy::Unitful.Energy)

Return the reaction rate at energy by selecting the last energy-grid point not greater than the requested energy.

Throw a DomainError if energy lies outside the rate-table range.

source
GKMC.read_ratefile — Function
read_ratefile(path::AbstractString)

Return a RateTable parsed from a rate-file JSON.

source
GKMC.validate_rates — Function
validate_rates(
    energies::Vector{typeof(1.0u"eV")},
    rates::Vector{typeof(1.0u"s^-1")};
    path::AbstractString="<unknown>"
)

Validate the reaction rates against model constraints.

Return nothing if the rate table is valid.

Throw an ArgumentError if the rate table is empty, the energy and rate arrays have different lengths, the rate table contains non-finite values, the energy grid is not strictly increasing, or a rate is negative.

source
GKMC.validate_ratefile — Function
validate_ratefile(config::Dict{String,Any}, path::AbstractString)

Validate the input against ratefile.schema.json.

source

Input parsing