Cantera  2.0
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

namespace  Cantera
 Provides class Nucleus.
 

Functions

int nErrors ()
 Return the number of errors that have been encountered so far.
 
string lastErrorMessage ()
 Returns the last error message.
 
void setError (std::string r, std::string msg)
 Set an error condition in the application class without throwing an exception.
 
void showErrors (std::ostream &f)
 Prints all of the error messages to an ostream.
 
void showErrors ()
 Print all of the error messages using function writelog of class logger.
 
void popError ()
 Discard the last error message.
 
std::string findInputFile (std::string name)
 Find an input file.
 
void addDirectory (std::string dir)
 Add a directory to the input file search path.
 
void appdelete ()
 Delete and free all memory associated with the application.
 
void thread_complete ()
 Delete and free memory allocated per thread in multithreaded applications.
 
string canteraRoot ()
 Returns root directory where Cantera where installed.
 
void writelog (const std::string &msg)
 Write a message to the screen.
 
void writelog (const char *msg)
 Write a message to the screen.
 
void writelogf (const char *fmt,...)
 Write a formatted message to the screen.
 
void writelogendl ()
 Write an end of line character to the screen and flush output.
 
void error (const std::string &msg)
 Write an error message and terminate execution.
 
int userInterface ()
 returns 1 for MATLAB, 2 for Python, and 0 for C++ or Fortran.
 
void setLogger (Logger *logwriter)
 Install a logger.
 
doublereal toSI (std::string unit)
 Return the conversion factor to convert unit std::string 'unit' to SI units.
 
doublereal actEnergyToSI (std::string unit)
 Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin.
 
XML_Node * get_XML_File (std::string file, int debug=0)
 Return a pointer to the XML tree for a Cantera input file.
 
void close_XML_File (std::string file)
 Close a Cantera input file.
 
void beginLogGroup (std::string title, int loglevel=-99)
 Create a new group for log messages.
 
void addLogEntry (std::string tag, std::string value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string tag, doublereal value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string tag, int value)
 Add an entry to an HTML log file.
 
void addLogEntry (std::string msg)
 Add an entry msg string to an HTML log file.
 
void endLogGroup (std::string title="")
 Close the current group of log messages.
 
void write_logfile (std::string file="log.html")
 Write the HTML log file.
 
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.
 
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.
 

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.