Functions for accessing global Cantera settings. More...
Functions for accessing global Cantera settings.
Functions | |
bool | usingSharedLibrary () |
Returns true if Cantera was loaded as a shared library in the current application. | |
bool | debugModeEnabled () |
Returns true if Cantera was compiled in debug mode. | |
bool | usesHDF5 () |
Returns true if Cantera was compiled with C++ HDF5 support. | |
void | use_legacy_rate_constants (bool legacy=true) |
Set definition used for rate constant calculation. | |
bool | legacy_rate_constants_used () |
Returns true if legacy rate constant definition is used. | |
void | printStackTraceOnSegfault () |
Enables printing a stacktrace to std::err if a segfault occurs. | |
string | demangle (const std::type_info &type) |
Convert a type name to a human readable string, using boost::core::demangle if available. | |
Cantera Version Information | |
string | version () |
Returns the Cantera version. | |
string | gitCommit () |
Returns the hash of the git commit from which Cantera was compiled, if known. | |
Global Warning Settings | |
void | suppress_deprecation_warnings () |
Globally disable printing of deprecation warnings. | |
void | make_deprecation_warnings_fatal () |
Turns deprecation warnings into exceptions. | |
void | make_warnings_fatal () |
Turns Cantera warnings into exceptions. | |
void | suppress_thermo_warnings (bool suppress=true) |
Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with discontinuities at the midpoint temperature. | |
bool | thermo_warnings_suppressed () |
Returns true if thermo warnings should be suppressed. | |
void | suppress_warnings () |
Globally disable printing of (user) warnings. | |
bool | warnings_suppressed () |
Returns true if warnings should be suppressed. | |
bool usingSharedLibrary | ( | ) |
Returns true
if Cantera was loaded as a shared library in the current application.
Returns false
if it was statically linked.
string version | ( | ) |
Returns the Cantera version.
This function is used to access the version from a library, rather than the CANTERA_VERSION
macro that is available at compile time.
Definition at line 145 of file global.cpp.
string gitCommit | ( | ) |
Returns the hash of the git commit from which Cantera was compiled, if known.
Definition at line 150 of file global.cpp.
bool debugModeEnabled | ( | ) |
Returns true if Cantera was compiled in debug mode.
Used for handling some cases where behavior tested in the test suite changes depending on whether the NDEBUG
preprocessor macro is defined.
Definition at line 193 of file global.cpp.
bool usesHDF5 | ( | ) |
Returns true if Cantera was compiled with C++ HDF5
support.
Definition at line 202 of file global.cpp.
void suppress_deprecation_warnings | ( | ) |
Globally disable printing of deprecation warnings.
Used primarily to prevent certain tests from failing.
Definition at line 67 of file global.cpp.
void make_deprecation_warnings_fatal | ( | ) |
Turns deprecation warnings into exceptions.
Activated within the test suite to make sure that no deprecated methods are being used.
Definition at line 72 of file global.cpp.
void make_warnings_fatal | ( | ) |
Turns Cantera warnings into exceptions.
Activated within the test suite to make sure that your warning message are being raised.
Definition at line 87 of file global.cpp.
void suppress_thermo_warnings | ( | bool | suppress = true | ) |
Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with discontinuities at the midpoint temperature.
Definition at line 92 of file global.cpp.
bool thermo_warnings_suppressed | ( | ) |
Returns true
if thermo warnings should be suppressed.
Definition at line 97 of file global.cpp.
void suppress_warnings | ( | ) |
Globally disable printing of (user) warnings.
Used primarily to prevent certain tests from failing.
Definition at line 77 of file global.cpp.
bool warnings_suppressed | ( | ) |
Returns true
if warnings should be suppressed.
Definition at line 82 of file global.cpp.
void use_legacy_rate_constants | ( | bool | legacy = true | ) |
Set definition used for rate constant calculation.
If set to false
(default value), rate constants of three-body reactions are consistent with conventional definitions (for example Eq. 9.75 in Kee, et al. [17]). If set to true
, output for rate constants of three-body reactions is multiplied by third-body concentrations, consistent with Cantera's behavior prior to version 3.0.
Definition at line 102 of file global.cpp.
bool legacy_rate_constants_used | ( | ) |
Returns true
if legacy rate constant definition is used.
Definition at line 107 of file global.cpp.
void printStackTraceOnSegfault | ( | ) |
Enables printing a stacktrace to std::err
if a segfault occurs.
The Boost documentation says doing this from an error handler is not safe on all platforms and risks deadlocking. However, it can be useful for debugging and is therefore enabled when running tests.
Definition at line 125 of file global.cpp.
string demangle | ( | const std::type_info & | type | ) |
Convert a type name to a human readable string, using boost::core::demangle
if available.
Also has a set of short names for some common types.
Definition at line 213 of file global.cpp.