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