Cantera  4.0.0a1
Loading...
Searching...
No Matches
ctreactornet.h
Go to the documentation of this file.
1/**
2 * CTREACTORNET - Generated CLib %Cantera interface library.
3 *
4 * @file ctreactornet.h
5 *
6 * Generated CLib API for %Cantera's ReactorNet 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 CTREACTORNET_H
25#define CTREACTORNET_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 CAPIctreactornet ctreactornet Library
35 * Generated CLib API for %Cantera's ReactorNet 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 CAPIctreactornet
45 * @{
46 */
47
48 /**
49 * Create a reactor network containing one or more coupled reactors.
50 *
51 * Wraps C++ constructor: `shared_ptr<ReactorNet> newReactorNet(span<shared_ptr<ReactorBase>>)`
52 *
53 * @param[in] reactorsLen Length of array reserved for reactors.
54 * @param reactors Memory holding ReactorBase objects. A vector of shared pointers to the reactors to be linked together.
55 * @returns Handle to stored ReactorNet object or -1 for exception handling.
56 */
57 int32_t reactornet_new(int32_t reactorsLen, int32_t* reactors);
58
59 /**
60 * Set the initial value of the independent variable (typically time).
61 *
62 * Wraps C++ setter: `void ReactorNet::setInitialTime(double)`
63 *
64 * @param handle Handle to queried ReactorNet object.
65 * @param time Undocumented.
66 */
67 int32_t reactornet_setInitialTime(int32_t handle, double time);
68
69 /**
70 * Set the maximum integrator step.
71 *
72 * Wraps C++ setter: `void ReactorNet::setMaxTimeStep(double)`
73 *
74 * @param handle Handle to queried ReactorNet object.
75 * @param maxstep Undocumented.
76 */
77 int32_t reactornet_setMaxTimeStep(int32_t handle, double maxstep);
78
79 /**
80 * Set the relative tolerance for the integrator.
81 *
82 * Wraps C++ setter: `void ReactorNet::setRelativeTolerance(double)`
83 *
84 * @param handle Handle to queried ReactorNet object.
85 * @param rtol Relative tolerance for all state variables; must be positive.
86 */
87 int32_t reactornet_setRelativeTolerance(int32_t handle, double rtol);
88
89 /**
90 * Set the scalar absolute tolerance for the integrator.
91 *
92 * Wraps C++ setter: `void ReactorNet::setAbsoluteTolerance(double)`
93 *
94 * @param handle Handle to queried ReactorNet object.
95 * @param atol Scalar absolute tolerance for state variables without reactor-specific absolute tolerances; must be positive. Superseded by absolute tolerances set for individual reactors.
96 */
97 int32_t reactornet_setAbsoluteTolerance(int32_t handle, double atol);
98
99 /**
100 * Clear the user-specified scalar absolute tolerance.
101 *
102 * Wraps C++ method: `void ReactorNet::clearAbsoluteTolerance()`
103 *
104 * @param handle Handle to queried ReactorNet object.
105 */
106 int32_t reactornet_clearAbsoluteTolerance(int32_t handle);
107
108 /**
109 * Set the relative and scalar absolute tolerances for the integrator.
110 *
111 * Wraps C++ method: `void ReactorNet::setTolerances(double, double)`
112 *
113 * @param handle Handle to queried ReactorNet object.
114 * @param rtol If positive, set the relative tolerance for all state variables; ignored if negative.
115 * @param atol If positive, set the scalar absolute tolerance for all state variables; ignored if negative. Superseded by absolute tolerances set for individual reactors.
116 *
117 * @deprecated Per C++ annotation: To be removed after Cantera 4.0. Use setRelativeTolerance() and setAbsoluteTolerance() instead.
118 */
119 int32_t reactornet_setTolerances(int32_t handle, double rtol, double atol);
120
121 /**
122 * Set the relative and absolute tolerances for integrating the sensitivity equations.
123 *
124 * Wraps C++ method: `void ReactorNet::setSensitivityTolerances(double, double)`
125 *
126 * @param handle Handle to queried ReactorNet object.
127 * @param rtol Undocumented.
128 * @param atol Undocumented.
129 */
130 int32_t reactornet_setSensitivityTolerances(int32_t handle, double rtol, double atol);
131
132 /**
133 * Advance the state of all reactors in the independent variable (time or space).
134 *
135 * Wraps C++ setter: `void ReactorNet::advance(double)`
136 *
137 * @param handle Handle to queried ReactorNet object.
138 * @param t Time/distance to advance to (s or m).
139 */
140 int32_t reactornet_advance(int32_t handle, double t);
141
142 /**
143 * Advance the state of all reactors with respect to the independent variable (time or space).
144 *
145 * Wraps C++ getter: `double ReactorNet::step()`
146 *
147 * @param handle Handle to queried ReactorNet object.
148 */
149 double reactornet_step(int32_t handle);
150
151 /**
152 * Current value of the simulation time [s], for reactor networks that are solved in the time domain.
153 *
154 * Wraps C++ getter: `double ReactorNet::time()`
155 *
156 * @param handle Handle to queried ReactorNet object.
157 */
158 double reactornet_time(int32_t handle);
159
160 /**
161 * Relative tolerance.
162 *
163 * Wraps C++ getter: `double ReactorNet::rtol()`
164 *
165 * @param handle Handle to queried ReactorNet object.
166 */
167 double reactornet_rtol(int32_t handle);
168
169 /**
170 * Scalar absolute integration tolerance.
171 *
172 * Wraps C++ getter: `double ReactorNet::atol()`
173 *
174 * @param handle Handle to queried ReactorNet object.
175 */
176 double reactornet_atol(int32_t handle);
177
178 /**
179 * Return the sensitivity of the component named *component* with respect to the *p*-th sensitivity parameter.
180 *
181 * Wraps C++ method: `double ReactorNet::sensitivity(const string&, size_t, int)`
182 *
183 * @param handle Handle to queried ReactorNet object.
184 * @param component Undocumented.
185 * @param p Undocumented.
186 * @param reactor Undocumented.
187 */
188 double reactornet_sensitivity(int32_t handle, const char* component, int32_t p, int32_t reactor);
189
190 /**
191 * Delete ReactorNet object.
192 *
193 * Wraps C++ destructor: `undefined`
194 *
195 * @param handle Handle to ReactorNet object.
196 * @returns Zero for success and -1 for exception handling.
197 */
198 int32_t reactornet_del(int32_t handle);
199
200 /**
201 * Return size of ReactorNet storage.
202 *
203 * Wraps C++ reserved CLib function: `custom code`
204 *
205 * @returns Size or -1 for exception handling.
206 */
207 int32_t reactornet_cabinetSize();
208
209 /**
210 * @}
211 */
212
213#ifdef __cplusplus
214}
215#endif
216
217#endif // CTREACTORNET_H
int32_t reactornet_advance(int32_t handle, double t)
Advance the state of all reactors in the independent variable (time or space).
int32_t reactornet_setSensitivityTolerances(int32_t handle, double rtol, double atol)
Set the relative and absolute tolerances for integrating the sensitivity equations.
int32_t reactornet_setRelativeTolerance(int32_t handle, double rtol)
Set the relative tolerance for the integrator.
int32_t reactornet_clearAbsoluteTolerance(int32_t handle)
Clear the user-specified scalar absolute tolerance.
int32_t reactornet_setAbsoluteTolerance(int32_t handle, double atol)
Set the scalar absolute tolerance for the integrator.
double reactornet_time(int32_t handle)
Current value of the simulation time [s], for reactor networks that are solved in the time domain.
int32_t reactornet_cabinetSize()
Return size of ReactorNet storage.
int32_t reactornet_del(int32_t handle)
Delete ReactorNet object.
double reactornet_rtol(int32_t handle)
Relative tolerance.
double reactornet_step(int32_t handle)
Advance the state of all reactors with respect to the independent variable (time or space).
int32_t reactornet_new(int32_t reactorsLen, int32_t *reactors)
Create a reactor network containing one or more coupled reactors.
int32_t reactornet_setTolerances(int32_t handle, double rtol, double atol)
Set the relative and scalar absolute tolerances for the integrator.
int32_t reactornet_setInitialTime(int32_t handle, double time)
Set the initial value of the independent variable (typically time).
double reactornet_atol(int32_t handle)
Scalar absolute integration tolerance.
double reactornet_sensitivity(int32_t handle, const char *component, int32_t p, int32_t reactor)
Return the sensitivity of the component named component with respect to the p-th sensitivity paramete...
int32_t reactornet_setMaxTimeStep(int32_t handle, double maxstep)
Set the maximum integrator step.