Cantera  2.1.2
Namespaces | Functions
global.h File Reference

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

#include "ct_defs.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

 Cantera
 Namespace for the Cantera kernel.
 

Functions

int nErrors ()
 Return the number of errors that have been encountered so far. More...
 
string lastErrorMessage ()
 Retrieve the last error message in a string. More...
 
void setError (const std::string &r, const std::string &msg)
 Set an error condition in the application class without throwing an exception. More...
 
void showErrors (std::ostream &f)
 Prints all of the error messages to an ostream. More...
 
void showErrors ()
 Prints all of the error messages using writelog. More...
 
void popError ()
 Discard the last error message. More...
 
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...
 
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...
 
string canteraRoot ()
 Returns root directory where Cantera is installed. More...
 
void writelog (const std::string &msg)
 Write a message to the screen. More...
 
void writelog (const std::string &msg, int loglevel)
 Write a message to the log only if loglevel > 0. More...
 
void writelogf (const char *fmt,...)
 Write a formatted message to the screen. More...
 
void writelogendl ()
 Write an end of line character to the screen and flush output. More...
 
void error (const std::string &msg)
 Write an error message and quit. More...
 
void warn_deprecated (const std::string &method, const std::string &extra="")
 Print a warning indicating that method is deprecated. More...
 
void suppress_deprecation_warnings ()
 Globally disable printing of deprecation warnings. 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...
 
void close_XML_File (const std::string &file)
 Close an XML File. More...
 
void beginLogGroup (const std::string &title, int loglevel=-99)
 Create a new group for log messages. More...
 
void addLogEntry (const std::string &tag, const std::string &value)
 Add an entry to an HTML log file. More...
 
void addLogEntry (const std::string &tag, doublereal value)
 Add an entry to an HTML log file. More...
 
void addLogEntry (const std::string &tag, int value)
 Add an entry to an HTML log file. More...
 
void addLogEntry (const std::string &msg)
 Add an entry to an HTML log file. More...
 
void endLogGroup (const std::string &title="")
 Close the current group of log messages. More...
 
void write_logfile (const std::string &file="log.html")
 Write the HTML log 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...
 

Detailed Description

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

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.