Cantera 2.6.0
Namespaces | Functions
global.h File Reference

This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen). More...

#include "ct_defs.h"
#include "cantera/base/fmt.h"
Include dependency graph for 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

std::string findInputFile (const std::string &name)
 Find an input file. More...
 
void addDirectory (const std::string &dir)
 Add a directory to the data file search path. More...
 
std::string getDataDirectories (const std::string &sep)
 Get the Cantera data directories. 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...
 
std::string gitCommit ()
 Returns the hash of the git commit from which Cantera was compiled, if known. More...
 
std::string canteraRoot ()
 Returns root directory where Cantera is installed. More...
 
bool debugModeEnabled ()
 Returns true if Cantera was compiled in debug mode. More...
 
void writelog_direct (const std::string &msg)
 Write a message to the screen. More...
 
void debuglog (const std::string &msg, int loglevel)
 Write a message to the log only if loglevel > 0. More...
 
template<typename... Args>
void writelog (const std::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=true, bool endl_before=false)
 
void _warn_deprecated (const std::string &method, const std::string &extra="")
 helper function passing deprecation warning to global handler More...
 
template<typename... Args>
void warn_deprecated (const std::string &method, const std::string &msg, const Args &... args)
 Print a deprecation warning raised from method. More...
 
void suppress_deprecation_warnings ()
 Globally disable printing of deprecation warnings. More...
 
void _warn (const std::string &warning, const std::string &method, const std::string &extra)
 helper function passing generic warning to global handler More...
 
template<typename... Args>
void warn (const std::string &warning, const std::string &method, const std::string &msg, const Args &... args)
 Print a generic warning raised from method. More...
 
template<typename... Args>
void warn_user (const std::string &method, const std::string &msg, const Args &... args)
 Print a user warning raised from method as CanteraWarning. 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...
 
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 should be used. More...
 
void setLogger (Logger *logwriter)
 Install a logger. More...
 
doublereal toSI (const std::string &unit)
 Return the conversion factor to convert unit std::string 'unit' to SI units. More...
 
doublereal actEnergyToSI (const std::string &unit)
 Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin. More...
 
XML_Node * get_XML_File (const std::string &file, int debug=0)
 Return a pointer to the XML tree for a Cantera input file. More...
 
XML_Node * get_XML_from_string (const std::string &text)
 Read a CTI or CTML string and fill up an XML tree. More...
 
void close_XML_File (const std::string &file)
 Close an XML File. More...
 
XML_Node * get_XML_Node (const std::string &file_ID, XML_Node *root)
 This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string. More...
 
XML_Node * get_XML_NameID (const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
 This routine will locate an XML node in either the input XML tree or in another input file specified by the file part of the file_ID string. 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. Returns -1 if x < 0, 1 if x > 0 and 0 if x == 0. More...
 
std::string demangle (const std::type_info &type)
 Convert a type name to a human readable string, using boost::core::demangle if available. More...
 

Detailed Description

This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).

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.