146inline void debuglog(
const std::string& msg,
int loglevel)
163template <
typename... Args>
165 if (
sizeof...(args) == 0) {
184template <
typename... Args>
192void writeline(
char repeat,
size_t count,
193 bool endl_after=
true,
bool endl_before=
false);
196void _warn_deprecated(
const std::string& method,
const std::string& extra=
"");
204template <
typename... Args>
206 const Args&... args) {
207 if (
sizeof...(args) == 0) {
218void _warn(
const std::string& warning,
219 const std::string& method,
const std::string& extra);
228template <
typename... Args>
229void warn(
const std::string& warning,
const std::string& method,
230 const std::string& msg,
const Args&... args) {
231 if (
sizeof...(args) == 0) {
232 _warn(warning, method, msg);
234 _warn(warning, method, fmt::format(msg, args...));
244template <
typename... Args>
245void warn_user(
const std::string& method,
const std::string& msg,
246 const Args&... args) {
247 if (
sizeof...(args) == 0) {
248 _warn(
"Cantera", method, msg);
250 _warn(
"Cantera", method, fmt::format(msg, args...));
287doublereal
toSI(
const std::string& unit);
298XML_Node*
get_XML_File(
const std::string& file,
int debug = 0);
325XML_Node*
get_XML_Node(
const std::string& file_ID, XML_Node* root);
351 const std::string& file_ID,
356inline T
clip(
const T& value,
const T& lower,
const T& upper)
358 return std::max(lower, std::min(upper, value));
362template <
typename T>
int sign(T x) {
363 return (T(0) < x) - (x < T(0));
369std::string
demangle(
const std::type_info& type);
This file contains definitions of constants, types and terms that are used in internal routines and a...
Wrapper for either system-installed or local headers for fmt.
void writelogf(const char *fmt, const Args &... args)
Write a formatted message to the screen.
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
Namespace for the Cantera kernel.
bool warnings_suppressed()
Returns true if warnings should be suppressed.
int sign(T x)
Sign of a number. Returns -1 if x < 0, 1 if x > 0 and 0 if x == 0.
void _warn(const std::string &warning, const std::string &method, const std::string &extra)
helper function passing generic warning to global handler
void use_legacy_rate_constants(bool legacy)
Set definition used for rate constant calculation.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
bool debugModeEnabled()
Returns true if Cantera was compiled in debug mode.
void suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
bool thermo_warnings_suppressed()
Returns true if thermo warnings should be suppressed.
void make_warnings_fatal()
Turns Cantera warnings into exceptions.
void setLogger(Logger *logwriter)
Install a logger.
void warn(const std::string &warning, const std::string &method, const std::string &msg, const Args &... args)
Print a generic warning raised from method.
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 ...
void make_deprecation_warnings_fatal()
Turns deprecation warnings into exceptions.
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
XML_Node * get_XML_from_string(const std::string &text)
Read a CTI or CTML string and fill up an XML tree.
doublereal actEnergyToSI(const std::string &unit)
Return the conversion factor to convert activation energy unit std::string 'unit' to Kelvin.
bool legacy_rate_constants_used()
Returns true if legacy rate constant definition should be used.
std::string gitCommit()
Returns the hash of the git commit from which Cantera was compiled, if known.
void close_XML_File(const std::string &file)
Close an XML File.
void suppress_warnings()
Globally disable printing of (user) warnings.
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
void _warn_deprecated(const std::string &method, const std::string &extra)
helper function passing deprecation warning to global handler
void debuglog(const std::string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
void thread_complete()
Delete and free memory allocated per thread in multithreaded applications.
doublereal toSI(const std::string &unit)
Return the conversion factor to convert unit std::string 'unit' to SI units.
void writelog_direct(const std::string &msg)
Write a message to the screen.
void suppress_thermo_warnings(bool suppress)
Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with di...
void appdelete()
Delete and free all memory associated with the application.
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 ...
T clip(const T &value, const T &lower, const T &upper)
Clip value such that lower <= value <= upper.
void writelogendl()
Write an end of line character to the screen and flush output.
std::string demangle(const std::type_info &type)
Convert a type name to a human readable string, using boost::core::demangle if available.
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....