135 inline void debuglog(
const std::string& msg,
int loglevel)
152 template <
typename... Args>
154 if (
sizeof...(args) == 0) {
173 template <
typename... Args>
181 void writeline(
char repeat,
size_t count,
182 bool endl_after=
true,
bool endl_before=
false);
185 void warn_deprecated(
const std::string& method,
const std::string& extra=
"");
207 doublereal
toSI(
const std::string& unit);
217 XML_Node*
get_XML_File(
const std::string& file,
int debug = 0);
241 XML_Node*
get_XML_Node(
const std::string& file_ID, XML_Node* root);
264 const std::string& file_ID,
269 inline T
clip(
const T& value,
const T& lower,
const T& upper)
271 return std::max(lower, std::min(upper, value));
275 template <
typename T>
int sign(T x) {
276 return (T(0) < x) - (x < T(0));
Wrapper for either system-installed or local headers for fmt.
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 ...
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
doublereal actEnergyToSI(const std::string &unit)
Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin...
doublereal toSI(const std::string &unit)
Return the conversion factor to convert unit std::string 'unit' to SI units.
void thread_complete()
Delete and free memory allocated per thread in multithreaded applications.
void setLogger(Logger *logwriter)
Install a logger.
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
T clip(const T &value, const T &lower, const T &upper)
Clip value such that lower <= value <= upper.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
int sign(T x)
Sign of a number. Returns -1 if x < 0, 1 if x > 0 and 0 if x == 0.
XML_Node * get_XML_from_string(const std::string &text)
Read a CTI or CTML string and fill up an XML tree.
std::string gitCommit()
Returns the hash of the git commit from which Cantera was compiled, if known.
void suppress_thermo_warnings(bool suppress)
Globally disable printing of warnings about problematic thermo data, e.g.
void close_XML_File(const std::string &file)
Close an XML File.
void appdelete()
Delete and free all memory associated with the application.
void debuglog(const std::string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
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.
bool thermo_warnings_suppressed()
Returns true if thermo warnings should be suppressed.
void suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
void make_deprecation_warnings_fatal()
Turns deprecation warnings into exceptions.
Namespace for the Cantera kernel.
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 ...
void writelog_direct(const std::string &msg)
Write a message to the screen.