| Cantera 3.0.0

Loading...
Searching...
No Matches
Namespaces | Functions
global.h File Reference

This file contains definitions for utility functions and text for modules, inputfiles and logging, (see Input File Handling, and Logging). More...

`#include "ct_defs.h"`
`#include "cantera/base/fmt.h"`
Include dependency graph for global.h:

## Detailed Description

This file contains definitions for utility functions and text for modules, inputfiles and logging, (see Input File Handling, and Logging).

These functions store some parameters in global storage that are accessible at all times from the calling application. Contains module definitions for

- inputfiles (see Input File Handling)
- text logs (see Logging)

Definition in file global.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Namespaces
namespace | Cantera
| Namespace for the Cantera kernel.

## Functions
string | findInputFile (const string &name)
| Find an input file.
void | addDirectory (const string &dir)
| Add a directory to the data file search path.
string | getDataDirectories (const string &sep)
| Get the Cantera data directories.
void | loadExtension (const string &extType, const string &name)
| Load an extension implementing user-defined models.
void | loadExtensions (const AnyMap &node)
| Load extensions providing user-defined models from the `extensions` section of the given node.
void | searchPythonVersions (const string &versions)
| Set the versions of Python to try when loading user-defined extensions, in order of preference.
void | appdelete ()
| Delete and free all memory associated with the application.
void | thread_complete ()
| Delete and free memory allocated per thread in multithreaded applications.
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 | writelog_direct (const string &msg)
| Write a message to the screen.
void | debuglog (const string &msg, int loglevel)
| Write a message to the log only if loglevel > 0.
template<typename... Args>
void | writelog (const string &fmt, const Args &... args)
| Write a formatted message to the screen.
template<typename... Args>
void | writelogf (const char *fmt, const Args &... args)
| Write a formatted message to the screen.
void | writelogendl ()
| Write an end of line character to the screen and flush output.
void | writeline (char repeat, size_t count, bool endl_after, bool endl_before)
template<typename... Args>
void | warn_deprecated (const string &method, const string &msg, const Args &... args)
| Print a deprecation warning raised from method.
template<typename... Args>
void | warn (const string &warning, const string &method, const string &msg, const Args &... args)
| Print a generic warning raised from method.
template<typename... Args>
void | warn_user (const string &method, const string &msg, const Args &... args)
| Print a user warning raised from method as `CanteraWarning`.
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 | setLogger (Logger *logwriter)
| Install a logger.
void | printStackTraceOnSegfault ()
| Enables printing a stacktrace to `std::err` if a segfault occurs.
template<class T >
T | clip (const T &value, const T &lower, const T &upper)
| Clip value such that lower <= value <= upper.
template<typename T >
int | sign (T x)
| Sign of a number.
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.