[CTI] Document options for controlling mechanism validation
Add documentation for the validate() function, and remove documentation for the non-existent 'no_validation' flag.
This commit is contained in:
parent
1e078d4fd3
commit
6867381781
4 changed files with 22 additions and 3 deletions
|
|
@ -12,6 +12,8 @@ Basic Classes & Functions
|
|||
|
||||
.. autofunction:: units
|
||||
|
||||
.. autofunction:: validate
|
||||
|
||||
.. autoclass:: state
|
||||
:no-undoc-members:
|
||||
|
||||
|
|
|
|||
|
|
@ -161,6 +161,18 @@ incorrect and would generate an error when processed::
|
|||
element(39.948, "Ar") # error
|
||||
element(symbol="Ar", 39.948) # error
|
||||
|
||||
Validation
|
||||
----------
|
||||
|
||||
Normally, Cantera will make some checks for errors in the definitions of species
|
||||
and reactions, such as checking for duplicate reactions. To slightly speed up
|
||||
processing (if a mechanism has previously been validated), or in case of
|
||||
spurious validation errors, validation can be disabled using the
|
||||
:func:`validate` function. For example, to disable validation of reactions, add
|
||||
the following to the CTI file::
|
||||
|
||||
validate(reactions='no')
|
||||
|
||||
.. _sec-dimensions:
|
||||
|
||||
Dimensional Values
|
||||
|
|
|
|||
|
|
@ -259,9 +259,6 @@ or a sequence of strings from the table below.
|
|||
================================== ================
|
||||
Option String Meaning
|
||||
================================== ================
|
||||
``'no_validation'`` Turn off all validation. Use when the definition
|
||||
has been previously validated to speed up importing
|
||||
the definition into an application. Use with caution!
|
||||
``'skip_undeclared_elements'`` When importing species, skip any containing undeclared
|
||||
elements, rather than flagging them as an error.
|
||||
``'skip_undeclared_species'`` When importing reactions, skip any containing undeclared
|
||||
|
|
|
|||
|
|
@ -254,6 +254,14 @@ def export_species(filename, fmt = 'CSV'):
|
|||
_valfmt = fmt
|
||||
|
||||
def validate(species = 'yes', reactions = 'yes'):
|
||||
"""
|
||||
Enable or disable validation of species and reactions.
|
||||
:param species:
|
||||
Set to 'yes' (default) or 'no'.
|
||||
:param reactions:
|
||||
Set to 'yes' (default) or 'no'. This controls duplicate reaction checks
|
||||
and validation of rate expressions for some reaction types.
|
||||
"""
|
||||
global _valsp
|
||||
global _valrxn
|
||||
_valsp = species
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue