154inline void debuglog(
const string& msg,
int loglevel)
170template <
typename... Args>
171void writelog(
const string& fmt,
const Args&... args) {
172 if (
sizeof...(args) == 0) {
190template <
typename... Args>
198void writeline(
char repeat,
size_t count,
199 bool endl_after=
true,
bool endl_before=
false);
211void _warn_deprecated(
const string& method,
const string& extra=
"");
222template <
typename... Args>
224 if (
sizeof...(args) == 0) {
225 _warn_deprecated(method, msg);
227 _warn_deprecated(method, fmt::format(fmt::runtime(msg), args...));
234void _warn(
const string& warning,
const string& method,
const string& extra);
246template <
typename... Args>
247void warn(
const string& warning,
const string& method,
248 const string& msg,
const Args&... args) {
249 if (
sizeof...(args) == 0) {
250 _warn(warning, method, msg);
252 _warn(warning, method, fmt::format(fmt::runtime(msg), args...));
262template <
typename... Args>
263void warn_user(
const string& method,
const string& msg,
const Args&... args) {
264 if (
sizeof...(args) == 0) {
265 _warn(
"Cantera", method, msg);
267 _warn(
"Cantera", method, fmt::format(fmt::runtime(msg), args...));
325inline T
clip(
const T& value,
const T& lower,
const T& upper)
327 return std::max(lower, std::min(upper, value));
332template <
typename T>
int sign(T x) {
333 return (T(0) < x) - (x < T(0));
339string 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.
bool warnings_suppressed()
Returns true if warnings should be suppressed.
void use_legacy_rate_constants(bool legacy)
Set definition used for rate constant calculation.
bool debugModeEnabled()
Returns true if Cantera was compiled in debug mode.
string demangle(const std::type_info &type)
Convert a type name to a human readable string, using boost::core::demangle if available.
void suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
void printStackTraceOnSegfault()
Enables printing a stacktrace to std::err if a segfault occurs.
bool thermo_warnings_suppressed()
Returns true if thermo warnings should be suppressed.
void make_warnings_fatal()
Turns Cantera warnings into exceptions.
string version()
Returns the Cantera version.
void make_deprecation_warnings_fatal()
Turns deprecation warnings into exceptions.
bool legacy_rate_constants_used()
Returns true if legacy rate constant definition is used.
void suppress_warnings()
Globally disable printing of (user) warnings.
void suppress_thermo_warnings(bool suppress)
Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with di...
string gitCommit()
Returns the hash of the git commit from which Cantera was compiled, if known.
bool usingSharedLibrary()
Returns true if Cantera was loaded as a shared library in the current application.
bool usesHDF5()
Returns true if Cantera was compiled with C++ HDF5 support.
void writelog_direct(const string &msg)
Write a message to the screen.
void setLogger(Logger *logwriter)
Install a logger.
void debuglog(const 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 writelog(const string &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.
int sign(T x)
Sign of a number.
T clip(const T &value, const T &lower, const T &upper)
Clip value such that lower <= value <= upper.
void warn(const string &warning, const string &method, const string &msg, const Args &... args)
Print a generic warning raised from method.
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Namespace for the Cantera kernel.
void loadExtensions(const AnyMap &node)
Load extensions providing user-defined models from the extensions section of the given node.
void loadExtension(const string &extType, const string &name)
Load an extension implementing user-defined models.
void searchPythonVersions(const string &versions)
Set the versions of Python to try when loading user-defined extensions, in order of preference.
void thread_complete()
Delete and free memory allocated per thread in multithreaded applications.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
void appdelete()
Delete and free all memory associated with the application.