| Cantera 3.0.0

Loading...
Searching...
No Matches
Functions
Global Cantera Settings
Global Data

Functions for accessing global Cantera settings. More...

Collaboration diagram for Global Cantera Settings:

## Detailed Description

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.

## Function Documentation

## ◆ usingSharedLibrary()

bool usingSharedLibrary | ( |  | ) |

Returns `true` if Cantera was loaded as a shared library in the current application.

Returns `false` if it was statically linked.

Since
  New in Cantera 3.0

## ◆ version()

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.

Since
  New in Cantera 3.0

Definition at line 145 of file global.cpp.

## ◆ gitCommit()

string gitCommit | ( |  | ) |

Returns the hash of the git commit from which Cantera was compiled, if known.

Definition at line 150 of file global.cpp.

## ◆ debugModeEnabled()

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.

## ◆ usesHDF5()

bool usesHDF5 | ( |  | ) |

Returns true if Cantera was compiled with C++ `HDF5` support.

Since
  New in Cantera 3.0.

Definition at line 202 of file global.cpp.

## ◆ suppress_deprecation_warnings()

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.

## ◆ make_deprecation_warnings_fatal()

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.

## ◆ make_warnings_fatal()

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.

## ◆ suppress_thermo_warnings()

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.

## ◆ thermo_warnings_suppressed()

bool thermo_warnings_suppressed | ( |  | ) |

Returns `true` if thermo warnings should be suppressed.

Definition at line 97 of file global.cpp.

## ◆ suppress_warnings()

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.

## ◆ warnings_suppressed()

bool warnings_suppressed | ( |  | ) |

Returns `true` if warnings should be suppressed.

Definition at line 82 of file global.cpp.

## ◆ use_legacy_rate_constants()

void use_legacy_rate_constants | ( | bool | legacy = `true` | ) |

Set definition used for rate constant calculation.

See also
  Kinetics::getFwdRateConstants()

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. [kee2003]). 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.

## ◆ legacy_rate_constants_used()

bool legacy_rate_constants_used | ( |  | ) |

Returns `true` if legacy rate constant definition is used.

Definition at line 107 of file global.cpp.

## ◆ printStackTraceOnSegfault()

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.

Since
  New in Cantera 3.0

Definition at line 125 of file global.cpp.

## ◆ demangle()

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.

Note
  Mainly for internal use by AnyMap and Delegator

Definition at line 213 of file global.cpp.