diff --git a/doc/sphinx/cti/classes.rst b/doc/sphinx/cti/classes.rst index 9c66d56c9..3c0722cad 100644 --- a/doc/sphinx/cti/classes.rst +++ b/doc/sphinx/cti/classes.rst @@ -12,6 +12,8 @@ Basic Classes & Functions .. autofunction:: units +.. autofunction:: validate + .. autoclass:: state :no-undoc-members: diff --git a/doc/sphinx/cti/input-files.rst b/doc/sphinx/cti/input-files.rst index d55dd4686..9545507b1 100644 --- a/doc/sphinx/cti/input-files.rst +++ b/doc/sphinx/cti/input-files.rst @@ -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 diff --git a/doc/sphinx/cti/phases.rst b/doc/sphinx/cti/phases.rst index d0250e246..c499ff45f 100644 --- a/doc/sphinx/cti/phases.rst +++ b/doc/sphinx/cti/phases.rst @@ -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 diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index e117936db..a5fc5f1f9 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -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