Cantera  3.2.0a2
Loading...
Searching...
No Matches
ctsol.h
Go to the documentation of this file.
1/**
2 * CTSOL - Generated CLib %Cantera interface library.
3 *
4 * @file ctsol.h
5 *
6 * Generated CLib API for %Cantera's Solution class.
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 CTSOL_H
25#define CTSOL_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31 /**
32 * @defgroup CAPIctsol ctsol Library
33 * Generated CLib API for %Cantera's Solution class.
34 *
35 * @warning This library is an experimental part of the %Cantera API and
36 * may be changed or removed without notice.
37 *
38 * @ingroup CAPIindex
39 */
40
41 /**
42 * @addtogroup CAPIctsol
43 * @{
44 */
45
46 /**
47 * Create and initialize a new Solution manager from an input file.
48 *
49 * Wraps C++ constructor: `shared_ptr<Solution> newSolution(const string&, const string&, const string&)`
50 *
51 * Uses:
52 * - `shared_ptr<ThermoPhase> Solution::thermo()`
53 * - `shared_ptr<Kinetics> Solution::kinetics()`
54 * - `shared_ptr<Transport> Solution::transport()`
55 *
56 * @param infile name of the input file
57 * @param name name of the phase in the file. If this is blank, the first phase in the file is used.
58 * @param transport name of the transport model.
59 * @returns Handle to stored Solution object or -1 for exception handling.
60 */
61 int32_t sol_newSolution(const char* infile, const char* name, const char* transport);
62
63 /**
64 * Create and initialize a new Interface from an input file.
65 *
66 * Wraps C++ constructor: `shared_ptr<Interface> newInterface(const string&, const string&, const vector<shared_ptr<Solution>>&)`
67 *
68 * Uses:
69 * - `shared_ptr<ThermoPhase> Solution::thermo()`
70 * - `shared_ptr<Kinetics> Solution::kinetics()`
71 *
72 * @param infile name of the input file
73 * @param name name of the phase in the file. If this is the empty string, the first phase in the file is used.
74 * @param[in] adjacentLen Length of array reserved for adjacent.
75 * @param adjacent Memory holding Solution objects. vector containing adjacent Solution objects. If empty, adjacent phases will be instantiated based on the phase definition.
76 * @returns Handle to stored Interface object or -1 for exception handling.
77 */
78 int32_t sol_newInterface(const char* infile, const char* name, int32_t adjacentLen, const int32_t* adjacent);
79
80 /**
81 * Delete Solution object.
82 *
83 * Wraps C++ destructor: `undefined`
84 *
85 * Uses:
86 * - `shared_ptr<ThermoPhase> Solution::thermo()`
87 * - `shared_ptr<Kinetics> Solution::kinetics()`
88 * - `shared_ptr<Transport> Solution::transport()`
89 *
90 * @param handle Handle to Solution object.
91 * @returns Zero for success and -1 for exception handling.
92 */
93 int32_t sol_del(int32_t handle);
94
95 /**
96 * Return the name of this Solution object.
97 *
98 * Wraps C++ getter: `string Solution::name()`
99 *
100 * @param handle Handle to queried Solution object.
101 * @param[in] bufLen Length of reserved array.
102 * @param[out] buf Returned string value.
103 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
104 */
105 int32_t sol_name(int32_t handle, int32_t bufLen, char* buf);
106
107 /**
108 * Set the name of this Solution object.
109 *
110 * Wraps C++ setter: `void Solution::setName(const string&)`
111 *
112 * @param handle Handle to queried Solution object.
113 * @param name Undocumented.
114 */
115 int32_t sol_setName(int32_t handle, const char* name);
116
117 /**
118 * Accessor for the ThermoPhase pointer.
119 *
120 * Wraps C++ getter: `shared_ptr<ThermoPhase> Solution::thermo()`
121 *
122 * @param handle Handle to queried Solution object.
123 * @returns Handle to stored ThermoPhase object or -1 for exception handling.
124 */
125 int32_t sol_thermo(int32_t handle);
126
127 /**
128 * Accessor for the Kinetics pointer.
129 *
130 * Wraps C++ getter: `shared_ptr<Kinetics> Solution::kinetics()`
131 *
132 * @param handle Handle to queried Solution object.
133 * @returns Handle to stored Kinetics object or -1 for exception handling.
134 */
135 int32_t sol_kinetics(int32_t handle);
136
137 /**
138 * Accessor for the Transport pointer.
139 *
140 * Wraps C++ getter: `shared_ptr<Transport> Solution::transport()`
141 *
142 * @param handle Handle to queried Solution object.
143 * @returns Handle to stored Transport object or -1 for exception handling.
144 */
145 int32_t sol_transport(int32_t handle);
146
147 /**
148 * Retrieve transport model name.
149 *
150 * Wraps C++ getter: `string Solution::transportModel()`
151 *
152 * @param handle Handle to queried Solution object.
153 * @param[in] bufLen Length of reserved array.
154 * @param[out] buf Returned string value.
155 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
156 */
157 int32_t sol_transportModel(int32_t handle, int32_t bufLen, char* buf);
158
159 /**
160 * Set the Transport object by name.
161 *
162 * Wraps C++ accessor: `void Solution::setTransportModel(const string&)`
163 *
164 * Uses:
165 * - `shared_ptr<Transport> Solution::transport()`
166 *
167 * @param handle Handle to queried Solution object.
168 * @param model name of transport model; if omitted, the default model is used
169 */
170 int32_t sol_setTransportModel(int32_t handle, const char* model);
171
172 /**
173 * Get the number of adjacent phases.
174 *
175 * Wraps C++ getter: `size_t Solution::nAdjacent()`
176 *
177 * @param handle Handle to queried Solution object.
178 */
179 int32_t sol_nAdjacent(int32_t handle);
180
181 /**
182 * Get the Solution object for an adjacent phase by index.
183 *
184 * Wraps C++ accessor: `shared_ptr<Solution> Solution::adjacent(size_t)`
185 *
186 * Uses:
187 * - `size_t Solution::nAdjacent()`
188 * - `shared_ptr<ThermoPhase> Solution::thermo()`
189 * - `shared_ptr<Kinetics> Solution::kinetics()`
190 * - `shared_ptr<Transport> Solution::transport()`
191 *
192 * @param handle Handle to queried Solution object.
193 * @param i Undocumented.
194 * @returns Handle to stored Solution object or -1 for exception handling.
195 */
196 int32_t sol_adjacent(int32_t handle, int32_t i);
197
198 /**
199 * Get the name of an adjacent phase by index.
200 *
201 * Wraps C++ method: `string Solution::adjacentName(size_t)`
202 *
203 * @param handle Handle to queried Solution object.
204 * @param i Undocumented.
205 * @param[in] bufLen Length of reserved array.
206 * @param[out] buf Returned string value.
207 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
208 */
209 int32_t sol_adjacentName(int32_t handle, int32_t i, int32_t bufLen, char* buf);
210
211 /**
212 * Retrieve source used for object creation; usually an input file name.
213 *
214 * Wraps C++ getter: `const string Solution::source()`
215 *
216 * @param handle Handle to queried Solution object.
217 * @param[in] bufLen Length of reserved array.
218 * @param[out] buf Returned string value.
219 * @returns Actual length of string including string-terminating null byte, \0, or -1 for exception handling.
220 */
221 int32_t sol_source(int32_t handle, int32_t bufLen, char* buf);
222
223 /**
224 * Return size of Solution storage.
225 *
226 * Wraps C++ reserved CLib function: `custom code`
227 *
228 * @returns Size or -1 for exception handling.
229 */
230 int32_t sol_cabinetSize();
231
232 /**
233 * @}
234 */
235
236#ifdef __cplusplus
237}
238#endif
239
240#endif // CTSOL_H
int32_t sol_adjacent(int32_t handle, int32_t i)
Get the Solution object for an adjacent phase by index.
Definition ctsol.cpp:223
int32_t sol_newInterface(const char *infile, const char *name, int32_t adjacentLen, const int32_t *adjacent)
Create and initialize a new Interface from an input file.
Definition ctsol.cpp:76
int32_t sol_adjacentName(int32_t handle, int32_t i, int32_t bufLen, char *buf)
Get the name of an adjacent phase by index.
Definition ctsol.cpp:247
int32_t sol_newSolution(const char *infile, const char *name, const char *transport)
Create and initialize a new Solution manager from an input file.
Definition ctsol.cpp:55
int32_t sol_source(int32_t handle, int32_t bufLen, char *buf)
Retrieve source used for object creation; usually an input file name.
Definition ctsol.cpp:259
int32_t sol_del(int32_t handle)
Delete Solution object.
Definition ctsol.cpp:98
int32_t sol_transport(int32_t handle)
Accessor for the Transport pointer.
Definition ctsol.cpp:174
int32_t sol_thermo(int32_t handle)
Accessor for the ThermoPhase pointer.
Definition ctsol.cpp:152
int32_t sol_transportModel(int32_t handle, int32_t bufLen, char *buf)
Retrieve transport model name.
Definition ctsol.cpp:185
int32_t sol_cabinetSize()
Return size of Solution storage.
Definition ctsol.cpp:271
int32_t sol_nAdjacent(int32_t handle)
Get the number of adjacent phases.
Definition ctsol.cpp:213
int32_t sol_kinetics(int32_t handle)
Accessor for the Kinetics pointer.
Definition ctsol.cpp:163
int32_t sol_name(int32_t handle, int32_t bufLen, char *buf)
Return the name of this Solution object.
Definition ctsol.cpp:129
int32_t sol_setTransportModel(int32_t handle, const char *model)
Set the Transport object by name.
Definition ctsol.cpp:197
int32_t sol_setName(int32_t handle, const char *name)
Set the name of this Solution object.
Definition ctsol.cpp:141