Cantera  3.2.0a4
Loading...
Searching...
No Matches
interfaces/clib/include/cantera_clib/ct.h
Go to the documentation of this file.
1/**
2 * CT - Generated CLib %Cantera interface library.
3 *
4 * @file ct.h
5 *
6 * The main library of the generated CLib API contains %Cantera service functions.
7 *
8 * This library of functions is designed to encapsulate %Cantera functionality
9 * and make it available for use in languages and applications other than C++.
10 * A set of library functions is provided that are declared "extern C". All
11 * %Cantera objects are stored and referenced by integers - no pointers are
12 * passed to or from the calling application.
13 *
14 * This file was generated by sourcegen. It will be re-generated by the
15 * %Cantera build process. Do not manually edit.
16 *
17 * @warning This library is an experimental part of the %Cantera API and
18 * may be changed without notice.
19 */
20
21// This file is part of Cantera. See License.txt in the top-level directory or
22// at https://cantera.org/license.txt for license and copyright information.
23
24#ifndef CT_H
25#define CT_H
26
28#include <stdint.h> // for 32-bit int32_t / 64-bit int64_t
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34 /**
35 * @defgroup CAPIct ct Library
36 * The main library of the generated CLib API contains %Cantera service functions.
37 *
38 * @warning This library is an experimental part of the %Cantera API and
39 * may be changed or removed without notice.
40 *
41 * @ingroup CAPIindex
42 */
43
44 /**
45 * @addtogroup CAPIct
46 * @{
47 */
48
49 /**
50 * Returns the %Cantera version.
51 *
52 * Wraps C++ function: `string version()`
53 *
54 * @param[in] bufLen Length of reserved array.
55 * @param[out] buf Returned string value.
56 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
57 */
58 int32_t ct_version(int32_t bufLen, char* buf);
59
60 /**
61 * Returns the hash of the git commit from which %Cantera was compiled, if known.
62 *
63 * Wraps C++ function: `string gitCommit()`
64 *
65 * @param[in] bufLen Length of reserved array.
66 * @param[out] buf Returned string value.
67 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
68 */
69 int32_t ct_gitCommit(int32_t bufLen, char* buf);
70
71 /**
72 * Returns true if %Cantera was compiled with C++ `HDF5` support.
73 *
74 * Wraps C++ function: `bool usesHDF5()`
75 */
76 int32_t ct_usesHDF5();
77
78 /**
79 * Add a directory to the data file search path.
80 *
81 * Wraps C++ function: `void addDataDirectory(const string&)`
82 *
83 * @param dir String name for the directory to be added to the search path
84 */
85 int32_t ct_addDataDirectory(const char* dir);
86
87 /**
88 * Get the %Cantera data directories.
89 *
90 * Wraps C++ function: `string getDataDirectories(const string&)`
91 *
92 * @param sep Separator to use between directories in the string
93 * @param[in] bufLen Length of reserved array.
94 * @param[out] buf Returned string value.
95 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
96 */
97 int32_t ct_getDataDirectories(const char* sep, int32_t bufLen, char* buf);
98
99 /**
100 * Find an input file.
101 *
102 * Wraps C++ function: `string findInputFile(const string&)`
103 *
104 * @param name Name of the input file to be searched for
105 * @param[in] bufLen Length of reserved array.
106 * @param[out] buf Returned string value.
107 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
108 */
109 int32_t ct_findInputFile(const char* name, int32_t bufLen, char* buf);
110
111 /**
112 * Globally disable printing of deprecation warnings.
113 *
114 * Wraps C++ function: `void suppress_deprecation_warnings()`
115 */
117
118 /**
119 * Turns deprecation warnings into exceptions.
120 *
121 * Wraps C++ function: `void make_deprecation_warnings_fatal()`
122 */
124
125 /**
126 * Globally disable printing of (user) warnings.
127 *
128 * Wraps C++ function: `void suppress_warnings()`
129 */
130 int32_t ct_suppress_warnings();
131
132 /**
133 * Returns `true` if warnings should be suppressed.
134 *
135 * Wraps C++ function: `bool warnings_suppressed()`
136 */
137 int32_t ct_warnings_suppressed();
138
139 /**
140 * Turns %Cantera warnings into exceptions.
141 *
142 * Wraps C++ function: `void make_warnings_fatal()`
143 */
144 int32_t ct_make_warnings_fatal();
145
146 /**
147 * Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with discontinuities at the midpoint temperature.
148 *
149 * Wraps C++ function: `void suppress_thermo_warnings(bool)`
150 *
151 * @param suppress Undocumented.
152 */
153 int32_t ct_suppress_thermo_warnings(int32_t suppress);
154
155 /**
156 * Set definition used for rate constant calculation.
157 *
158 * Wraps C++ function: `void use_legacy_rate_constants(bool)`
159 *
160 * @param legacy Undocumented.
161 */
162 int32_t ct_use_legacy_rate_constants(int32_t legacy);
163
164 /**
165 * Delete and free all memory associated with the application.
166 *
167 * Wraps C++ function: `void appdelete()`
168 */
169 int32_t ct_appdelete();
170
171 /**
172 * Avogadro's Number
173 *
174 * Wraps C++ variable-getter: `const double Avogadro`
175 */
176 const double ct_Avogadro();
177
178 /**
179 * Boltzmann constant
180 *
181 * Wraps C++ variable-getter: `const double Boltzmann`
182 */
183 const double ct_Boltzmann();
184
185 /**
186 * Planck constant
187 *
188 * Wraps C++ variable-getter: `const double Planck`
189 */
190 const double ct_Planck();
191
192 /**
193 * Elementary charge
194 *
195 * Wraps C++ variable-getter: `const double ElectronCharge`
196 */
197 const double ct_ElectronCharge();
198
199 /**
200 * Speed of Light in a vacuum
201 *
202 * Wraps C++ variable-getter: `const double lightSpeed`
203 */
204 const double ct_lightSpeed();
205
206 /**
207 * One atmosphere [Pa].
208 *
209 * Wraps C++ variable-getter: `const double OneAtm`
210 */
211 const double ct_OneAtm();
212
213 /**
214 * One bar [Pa].
215 *
216 * Wraps C++ variable-getter: `const double OneBar`
217 */
218 const double ct_OneBar();
219
220 /**
221 * Fine structure constant
222 *
223 * Wraps C++ variable-getter: `const double fineStructureConstant`
224 */
225 const double ct_fineStructureConstant();
226
227 /**
228 * Electron Mass
229 *
230 * Wraps C++ variable-getter: `const double ElectronMass`
231 */
232 const double ct_ElectronMass();
233
234 /**
235 * Universal Gas Constant
236 *
237 * Wraps C++ variable-getter: `const double GasConstant`
238 */
239 const double ct_GasConstant();
240
241 /**
242 * Stefan-Boltzmann constant
243 *
244 * Wraps C++ variable-getter: `const double StefanBoltz`
245 */
246 const double ct_StefanBoltz();
247
248 /**
249 * Faraday constant
250 *
251 * Wraps C++ variable-getter: `const double Faraday`
252 */
253 const double ct_Faraday();
254
255 /**
256 * Permeability of free space
257 *
258 * Wraps C++ variable-getter: `const double permeability_0`
259 */
260 const double ct_permeability_0();
261
262 /**
263 * Permittivity of free space
264 *
265 * Wraps C++ variable-getter: `const double epsilon_0`
266 */
267 const double ct_epsilon_0();
268
269 /**
270 * Get %Cantera error.
271 *
272 * Wraps C++ function: `custom code`
273 *
274 * @param bufLen Length of reserved array.
275 * @param buf String containing Cantera error.
276 * @returns Actual length of string or -1 for exception handling.
277 */
278 int32_t ct_getCanteraError(int32_t bufLen, char* buf);
279
280 /**
281 * Set Logger callback.
282 *
283 * Wraps C++ function: `custom code`
284 *
285 * @param writer Callback that is invoked to produce log output.
286 */
287 int32_t ct_setLogCallback(LogCallback writer);
288
289 /**
290 * Write a message to the logger.
291 *
292 * Wraps C++ function: `void writelog_direct(const string&)`
293 *
294 * @param msg C++ string to be written to the logger
295 */
296 int32_t ct_writeLog(const char* msg);
297
298 /**
299 * Delete all objects and erase mapping.
300 *
301 * Wraps C++ reserved CLib function: `custom code`
302 *
303 * @returns Zero if successful or -1 for exception handling.
304 */
305 int32_t ct_resetStorage();
306
307 /**
308 * @}
309 */
310
311#ifdef __cplusplus
312}
313#endif
314
315#endif // CT_H
int32_t ct_suppress_warnings()
Globally disable printing of (user) warnings.
Definition ct.cpp:184
int32_t ct_getCanteraError(int32_t bufLen, char *buf)
Get Cantera error.
Definition ct.cpp:392
const double ct_ElectronMass()
Electron Mass.
Definition ct.cpp:332
const double ct_Boltzmann()
Boltzmann constant.
Definition ct.cpp:262
int32_t ct_make_deprecation_warnings_fatal()
Turns deprecation warnings into exceptions.
Definition ct.cpp:173
int32_t ct_getDataDirectories(const char *sep, int32_t bufLen, char *buf)
Get the Cantera data directories.
Definition ct.cpp:138
int32_t ct_appdelete()
Delete and free all memory associated with the application.
Definition ct.cpp:241
const double ct_fineStructureConstant()
Fine structure constant.
Definition ct.cpp:322
int32_t ct_findInputFile(const char *name, int32_t bufLen, char *buf)
Find an input file.
Definition ct.cpp:150
const double ct_StefanBoltz()
Stefan-Boltzmann constant.
Definition ct.cpp:352
int32_t ct_writeLog(const char *msg)
Write a message to the logger.
Definition ct.cpp:420
int32_t ct_make_warnings_fatal()
Turns Cantera warnings into exceptions.
Definition ct.cpp:206
int32_t ct_use_legacy_rate_constants(int32_t legacy)
Set definition used for rate constant calculation.
Definition ct.cpp:229
int32_t ct_suppress_thermo_warnings(int32_t suppress)
Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with di...
Definition ct.cpp:217
const double ct_GasConstant()
Universal Gas Constant.
Definition ct.cpp:342
const double ct_Planck()
Planck constant.
Definition ct.cpp:272
int32_t ct_usesHDF5()
Returns true if Cantera was compiled with C++ HDF5 support.
Definition ct.cpp:116
int32_t ct_setLogCallback(LogCallback writer)
Set Logger callback.
Definition ct.cpp:406
int32_t ct_warnings_suppressed()
Returns true if warnings should be suppressed.
Definition ct.cpp:195
int32_t ct_version(int32_t bufLen, char *buf)
Returns the Cantera version.
Definition ct.cpp:92
const double ct_epsilon_0()
Permittivity of free space.
Definition ct.cpp:382
int32_t ct_resetStorage()
Delete all objects and erase mapping.
Definition ct.cpp:431
const double ct_permeability_0()
Permeability of free space.
Definition ct.cpp:372
const double ct_ElectronCharge()
Elementary charge.
Definition ct.cpp:282
const double ct_OneAtm()
One atmosphere [Pa].
Definition ct.cpp:302
int32_t ct_suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
Definition ct.cpp:162
const double ct_lightSpeed()
Speed of Light in a vacuum.
Definition ct.cpp:292
const double ct_Faraday()
Faraday constant.
Definition ct.cpp:362
int32_t ct_gitCommit(int32_t bufLen, char *buf)
Returns the hash of the git commit from which Cantera was compiled, if known.
Definition ct.cpp:104
int32_t ct_addDataDirectory(const char *dir)
Add a directory to the data file search path.
Definition ct.cpp:127
const double ct_OneBar()
One bar [Pa].
Definition ct.cpp:312
const double ct_Avogadro()
Avogadro's Number.
Definition ct.cpp:252
void(* LogCallback)(enum LogLevel logLevel, const char *category, const char *message)
Represents a callback that is invoked to produce log output.