Cantera  3.2.0a1
Loading...
Searching...
No Matches
OneDim.h
Go to the documentation of this file.
1/**
2 * @file OneDim.h
3 */
4
5// This file is part of Cantera. See License.txt in the top-level directory or
6// at https://cantera.org/license.txt for license and copyright information.
7
8#ifndef CT_ONEDIM_H
9#define CT_ONEDIM_H
10
11#include "Domain1D.h"
12#include "MultiJac.h"
14
15namespace Cantera
16{
17
18class Func1;
19class MultiNewton;
20class AnyMap;
21
22/**
23 * Container class for multiple-domain 1D problems. Each domain is
24 * represented by an instance of Domain1D.
25 * @ingroup onedGroup
26 */
27class OneDim
28{
29public:
30 //! Default constructor
31 OneDim();
32
33 //! Construct a OneDim container for the domains in the list *domains*.
34 OneDim(vector<shared_ptr<Domain1D>>& domains);
35
36 virtual ~OneDim();
37 OneDim(const OneDim&) = delete;
38 OneDim& operator=(const OneDim&) = delete;
39
40 //! Add a domain. Domains are added left-to-right.
41 void addDomain(shared_ptr<Domain1D> d);
42
43 //! Return a reference to the Jacobian evaluator of an OneDim object.
44 //! @ingroup derivGroup
46
47 shared_ptr<SystemJacobian> getJacobian() {
48 return m_jac;
49 }
50
51 //! Return a reference to the Newton iterator.
53
54 //! Set the linear solver used to hold the Jacobian matrix and solve linear systems
55 //! as part of each Newton iteration. The default is a direct, banded solver.
56 void setLinearSolver(shared_ptr<SystemJacobian> solver);
57
58 //! Get the type of the linear solver being used.
59 shared_ptr<SystemJacobian> linearSolver() const { return m_jac; }
60
61 /**
62 * Solve F(x) = 0, where F(x) is the multi-domain residual function.
63 *
64 * @param x0 Starting estimate of solution.
65 * @param x1 Final solution satisfying F(x1) = 0.
66 * @param loglevel Controls amount of diagnostic output.
67 *
68 * @returns
69 * - 1 for success
70 * - -2 failure (maximum number of damping steps was reached)
71 * - -3 failure (solution was up against the bounds
72 */
73 int solve(double* x0, double* x1, int loglevel);
74
75 //! Number of domains.
76 size_t nDomains() const {
77 return m_dom.size();
78 }
79
80 //! Return a reference to domain i.
81 Domain1D& domain(size_t i) const {
82 return *m_dom[i];
83 }
84
85 //! Get the index of the domain named `name`.
86 size_t domainIndex(const string& name);
87
88 //! Check that the specified domain index is in range.
89 //! Throws an exception if n is greater than nDomains()-1
90 void checkDomainIndex(size_t n) const {
91 if (n >= m_dom.size()) {
92 throw IndexError("OneDim::checkDomainIndex", "domains", n, m_dom.size());
93 }
94 }
95
96 //! Check that an array size is at least nDomains().
97 //! Throws an exception if nn is less than nDomains(). Used before calls
98 //! which take an array pointer.
99 void checkDomainArraySize(size_t nn) const {
100 if (m_dom.size() > nn) {
101 throw ArraySizeError("OneDim::checkDomainArraySize", nn,
102 m_dom.size());
103 }
104 }
105
106 //! The index of the start of domain i in the solution vector.
107 size_t start(size_t i) const {
108 if (m_dom[i]->nComponents()) {
109 return m_dom[i]->loc();
110 } else {
111 // Special case for domains with no solution components to avoid
112 // spurious out-of-bounds memory access
113 return 0;
114 }
115 }
116
117 //! Total solution vector length;
118 size_t size() const {
119 return m_size;
120 }
121
122 //! Pointer to left-most domain (first added).
124 return m_dom[0].get();
125 }
126
127 //! Pointer to right-most domain (last added).
129 return m_dom.back().get();
130 }
131
132 //! Number of solution components at global point `jg`.
133 size_t nVars(size_t jg) {
134 return m_nvars[jg];
135 }
136
137 //! Location in the solution vector of the first component of global point `jg`.
138 size_t loc(size_t jg) {
139 return m_loc[jg];
140 }
141
142 //! Return the domain, local point index, and component name for the i-th
143 //! component of the global solution vector
144 std::tuple<string, size_t, string> component(size_t i);
145
146 //! Jacobian bandwidth.
147 size_t bandwidth() const {
148 return m_bw;
149 }
150
151 /**
152 * Initialize all domains. On the first call, this methods calls the init
153 * method of each domain, proceeding from left to right. Subsequent calls
154 * do nothing.
155 */
156 void init();
157
158 //! Total number of points.
159 size_t points() {
160 return m_pts;
161 }
162
163 /**
164 * Steady-state max norm (infinity norm) of the residual evaluated using
165 * solution x. On return, array r contains the steady-state residual
166 * values. Used only for diagnostic output.
167 */
168 double ssnorm(double* x, double* r);
169
170 //! Reciprocal of the time step.
171 double rdt() const {
172 return m_rdt;
173 }
174
175 //! Prepare for time stepping beginning with solution *x* and timestep *dt*.
176 void initTimeInteg(double dt, double* x);
177
178 //! True if transient mode.
179 bool transient() const {
180 return (m_rdt != 0.0);
181 }
182
183 //! True if steady mode.
184 bool steady() const {
185 return (m_rdt == 0.0);
186 }
187
188 /**
189 * Prepare to solve the steady-state problem. After invoking this method,
190 * subsequent calls to solve() will solve the steady-state problem. Sets
191 * the reciprocal of the time step to zero, and, if it was previously non-
192 * zero, signals that a new Jacobian will be needed.
193 */
194 void setSteadyMode();
195
196 /**
197 * Evaluate the multi-domain residual function
198 *
199 * @param j if j != npos, only evaluate residual for points j-1, j,
200 * and j + 1; otherwise, evaluate at all grid points.
201 * @param x solution vector
202 * @param r on return, contains the residual vector
203 * @param rdt Reciprocal of the time step. if omitted, then
204 * the default value is used.
205 * @param count Set to zero to omit this call from the statistics
206 */
207 void eval(size_t j, double* x, double* r, double rdt=-1.0, int count = 1);
208
209 /**
210 * Evaluates the Jacobian at x0 using finite differences.
211 *
212 * The Jacobian is computed by perturbing each component of `x0`, evaluating the
213 * residual function, and then estimating the partial derivatives numerically using
214 * finite differences to determine the corresponding column of the Jacobian.
215 *
216 * @param x0 State vector at which to evaluate the Jacobian
217 */
218 void evalJacobian(double* x0);
219
220 //! Return a pointer to the domain global point *i* belongs to.
221 /*!
222 * The domains are scanned right-to-left, and the first one with starting
223 * location less or equal to i is returned.
224 */
225 Domain1D* pointDomain(size_t i);
226
227 //! Call after one or more grids has changed size, for example after being refined.
228 virtual void resize();
229
230 //! Access the vector indicating which equations contain a transient term.
231 //! Elements are 1 for equations with a transient terms and 0 otherwise.
232 vector<int>& transientMask() {
233 return m_mask;
234 }
235
236 /**
237 * Take time steps using Backward Euler.
238 *
239 * @param nsteps number of steps
240 * @param dt initial step size
241 * @param x current solution vector
242 * @param r solution vector after time stepping
243 * @param loglevel controls amount of printed diagnostics
244 * @returns size of last timestep taken
245 */
246 double timeStep(int nsteps, double dt, double* x, double* r, int loglevel);
247
248 //! Reset values such as negative species concentrations in each domain.
249 //! @see Domain1D::resetBadValues
250 void resetBadValues(double* x);
251
252 //! Write statistics about the number of iterations and Jacobians at each
253 //! grid level
254 /*!
255 * @param printTime Boolean that indicates whether time should be printed
256 * out The default is true. It's turned off for test
257 * problems where we don't want to print any times
258 */
259 void writeStats(int printTime = 1);
260
261 //! @name Options
262 //! @{
263
264 //! Set the minimum time step allowed during time stepping
265 void setMinTimeStep(double tmin) {
266 m_tmin = tmin;
267 }
268
269 //! Set the maximum time step allowed during time stepping
270 void setMaxTimeStep(double tmax) {
271 m_tmax = tmax;
272 }
273
274 /**
275 * Sets a factor by which the time step is reduced if the time stepping
276 * fails. The default value is 0.5.
277 *
278 * @param tfactor factor time step is multiplied by if time stepping fails
279 */
280 void setTimeStepFactor(double tfactor) {
281 m_tfactor = tfactor;
282 }
283
284 //! Set the maximum number of timeteps allowed before successful
285 //! steady-state solve
286 void setMaxTimeStepCount(int nmax) {
287 m_nsteps_max = nmax;
288 }
289
290 //! Return the maximum number of timeteps allowed before successful
291 //! steady-state solve
292 int maxTimeStepCount() const {
293 return m_nsteps_max;
294 }
295 //! @}
296
297 //! Set the maximum number of steps that can be taken using the same Jacobian
298 //! before it must be re-evaluated.
299 //! @param ss_age Age limit during steady-state mode
300 //! @param ts_age Age limit during time stepping mode. If not specified, the
301 //! steady-state age is also used during time stepping.
302 void setJacAge(int ss_age, int ts_age=-1);
303
304 /**
305 * Save statistics on function and Jacobian evaluation, and reset the
306 * counters. Statistics are saved only if the number of Jacobian
307 * evaluations is greater than zero. The statistics saved are:
308 *
309 * - number of grid points
310 * - number of Jacobian evaluations
311 * - CPU time spent evaluating Jacobians
312 * - number of non-Jacobian function evaluations
313 * - CPU time spent evaluating functions
314 * - number of time steps
315 */
316 void saveStats();
317
318 //! Clear saved statistics
319 void clearStats();
320
321 //! Return total grid size in each call to solve()
322 const vector<size_t>& gridSizeStats() {
323 saveStats();
324 return m_gridpts;
325 }
326
327 //! Return CPU time spent evaluating Jacobians in each call to solve()
328 const vector<double>& jacobianTimeStats() {
329 saveStats();
330 return m_jacElapsed;
331 }
332
333 //! Return CPU time spent on non-Jacobian function evaluations in each call
334 //! to solve()
335 const vector<double>& evalTimeStats() {
336 saveStats();
337 return m_funcElapsed;
338 }
339
340 //! Return number of Jacobian evaluations made in each call to solve()
341 const vector<int>& jacobianCountStats() {
342 saveStats();
343 return m_jacEvals;
344 }
345
346 //! Return number of non-Jacobian function evaluations made in each call to
347 //! solve()
348 const vector<int>& evalCountStats() {
349 saveStats();
350 return m_funcEvals;
351 }
352
353 //! Return number of time steps taken in each call to solve()
354 const vector<int>& timeStepStats() {
355 saveStats();
356 return m_timeSteps;
357 }
358
359 //! Set a function that will be called every time #eval is called.
360 //! Can be used to provide keyboard interrupt support in the high-level
361 //! language interfaces.
362 void setInterrupt(Func1* interrupt) {
363 m_interrupt = interrupt;
364 }
365
366 //! Set a function that will be called after each successful timestep. The
367 //! function will be called with the size of the timestep as the argument.
368 //! Intended to be used for observing solver progress for debugging
369 //! purposes.
370 void setTimeStepCallback(Func1* callback) {
371 m_time_step_callback = callback;
372 }
373
374 //! Configure perturbations used to evaluate finite difference Jacobian
375 //! @param relative Relative perturbation (multiplied by the absolute value of
376 //! each component). Default `1.0e-5`.
377 //! @param absolute Absolute perturbation (independent of component value).
378 //! Default `1.0e-10`.
379 //! @param threshold Threshold below which to exclude elements from the Jacobian
380 //! Default `0.0`.
381 void setJacobianPerturbation(double relative, double absolute, double threshold) {
382 m_jacobianRelPerturb = relative;
383 m_jacobianAbsPerturb = absolute;
384 m_jacobianThreshold = threshold;
385 }
386
387protected:
388 //! Evaluate the steady-state Jacobian, accessible via jacobian()
389 //! @param[in] x Current state vector, length size()
390 //! @param[out] rsd Storage for the residual, length size()
391 void evalSSJacobian(double* x, double* rsd);
392
393 double m_tmin = 1e-16; //!< minimum timestep size
394 double m_tmax = 1e+08; //!< maximum timestep size
395
396 //! factor time step is multiplied by if time stepping fails ( < 1 )
397 double m_tfactor = 0.5;
398
399 shared_ptr<vector<double>> m_state; //!< Solution vector
400
401 shared_ptr<SystemJacobian> m_jac; //!< Jacobian evaluator
402 unique_ptr<MultiNewton> m_newt; //!< Newton iterator
403 double m_rdt = 0.0; //!< reciprocal of time step
404 bool m_jac_ok = false; //!< if true, Jacobian is current
405
406 size_t m_bw = 0; //!< Jacobian bandwidth
407 size_t m_size = 0; //!< solution vector size
408
409 //! Work arrays used during Jacobian evaluation
410 vector<double> m_work1, m_work2;
411
412 //! All domains comprising the system
413 vector<shared_ptr<Domain1D>> m_dom;
414
415 //! All connector and boundary domains
416 vector<shared_ptr<Domain1D>> m_connect;
417
418 //! All bulk/flow domains
419 vector<shared_ptr<Domain1D>> m_bulk;
420
421 //! Indicates whether one-time initialization for each domain has been completed.
422 bool m_init = false;
423
424 //! Number of variables at each point, across all domains. Length points().
425 //! Accessed with nVars().
426 vector<size_t> m_nvars;
427
428 //! Location in the state vector of the first component of each point, across all
429 //! domains. Accessed with loc().
430 vector<size_t> m_loc;
431
432 //! Transient mask. See transientMask().
433 vector<int> m_mask;
434
435 //! Total number of points.
436 size_t m_pts = 0;
437
438 int m_ss_jac_age = 20; //!< Maximum age of the Jacobian in steady-state mode.
439 int m_ts_jac_age = 20; //!< Maximum age of the Jacobian in time-stepping mode.
440
441 //! Function called at the start of every call to #eval.
442 Func1* m_interrupt = nullptr;
443
444 //! User-supplied function called after each successful timestep.
446
447 //! Number of time steps taken in the current call to solve()
448 int m_nsteps = 0;
449
450 //! Maximum number of timesteps allowed per call to solve()
451 int m_nsteps_max = 500;
452
453 //! Threshold for ignoring small elements in Jacobian
455 //! Relative perturbation of each component in finite difference Jacobian
456 double m_jacobianRelPerturb = 1e-5;
457 //! Absolute perturbation of each component in finite difference Jacobian
458 double m_jacobianAbsPerturb = 1e-10;
459
460private:
461 //! @name Statistics
462 //! Solver stats are collected after successfully solving on a particular grid.
463 //! @{
464 int m_nevals = 0; //!< Number of calls to eval()
465 double m_evaltime = 0; //!< Total time [s] spent in eval()
466
467 vector<size_t> m_gridpts; //!< Number of grid points in this grid
468 vector<int> m_jacEvals; //!< Number of Jacobian evaluations on this grid
469 vector<double> m_jacElapsed; //!< Time [s] spent evaluating Jacobians on this grid
470
471 //! Number of residual function evaluations on this grid (not counting evaluations
472 //! used to construct Jacobians).
473 vector<int> m_funcEvals;
474
475 //! Time [s] spent on residual function evaluations on this grid (not counting
476 //! evaluations used to construct Jacobians).
477 vector<double> m_funcElapsed;
478
479 //! Number of time steps taken in each call to solve() (for example, for each
480 //! successive grid refinement)
481 vector<int> m_timeSteps;
482
483 //! @}
484};
485
486}
487
488#endif
Declarations for class SystemJacobian.
Array size error.
Base class for one-dimensional domains.
Definition Domain1D.h:29
Base class for 'functor' classes that evaluate a function of one variable.
Definition Func1.h:75
An array index is out of range.
Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplie...
Definition MultiJac.h:25
Newton iterator for multi-domain, one-dimensional problems.
Definition MultiNewton.h:24
Container class for multiple-domain 1D problems.
Definition OneDim.h:28
int solve(double *x0, double *x1, int loglevel)
Solve F(x) = 0, where F(x) is the multi-domain residual function.
Definition OneDim.cpp:230
size_t start(size_t i) const
The index of the start of domain i in the solution vector.
Definition OneDim.h:107
int m_nsteps
Number of time steps taken in the current call to solve()
Definition OneDim.h:448
void init()
Initialize all domains.
Definition OneDim.cpp:385
void checkDomainIndex(size_t n) const
Check that the specified domain index is in range.
Definition OneDim.h:90
size_t m_size
solution vector size
Definition OneDim.h:407
int m_nsteps_max
Maximum number of timesteps allowed per call to solve()
Definition OneDim.h:451
virtual void resize()
Call after one or more grids has changed size, for example after being refined.
Definition OneDim.cpp:172
shared_ptr< SystemJacobian > linearSolver() const
Get the type of the linear solver being used.
Definition OneDim.h:59
void resetBadValues(double *x)
Reset values such as negative species concentrations in each domain.
Definition OneDim.cpp:491
void saveStats()
Save statistics on function and Jacobian evaluation, and reset the counters.
Definition OneDim.cpp:141
unique_ptr< MultiNewton > m_newt
Newton iterator.
Definition OneDim.h:402
double m_jacobianAbsPerturb
Absolute perturbation of each component in finite difference Jacobian.
Definition OneDim.h:458
size_t size() const
Total solution vector length;.
Definition OneDim.h:118
size_t loc(size_t jg)
Location in the solution vector of the first component of global point jg.
Definition OneDim.h:138
void eval(size_t j, double *x, double *r, double rdt=-1.0, int count=1)
Evaluate the multi-domain residual function.
Definition OneDim.cpp:261
double ssnorm(double *x, double *r)
Steady-state max norm (infinity norm) of the residual evaluated using solution x.
Definition OneDim.cpp:339
vector< int > & transientMask()
Access the vector indicating which equations contain a transient term.
Definition OneDim.h:232
void addDomain(shared_ptr< Domain1D > d)
Add a domain. Domains are added left-to-right.
Definition OneDim.cpp:65
double rdt() const
Reciprocal of the time step.
Definition OneDim.h:171
void initTimeInteg(double dt, double *x)
Prepare for time stepping beginning with solution x and timestep dt.
Definition OneDim.cpp:349
size_t nDomains() const
Number of domains.
Definition OneDim.h:76
vector< double > m_jacElapsed
Time [s] spent evaluating Jacobians on this grid.
Definition OneDim.h:469
Domain1D * right()
Pointer to right-most domain (last added).
Definition OneDim.h:128
std::tuple< string, size_t, string > component(size_t i)
Return the domain, local point index, and component name for the i-th component of the global solutio...
Definition OneDim.cpp:51
size_t bandwidth() const
Jacobian bandwidth.
Definition OneDim.h:147
double m_rdt
reciprocal of time step
Definition OneDim.h:403
double m_jacobianThreshold
Threshold for ignoring small elements in Jacobian.
Definition OneDim.h:454
void setMaxTimeStep(double tmax)
Set the maximum time step allowed during time stepping.
Definition OneDim.h:270
shared_ptr< SystemJacobian > m_jac
Jacobian evaluator.
Definition OneDim.h:401
shared_ptr< vector< double > > m_state
Solution vector.
Definition OneDim.h:399
void setMinTimeStep(double tmin)
Set the minimum time step allowed during time stepping.
Definition OneDim.h:265
vector< double > m_funcElapsed
Time [s] spent on residual function evaluations on this grid (not counting evaluations used to constr...
Definition OneDim.h:477
const vector< int > & evalCountStats()
Return number of non-Jacobian function evaluations made in each call to solve()
Definition OneDim.h:348
vector< shared_ptr< Domain1D > > m_connect
All connector and boundary domains.
Definition OneDim.h:416
vector< int > m_mask
Transient mask. See transientMask().
Definition OneDim.h:433
void setTimeStepCallback(Func1 *callback)
Set a function that will be called after each successful timestep.
Definition OneDim.h:370
Func1 * m_interrupt
Function called at the start of every call to eval.
Definition OneDim.h:442
const vector< int > & jacobianCountStats()
Return number of Jacobian evaluations made in each call to solve()
Definition OneDim.h:341
bool transient() const
True if transient mode.
Definition OneDim.h:179
void checkDomainArraySize(size_t nn) const
Check that an array size is at least nDomains().
Definition OneDim.h:99
const vector< size_t > & gridSizeStats()
Return total grid size in each call to solve()
Definition OneDim.h:322
void setMaxTimeStepCount(int nmax)
Set the maximum number of timeteps allowed before successful steady-state solve.
Definition OneDim.h:286
const vector< int > & timeStepStats()
Return number of time steps taken in each call to solve()
Definition OneDim.h:354
void setTimeStepFactor(double tfactor)
Sets a factor by which the time step is reduced if the time stepping fails.
Definition OneDim.h:280
vector< shared_ptr< Domain1D > > m_bulk
All bulk/flow domains.
Definition OneDim.h:419
vector< int > m_funcEvals
Number of residual function evaluations on this grid (not counting evaluations used to construct Jaco...
Definition OneDim.h:473
vector< size_t > m_loc
Location in the state vector of the first component of each point, across all domains.
Definition OneDim.h:430
double m_evaltime
Total time [s] spent in eval()
Definition OneDim.h:465
size_t nVars(size_t jg)
Number of solution components at global point jg.
Definition OneDim.h:133
size_t m_bw
Jacobian bandwidth.
Definition OneDim.h:406
double m_tfactor
factor time step is multiplied by if time stepping fails ( < 1 )
Definition OneDim.h:397
bool m_jac_ok
if true, Jacobian is current
Definition OneDim.h:404
int maxTimeStepCount() const
Return the maximum number of timeteps allowed before successful steady-state solve.
Definition OneDim.h:292
int m_ts_jac_age
Maximum age of the Jacobian in time-stepping mode.
Definition OneDim.h:439
size_t domainIndex(const string &name)
Get the index of the domain named name.
Definition OneDim.cpp:41
double timeStep(int nsteps, double dt, double *x, double *r, int loglevel)
Take time steps using Backward Euler.
Definition OneDim.cpp:397
Domain1D * pointDomain(size_t i)
Return a pointer to the domain global point i belongs to.
Definition OneDim.cpp:249
void setJacAge(int ss_age, int ts_age=-1)
Set the maximum number of steps that can be taken using the same Jacobian before it must be re-evalua...
Definition OneDim.cpp:114
vector< size_t > m_gridpts
Number of grid points in this grid.
Definition OneDim.h:467
void evalSSJacobian(double *x, double *rsd)
Evaluate the steady-state Jacobian, accessible via jacobian()
Definition OneDim.cpp:240
void evalJacobian(double *x0)
Evaluates the Jacobian at x0 using finite differences.
Definition OneDim.cpp:293
double m_tmin
minimum timestep size
Definition OneDim.h:393
size_t points()
Total number of points.
Definition OneDim.h:159
void setJacobianPerturbation(double relative, double absolute, double threshold)
Configure perturbations used to evaluate finite difference Jacobian.
Definition OneDim.h:381
double m_tmax
maximum timestep size
Definition OneDim.h:394
int m_ss_jac_age
Maximum age of the Jacobian in steady-state mode.
Definition OneDim.h:438
vector< size_t > m_nvars
Number of variables at each point, across all domains.
Definition OneDim.h:426
int m_nevals
Number of calls to eval()
Definition OneDim.h:464
bool m_init
Indicates whether one-time initialization for each domain has been completed.
Definition OneDim.h:422
void writeStats(int printTime=1)
Write statistics about the number of iterations and Jacobians at each grid level.
Definition OneDim.cpp:124
void clearStats()
Clear saved statistics.
Definition OneDim.cpp:159
void setSteadyMode()
Prepare to solve the steady-state problem.
Definition OneDim.cpp:368
void setLinearSolver(shared_ptr< SystemJacobian > solver)
Set the linear solver used to hold the Jacobian matrix and solve linear systems as part of each Newto...
Definition OneDim.cpp:105
size_t m_pts
Total number of points.
Definition OneDim.h:436
OneDim()
Default constructor.
Definition OneDim.cpp:20
vector< int > m_jacEvals
Number of Jacobian evaluations on this grid.
Definition OneDim.h:468
const vector< double > & jacobianTimeStats()
Return CPU time spent evaluating Jacobians in each call to solve()
Definition OneDim.h:328
Func1 * m_time_step_callback
User-supplied function called after each successful timestep.
Definition OneDim.h:445
vector< int > m_timeSteps
Number of time steps taken in each call to solve() (for example, for each successive grid refinement)
Definition OneDim.h:481
Domain1D & domain(size_t i) const
Return a reference to domain i.
Definition OneDim.h:81
vector< shared_ptr< Domain1D > > m_dom
All domains comprising the system.
Definition OneDim.h:413
const vector< double > & evalTimeStats()
Return CPU time spent on non-Jacobian function evaluations in each call to solve()
Definition OneDim.h:335
double m_jacobianRelPerturb
Relative perturbation of each component in finite difference Jacobian.
Definition OneDim.h:456
Domain1D * left()
Pointer to left-most domain (first added).
Definition OneDim.h:123
bool steady() const
True if steady mode.
Definition OneDim.h:184
vector< double > m_work1
Work arrays used during Jacobian evaluation.
Definition OneDim.h:410
MultiNewton & newton()
Return a reference to the Newton iterator.
Definition OneDim.cpp:100
void setInterrupt(Func1 *interrupt)
Set a function that will be called every time eval is called.
Definition OneDim.h:362
MultiJac & jacobian()
Return a reference to the Jacobian evaluator of an OneDim object.
Definition OneDim.cpp:88
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595