Cantera  3.1.0a1
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

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

 Cantera
 Namespace for the Cantera kernel.
 

Functions

string findInputFile (const string &name)
 Find an input file. More...
 
void addDirectory (const string &dir)
 Add a directory to the data file search path. More...
 
string getDataDirectories (const string &sep)
 Get the Cantera data directories. More...
 
void loadExtension (const string &extType, const string &name)
 Load an extension implementing user-defined models. More...
 
void loadExtensions (const AnyMap &node)
 Load extensions providing user-defined models from the extensions section of the given node. More...
 
void searchPythonVersions (const string &versions)
 Set the versions of Python to try when loading user-defined extensions, in order of preference. More...
 
void appdelete ()
 Delete and free all memory associated with the application. More...
 
void thread_complete ()
 Delete and free memory allocated per thread in multithreaded applications. More...
 
bool usingSharedLibrary ()
 Returns true if Cantera was loaded as a shared library in the current application. More...
 
bool debugModeEnabled ()
 Returns true if Cantera was compiled in debug mode. More...
 
bool usesHDF5 ()
 Returns true if Cantera was compiled with C++ HDF5 support. More...
 
void writelog_direct (const string &msg)
 Write a message to the screen. More...
 
void debuglog (const string &msg, int loglevel)
 Write a message to the log only if loglevel > 0. More...
 
template<typename... Args>
void writelog (const string &fmt, const Args &... args)
 Write a formatted message to the screen. More...
 
template<typename... Args>
void writelogf (const char *fmt, const Args &... args)
 Write a formatted message to the screen. More...
 
void writelogendl ()
 Write an end of line character to the screen and flush output. More...
 
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. More...
 
template<typename... Args>
void warn (const string &warning, const string &method, const string &msg, const Args &... args)
 Print a generic warning raised from method. More...
 
template<typename... Args>
void warn_user (const string &method, const string &msg, const Args &... args)
 Print a user warning raised from method as CanteraWarning. More...
 
void use_legacy_rate_constants (bool legacy=true)
 Set definition used for rate constant calculation. More...
 
bool legacy_rate_constants_used ()
 Returns true if legacy rate constant definition is used. More...
 
void setLogger (Logger *logwriter)
 Install a logger. More...
 
void printStackTraceOnSegfault ()
 Enables printing a stacktrace to std::err if a segfault occurs. More...
 
template<class T >
clip (const T &value, const T &lower, const T &upper)
 Clip value such that lower <= value <= upper. More...
 
template<typename T >
int sign (T x)
 Sign of a number. More...
 
string demangle (const std::type_info &type)
 Convert a type name to a human readable string, using boost::core::demangle if available. More...
 
Cantera Version Information
string version ()
 Returns the Cantera version. More...
 
string gitCommit ()
 Returns the hash of the git commit from which Cantera was compiled, if known. More...
 
Global Warning Settings
void suppress_deprecation_warnings ()
 Globally disable printing of deprecation warnings. More...
 
void make_deprecation_warnings_fatal ()
 Turns deprecation warnings into exceptions. More...
 
void make_warnings_fatal ()
 Turns Cantera warnings into exceptions. More...
 
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. More...
 
bool thermo_warnings_suppressed ()
 Returns true if thermo warnings should be suppressed. More...
 
void suppress_warnings ()
 Globally disable printing of (user) warnings. More...
 
bool warnings_suppressed ()
 Returns true if warnings should be suppressed. More...