Cantera  3.2.0a2
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 * Add a directory to the data file search path.
73 *
74 * Wraps C++ function: `void addDirectory(const string&)`
75 *
76 * @param dir String name for the directory to be added to the search path
77 */
78 int32_t ct_addDataDirectory(const char* dir);
79
80 /**
81 * Get the %Cantera data directories.
82 *
83 * Wraps C++ function: `string getDataDirectories(const string&)`
84 *
85 * @param sep Separator to use between directories in the string
86 * @param[in] bufLen Length of reserved array.
87 * @param[out] buf Returned string value.
88 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
89 */
90 int32_t ct_getDataDirectories(const char* sep, int32_t bufLen, char* buf);
91
92 /**
93 * Find an input file.
94 *
95 * Wraps C++ function: `string findInputFile(const string&)`
96 *
97 * @param name Name of the input file to be searched for
98 * @param[in] bufLen Length of reserved array.
99 * @param[out] buf Returned string value.
100 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
101 */
102 int32_t ct_findInputFile(const char* name, int32_t bufLen, char* buf);
103
104 /**
105 * Globally disable printing of deprecation warnings.
106 *
107 * Wraps C++ function: `void suppress_deprecation_warnings()`
108 */
110
111 /**
112 * Turns deprecation warnings into exceptions.
113 *
114 * Wraps C++ function: `void make_deprecation_warnings_fatal()`
115 */
117
118 /**
119 * Globally disable printing of (user) warnings.
120 *
121 * Wraps C++ function: `void suppress_warnings()`
122 */
123 int32_t ct_suppress_warnings();
124
125 /**
126 * Returns
127 *
128 * Wraps C++ function: `bool warnings_suppressed()`
129 */
130 int32_t ct_warnings_suppressed();
131
132 /**
133 * Turns %Cantera warnings into exceptions.
134 *
135 * Wraps C++ function: `void make_warnings_fatal()`
136 */
137 int32_t ct_make_warnings_fatal();
138
139 /**
140 * Globally disable printing of warnings about problematic thermo data, such as NASA polynomials with discontinuities at the midpoint temperature.
141 *
142 * Wraps C++ function: `void suppress_thermo_warnings(bool)`
143 *
144 * @param suppress Undocumented.
145 */
146 int32_t ct_suppress_thermo_warnings(int32_t suppress);
147
148 /**
149 * Set definition used for rate constant calculation.
150 *
151 * Wraps C++ function: `void use_legacy_rate_constants(bool)`
152 *
153 * @param legacy Undocumented.
154 */
155 int32_t ct_use_legacy_rate_constants(int32_t legacy);
156
157 /**
158 * Delete and free all memory associated with the application.
159 *
160 * Wraps C++ function: `void appdelete()`
161 */
162 int32_t ct_appdelete();
163
164 /**
165 * Avogadro's Number
166 *
167 * Wraps C++ variable-getter: `const double Avogadro`
168 */
169 const double ct_Avogadro();
170
171 /**
172 * Boltzmann constant
173 *
174 * Wraps C++ variable-getter: `const double Boltzmann`
175 */
176 const double ct_Boltzmann();
177
178 /**
179 * Planck constant
180 *
181 * Wraps C++ variable-getter: `const double Planck`
182 */
183 const double ct_Planck();
184
185 /**
186 * Elementary charge
187 *
188 * Wraps C++ variable-getter: `const double ElectronCharge`
189 */
190 const double ct_ElectronCharge();
191
192 /**
193 * Speed of Light in a vacuum
194 *
195 * Wraps C++ variable-getter: `const double lightSpeed`
196 */
197 const double ct_lightSpeed();
198
199 /**
200 * One atmosphere [Pa].
201 *
202 * Wraps C++ variable-getter: `const double OneAtm`
203 */
204 const double ct_OneAtm();
205
206 /**
207 * One bar [Pa].
208 *
209 * Wraps C++ variable-getter: `const double OneBar`
210 */
211 const double ct_OneBar();
212
213 /**
214 * Fine structure constant
215 *
216 * Wraps C++ variable-getter: `const double fineStructureConstant`
217 */
218 const double ct_fineStructureConstant();
219
220 /**
221 * Electron Mass
222 *
223 * Wraps C++ variable-getter: `const double ElectronMass`
224 */
225 const double ct_ElectronMass();
226
227 /**
228 * Universal Gas Constant
229 *
230 * Wraps C++ variable-getter: `const double GasConstant`
231 */
232 const double ct_GasConstant();
233
234 /**
235 * Stefan-Boltzmann constant
236 *
237 * Wraps C++ variable-getter: `const double StefanBoltz`
238 */
239 const double ct_StefanBoltz();
240
241 /**
242 * Faraday constant
243 *
244 * Wraps C++ variable-getter: `const double Faraday`
245 */
246 const double ct_Faraday();
247
248 /**
249 * Permeability of free space
250 *
251 * Wraps C++ variable-getter: `const double permeability_0`
252 */
253 const double ct_permeability_0();
254
255 /**
256 * Permittivity of free space
257 *
258 * Wraps C++ variable-getter: `const double epsilon_0`
259 */
260 const double ct_epsilon_0();
261
262 /**
263 * Get %Cantera error.
264 *
265 * Wraps C++ function: `custom code`
266 *
267 * @param bufLen Length of reserved array.
268 * @param buf String containing Cantera error.
269 * @returns Actual length of string or -1 for exception handling.
270 */
271 int32_t ct_getCanteraError(int32_t bufLen, char* buf);
272
273 /**
274 * Set Logger callback.
275 *
276 * Wraps C++ function: `custom code`
277 *
278 * @param writer Callback that is invoked to produce log output.
279 */
280 int32_t ct_setLogCallback(LogCallback writer);
281
282 /**
283 * Write a message to the logger.
284 *
285 * Wraps C++ function: `void writelog_direct(const string&)`
286 *
287 * @param msg C++ string to be written to the logger
288 */
289 int32_t ct_writeLog(const char* msg);
290
291 /**
292 * Delete all objects with mapping preserved.
293 *
294 * Wraps C++ reserved CLib function: `custom code`
295 *
296 * @returns Zero if successful or -1 for exception handling.
297 */
298 int32_t ct_clearStorage();
299
300 /**
301 * Delete all objects and erase mapping.
302 *
303 * Wraps C++ reserved CLib function: `custom code`
304 *
305 * @returns Zero if successful or -1 for exception handling.
306 */
307 int32_t ct_resetStorage();
308
309 /**
310 * @}
311 */
312
313#ifdef __cplusplus
314}
315#endif
316
317#endif // CT_H
int32_t ct_suppress_warnings()
Globally disable printing of (user) warnings.
Definition ct.cpp:173
int32_t ct_getCanteraError(int32_t bufLen, char *buf)
Get Cantera error.
Definition ct.cpp:381
const double ct_ElectronMass()
Electron Mass.
Definition ct.cpp:321
const double ct_Boltzmann()
Boltzmann constant.
Definition ct.cpp:251
int32_t ct_make_deprecation_warnings_fatal()
Turns deprecation warnings into exceptions.
Definition ct.cpp:162
int32_t ct_getDataDirectories(const char *sep, int32_t bufLen, char *buf)
Get the Cantera data directories.
Definition ct.cpp:127
int32_t ct_appdelete()
Delete and free all memory associated with the application.
Definition ct.cpp:230
const double ct_fineStructureConstant()
Fine structure constant.
Definition ct.cpp:311
int32_t ct_clearStorage()
Delete all objects with mapping preserved.
Definition ct.cpp:420
int32_t ct_findInputFile(const char *name, int32_t bufLen, char *buf)
Find an input file.
Definition ct.cpp:139
const double ct_StefanBoltz()
Stefan-Boltzmann constant.
Definition ct.cpp:341
int32_t ct_writeLog(const char *msg)
Write a message to the logger.
Definition ct.cpp:409
int32_t ct_make_warnings_fatal()
Turns Cantera warnings into exceptions.
Definition ct.cpp:195
int32_t ct_use_legacy_rate_constants(int32_t legacy)
Set definition used for rate constant calculation.
Definition ct.cpp:218
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:206
const double ct_GasConstant()
Universal Gas Constant.
Definition ct.cpp:331
const double ct_Planck()
Planck constant.
Definition ct.cpp:261
int32_t ct_setLogCallback(LogCallback writer)
Set Logger callback.
Definition ct.cpp:395
int32_t ct_warnings_suppressed()
Returns.
Definition ct.cpp:184
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:371
int32_t ct_resetStorage()
Delete all objects and erase mapping.
Definition ct.cpp:445
const double ct_permeability_0()
Permeability of free space.
Definition ct.cpp:361
const double ct_ElectronCharge()
Elementary charge.
Definition ct.cpp:271
const double ct_OneAtm()
One atmosphere [Pa].
Definition ct.cpp:291
int32_t ct_suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
Definition ct.cpp:151
const double ct_lightSpeed()
Speed of Light in a vacuum.
Definition ct.cpp:281
const double ct_Faraday()
Faraday constant.
Definition ct.cpp:351
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:116
const double ct_OneBar()
One bar [Pa].
Definition ct.cpp:301
const double ct_Avogadro()
Avogadro's Number.
Definition ct.cpp:241
void(* LogCallback)(enum LogLevel logLevel, const char *category, const char *message)
Represents a callback that is invoked to produce log output.