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