Cantera  2.3.0
Domain1D.h
Go to the documentation of this file.
1  //! @file Domain1D.h
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CT_DOMAIN1D_H
7 #define CT_DOMAIN1D_H
8 
11 #include "cantera/base/global.h"
12 #include "refine.h"
13 
14 namespace Cantera
15 {
16 
17 // domain types
18 const int cFlowType = 50;
19 const int cConnectorType = 100;
20 const int cSurfType = 102;
21 const int cInletType = 104;
22 const int cSymmType = 105;
23 const int cOutletType = 106;
24 const int cEmptyType = 107;
25 const int cOutletResType = 108;
26 const int cPorousType = 109;
27 
28 class MultiJac;
29 class OneDim;
30 class XML_Node;
31 
32 /**
33  * Base class for one-dimensional domains.
34  * @ingroup onedim
35  */
36 class Domain1D
37 {
38 public:
39  /**
40  * Constructor.
41  * @param nv Number of variables at each grid point.
42  * @param points Number of grid points.
43  * @param time (unused)
44  */
45  Domain1D(size_t nv=1, size_t points=1, double time=0.0);
46 
47  virtual ~Domain1D() {}
48 
49  //! Domain type flag.
50  int domainType() {
51  return m_type;
52  }
53 
54  //! The left-to-right location of this domain.
55  size_t domainIndex() {
56  return m_index;
57  }
58 
59  //! True if the domain is a connector domain.
60  bool isConnector() {
61  return (m_type >= cConnectorType);
62  }
63 
64  //! The container holding this domain.
65  const OneDim& container() const {
66  return *m_container;
67  }
68 
69  //! Specify the container object for this domain, and the position of this
70  //! domain in the list.
71  void setContainer(OneDim* c, size_t index) {
72  m_container = c;
73  m_index = index;
74  }
75 
76  //! Set the Jacobian bandwidth. See the discussion of method bandwidth().
77  void setBandwidth(int bw = -1) {
78  m_bw = bw;
79  }
80 
81  //! Set the Jacobian bandwidth for this domain.
82  /**
83  * When class OneDim computes the bandwidth of the overall multi-domain
84  * problem (in OneDim::resize()), it calls this method for the bandwidth
85  * of each domain. If setBandwidth has not been called, then a negative
86  * bandwidth is returned, in which case OneDim assumes that this domain is
87  * dense -- that is, at each point, all components depend on the value of
88  * all other components at that point. In this case, the bandwidth is bw =
89  * 2*nComponents() - 1. However, if this domain contains some components
90  * that are uncoupled from other components at the same point, then this
91  * default bandwidth may greatly overestimate the true bandwidth, with a
92  * substantial penalty in performance. For such domains, use method
93  * setBandwidth to specify the bandwidth before passing this domain to the
94  * Sim1D or OneDim constructor.
95  */
96  size_t bandwidth() {
97  return m_bw;
98  }
99 
100  /*!
101  * Initialize. This method is called by OneDim::init() for each domain once
102  * at the beginning of a simulation. Base class method does nothing, but may
103  * be overloaded.
104  */
105  virtual void init() { }
106 
107  virtual void setInitialState(doublereal* xlocal = 0) {}
108  virtual void setState(size_t point, const doublereal* state, doublereal* x) {}
109 
110  /*!
111  * When called, this function should reset "bad" values in the state vector
112  * such as negative species concentrations. This function may be called
113  * after a failed solution attempt.
114  */
115  virtual void resetBadValues(double* xg) {}
116 
117  /*!
118  * Resize the domain to have nv components and np grid points. This method
119  * is virtual so that subclasses can perform other actions required to
120  * resize the domain.
121  */
122  virtual void resize(size_t nv, size_t np);
123 
124  //! Return a reference to the grid refiner.
126  return *m_refiner;
127  }
128 
129  //! Number of components at each grid point.
130  size_t nComponents() const {
131  return m_nv;
132  }
133 
134  //! Check that the specified component index is in range.
135  //! Throws an exception if n is greater than nComponents()-1
136  void checkComponentIndex(size_t n) const {
137  if (n >= m_nv) {
138  throw IndexError("checkComponentIndex", "points", n, m_nv-1);
139  }
140  }
141 
142  //! Check that an array size is at least nComponents().
143  //! Throws an exception if nn is less than nComponents(). Used before calls
144  //! which take an array pointer.
145  void checkComponentArraySize(size_t nn) const {
146  if (m_nv > nn) {
147  throw ArraySizeError("checkComponentArraySize", nn, m_nv);
148  }
149  }
150 
151  //! Number of grid points in this domain.
152  size_t nPoints() const {
153  return m_points;
154  }
155 
156  //! Check that the specified point index is in range.
157  //! Throws an exception if n is greater than nPoints()-1
158  void checkPointIndex(size_t n) const {
159  if (n >= m_points) {
160  throw IndexError("checkPointIndex", "points", n, m_points-1);
161  }
162  }
163 
164  //! Check that an array size is at least nPoints().
165  //! Throws an exception if nn is less than nPoints(). Used before calls
166  //! which take an array pointer.
167  void checkPointArraySize(size_t nn) const {
168  if (m_points > nn) {
169  throw ArraySizeError("checkPointArraySize", nn, m_points);
170  }
171  }
172 
173  //! Name of the nth component. May be overloaded.
174  virtual std::string componentName(size_t n) const;
175 
176  void setComponentName(size_t n, const std::string& name) {
177  m_name[n] = name;
178  }
179 
180  //! @deprecated To be removed after Cantera 2.3
181  void setComponentType(size_t n, int ctype) {
182  warn_deprecated("Domain1D::setComponentType",
183  "To be removed after Cantera 2.3.");
184  if (ctype == 0) {
185  setAlgebraic(n);
186  }
187  }
188 
189  //! index of component with name \a name.
190  size_t componentIndex(const std::string& name) const;
191 
192  void setBounds(size_t n, doublereal lower, doublereal upper) {
193  m_min[n] = lower;
194  m_max[n] = upper;
195  }
196 
197  //! Set tolerances for time-stepping mode
198  /*!
199  * @param rtol Relative tolerance
200  * @param atol Absolute tolerance
201  * @param n component index these tolerances apply to. If set to -1 (the
202  * default), these tolerances will be applied to all solution
203  * components.
204  */
205  void setTransientTolerances(doublereal rtol, doublereal atol, size_t n=npos);
206 
207  //! Set tolerances for steady-state mode
208  /*!
209  * @param rtol Relative tolerance
210  * @param atol Absolute tolerance
211  * @param n component index these tolerances apply to. If set to -1 (the
212  * default), these tolerances will be applied to all solution
213  * components.
214  */
215  void setSteadyTolerances(doublereal rtol, doublereal atol, size_t n=npos);
216 
217  //! Relative tolerance of the nth component.
218  doublereal rtol(size_t n) {
219  return (m_rdt == 0.0 ? m_rtol_ss[n] : m_rtol_ts[n]);
220  }
221 
222  //! Absolute tolerance of the nth component.
223  doublereal atol(size_t n) {
224  return (m_rdt == 0.0 ? m_atol_ss[n] : m_atol_ts[n]);
225  }
226 
227  //! Steady relative tolerance of the nth component
228  double steady_rtol(size_t n) {
229  return m_rtol_ss[n];
230  }
231 
232  //! Steady absolute tolerance of the nth component
233  double steady_atol(size_t n) {
234  return m_atol_ss[n];
235  }
236 
237  //! Transient relative tolerance of the nth component
238  double transient_rtol(size_t n) {
239  return m_rtol_ts[n];
240  }
241 
242  //! Transient absolute tolerance of the nth component
243  double transient_atol(size_t n) {
244  return m_atol_ts[n];
245  }
246 
247  //! Upper bound on the nth component.
248  doublereal upperBound(size_t n) const {
249  return m_max[n];
250  }
251 
252  //! Lower bound on the nth component
253  doublereal lowerBound(size_t n) const {
254  return m_min[n];
255  }
256 
257  //! Prepare to do time stepping with time step dt
258  /*!
259  * Copy the internally-stored solution at the last time step to array x0.
260  */
261  void initTimeInteg(doublereal dt, const doublereal* x0) {
262  std::copy(x0 + loc(), x0 + loc() + size(), m_slast.begin());
263  m_rdt = 1.0/dt;
264  }
265 
266  //! Prepare to solve the steady-state problem
267  /*!
268  * Set the internally-stored reciprocal of the time step to 0.0
269  */
270  void setSteadyMode() {
271  m_rdt = 0.0;
272  }
273 
274  //! True if in steady-state mode
275  bool steady() {
276  return (m_rdt == 0.0);
277  }
278 
279  //! True if not in steady-state mode
280  bool transient() {
281  return (m_rdt != 0.0);
282  }
283 
284  /*!
285  * Set this if something has changed in the governing
286  * equations (e.g. the value of a constant has been changed,
287  * so that the last-computed Jacobian is no longer valid.
288  */
289  void needJacUpdate();
290 
291  /*!
292  * Evaluate the steady-state residual at all points, even if in
293  * transient mode. Used only to print diagnostic output.
294  * @deprecated To be removed after Cantera 2.3
295  */
296  void evalss(doublereal* x, doublereal* r, integer* mask) {
297  warn_deprecated("Domain1D::evalss", "To be removed after Cantera 2.3");
298  eval(npos,x,r,mask,0.0);
299  }
300 
301  //! Evaluate the residual function at point j. If j == npos,
302  //! evaluate the residual function at all points.
303  /*!
304  * This function must be implemented in classes derived from Domain1D.
305  *
306  * @param j Grid point at which to update the residual
307  * @param[in] x State vector
308  * @param[out] r residual vector
309  * @param[out] mask Boolean mask indicating whether each solution
310  * component has a time derivative (1) or not (0).
311  * @param[in] rdt Reciprocal of the timestep (`rdt=0` implies steady-
312  * state.)
313  */
314  virtual void eval(size_t j, doublereal* x, doublereal* r,
315  integer* mask, doublereal rdt=0.0);
316 
317  //! @deprecated To be removed after Cantera 2.3. Derived classes should
318  //! implement eval() instead.
319  virtual doublereal residual(doublereal* x, size_t n, size_t j) {
320  warn_deprecated("Domain1D::residual", "To be removed after Cantera 2.3.");
321  throw CanteraError("Domain1D::residual","residual function must be overloaded in derived class "+id());
322  }
323 
324  //! @deprecated To be removed after Cantera 2.3
325  int timeDerivativeFlag(size_t n) {
326  warn_deprecated("Domain1D::timeDerivativeFlag",
327  "To be removed after Cantera 2.3.");
328  return m_td[n];
329  }
330 
331  //! @deprecated To be removed after Cantera 2.3
332  void setAlgebraic(size_t n) {
333  warn_deprecated("Domain1D::setAlgebraic",
334  "To be removed after Cantera 2.3.");
335  m_td[n] = 0;
336  }
337 
338  //! @deprecated To be removed after Cantera 2.3
339  virtual void update(doublereal* x) {
340  warn_deprecated("Domain1D::update", "To be removed after Cantera 2.3.");
341  }
342 
343  //! @deprecated To be removed after Cantera 2.3
344  doublereal time() const {
345  warn_deprecated("Domain1D::time", "To be removed after Cantera 2.3.");
346  return m_time;
347  }
348  //! @deprecated To be removed after Cantera 2.3
349  void incrementTime(doublereal dt) {
350  warn_deprecated("Domain1D::incrementTime",
351  "To be removed after Cantera 2.3.");
352  m_time += dt;
353  }
354  size_t index(size_t n, size_t j) const {
355  return m_nv*j + n;
356  }
357  doublereal value(const doublereal* x, size_t n, size_t j) const {
358  return x[index(n,j)];
359  }
360 
361  virtual void setJac(MultiJac* jac) {}
362 
363  //! Save the current solution for this domain into an XML_Node
364  /*!
365  * Base class version of the general domain1D save function. Derived classes
366  * should call the base class method in addition to saving their own data.
367  *
368  * @param o XML_Node to save the solution to.
369  * @param sol Current value of the solution vector. The object will pick
370  * out which part of the solution vector pertains to this
371  * object.
372  * @return XML_Node created to represent this domain
373  */
374  virtual XML_Node& save(XML_Node& o, const doublereal* const sol);
375 
376  //! Restore the solution for this domain from an XML_Node
377  /*!
378  * Base class version of the general Domain1D restore function. Derived
379  * classes should call the base class method in addition to restoring
380  * their own data.
381  *
382  * @param dom XML_Node for this domain
383  * @param soln Current value of the solution vector, local to this object.
384  * @param loglevel 0 to suppress all output; 1 to show warnings; 2 for
385  * verbose output
386  */
387  virtual void restore(const XML_Node& dom, doublereal* soln, int loglevel);
388 
389  size_t size() const {
390  return m_nv*m_points;
391  }
392 
393  /**
394  * Find the index of the first grid point in this domain, and
395  * the start of its variables in the global solution vector.
396  */
397  void locate();
398 
399  /**
400  * Location of the start of the local solution vector in the global
401  * solution vector,
402  */
403  virtual size_t loc(size_t j = 0) const {
404  return m_iloc;
405  }
406 
407  /**
408  * The index of the first (i.e., left-most) grid point belonging to this
409  * domain.
410  */
411  size_t firstPoint() const {
412  return m_jstart;
413  }
414 
415  /**
416  * The index of the last (i.e., right-most) grid point belonging to this
417  * domain.
418  */
419  size_t lastPoint() const {
420  return m_jstart + m_points - 1;
421  }
422 
423  /**
424  * Set the left neighbor to domain 'left.' Method 'locate' is called to
425  * update the global positions of this domain and all those to its right.
426  */
428  m_left = left;
429  locate();
430  }
431 
432  //! Set the right neighbor to domain 'right.'
434  m_right = right;
435  }
436 
437  //! Append domain 'right' to this one, and update all links.
439  linkRight(right);
440  right->linkLeft(this);
441  }
442 
443  //! Return a pointer to the left neighbor.
444  Domain1D* left() const {
445  return m_left;
446  }
447 
448  //! Return a pointer to the right neighbor.
449  Domain1D* right() const {
450  return m_right;
451  }
452 
453  //! Value of component n at point j in the previous solution.
454  double prevSoln(size_t n, size_t j) const {
455  return m_slast[m_nv*j + n];
456  }
457 
458  //! Specify an identifying tag for this domain.
459  void setID(const std::string& s) {
460  m_id = s;
461  }
462 
463  std::string id() const {
464  if (m_id != "") {
465  return m_id;
466  } else {
467  return fmt::format("domain {}", m_index);
468  }
469  }
470 
471  //! Specify descriptive text for this domain.
472  //! @deprecated To be removed after Cantera 2.3.
473  void setDesc(const std::string& s) {
474  warn_deprecated("Domain1D::setDesc", "To be removed after Cantera 2.3.");
475  m_desc = s;
476  }
477 
478  //! @deprecated To be removed after Cantera 2.3.
479  const std::string& desc() {
480  warn_deprecated("Domain1D::desc", "To be removed after Cantera 2.3.");
481  return m_desc;
482  }
483 
484  //! @deprecated To be removed after Cantera 2.3.
485  virtual void getTransientMask(integer* mask) {
486  warn_deprecated("Domain1D::getTransientMask",
487  "To be removed after Cantera 2.3.");
488  }
489 
490  virtual void showSolution_s(std::ostream& s, const doublereal* x) {}
491 
492  //! Print the solution.
493  virtual void showSolution(const doublereal* x);
494 
495  doublereal z(size_t jlocal) const {
496  return m_z[jlocal];
497  }
498  doublereal zmin() const {
499  return m_z[0];
500  }
501  doublereal zmax() const {
502  return m_z[m_points - 1];
503  }
504 
505  void setProfile(const std::string& name, double* values, double* soln);
506 
507  vector_fp& grid() {
508  return m_z;
509  }
510  const vector_fp& grid() const {
511  return m_z;
512  }
513  doublereal grid(size_t point) const {
514  return m_z[point];
515  }
516 
517  //! called to set up initial grid, and after grid refinement
518  virtual void setupGrid(size_t n, const doublereal* z);
519 
520  /**
521  * Writes some or all initial solution values into the global solution
522  * array, beginning at the location pointed to by x. This method is called
523  * by the Sim1D constructor, and allows default values or ones that have
524  * been set locally prior to installing this domain into the container to be
525  * written to the global solution vector.
526  */
527  virtual void _getInitialSoln(doublereal* x);
528 
529  //! Initial value of solution component \a n at grid point \a j.
530  virtual doublereal initialValue(size_t n, size_t j);
531 
532  /**
533  * In some cases, a domain may need to set parameters that depend on the
534  * initial solution estimate. In such cases, the parameters may be set in
535  * method _finalize. This method is called just before the Newton solver is
536  * called, and the x array is guaranteed to be the local solution vector for
537  * this domain that will be used as the initial guess. If no such parameters
538  * need to be set, then method _finalize does not need to be overloaded.
539  */
540  virtual void _finalize(const doublereal* x) {}
541 
542  /**
543  * In some cases, for computational efficiency some properties (e.g.
544  * transport coefficients) may not be updated during Jacobian evaluations.
545  * Set this to `true` to force these properties to be udpated even while
546  * calculating Jacobian elements.
547  */
548  void forceFullUpdate(bool update) {
549  m_force_full_update = update;
550  }
551 
552 protected:
553  doublereal m_rdt;
554  size_t m_nv;
555  size_t m_points;
556  vector_fp m_slast;
557  doublereal m_time; //!< @deprecated To be removed after Cantera 2.3.
558  vector_fp m_max;
559  vector_fp m_min;
560  vector_fp m_rtol_ss, m_rtol_ts;
561  vector_fp m_atol_ss, m_atol_ts;
562  vector_fp m_z;
563  OneDim* m_container;
564  size_t m_index;
565  int m_type;
566 
567  //! Starting location within the solution vector for unknowns that
568  //! correspond to this domain
569  /*!
570  * Remember there may be multiple domains associated with this problem
571  */
572  size_t m_iloc;
573 
574  size_t m_jstart;
575 
576  Domain1D* m_left, *m_right;
577 
578  //! Identity tag for the domain
579  std::string m_id;
580  std::string m_desc;
581  std::unique_ptr<Refiner> m_refiner;
582  vector_int m_td; //!< @deprecated To be removed after Cantera 2.3.
583  std::vector<std::string> m_name;
584  int m_bw;
585  bool m_force_full_update;
586 };
587 }
588 
589 #endif
Domain1D(size_t nv=1, size_t points=1, double time=0.0)
Constructor.
Definition: Domain1D.cpp:17
Container class for multiple-domain 1D problems.
Definition: OneDim.h:25
Array size error.
Definition: ctexceptions.h:134
const OneDim & container() const
The container holding this domain.
Definition: Domain1D.h:65
virtual void _getInitialSoln(doublereal *x)
Writes some or all initial solution values into the global solution array, beginning at the location ...
Definition: Domain1D.cpp:293
double steady_rtol(size_t n)
Steady relative tolerance of the nth component.
Definition: Domain1D.h:228
void locate()
Find the index of the first grid point in this domain, and the start of its variables in the global s...
Definition: Domain1D.cpp:214
void setSteadyMode()
Prepare to solve the steady-state problem.
Definition: Domain1D.h:270
size_t m_iloc
Starting location within the solution vector for unknowns that correspond to this domain...
Definition: Domain1D.h:572
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:165
Domain1D * right() const
Return a pointer to the right neighbor.
Definition: Domain1D.h:449
size_t firstPoint() const
The index of the first (i.e., left-most) grid point belonging to this domain.
Definition: Domain1D.h:411
void setAlgebraic(size_t n)
Definition: Domain1D.h:332
virtual doublereal residual(doublereal *x, size_t n, size_t j)
Definition: Domain1D.h:319
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
void forceFullUpdate(bool update)
In some cases, for computational efficiency some properties (e.g.
Definition: Domain1D.h:548
void checkPointIndex(size_t n) const
Check that the specified point index is in range.
Definition: Domain1D.h:158
void setContainer(OneDim *c, size_t index)
Specify the container object for this domain, and the position of this domain in the list...
Definition: Domain1D.h:71
vector_int m_td
Definition: Domain1D.h:582
virtual void restore(const XML_Node &dom, doublereal *soln, int loglevel)
Restore the solution for this domain from an XML_Node.
Definition: Domain1D.cpp:173
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
const std::string & desc()
Definition: Domain1D.h:479
virtual XML_Node & save(XML_Node &o, const doublereal *const sol)
Save the current solution for this domain into an XML_Node.
Definition: Domain1D.cpp:160
void linkLeft(Domain1D *left)
Set the left neighbor to domain &#39;left.
Definition: Domain1D.h:427
virtual void resetBadValues(double *xg)
Definition: Domain1D.h:115
std::vector< int > vector_int
Vector of ints.
Definition: ct_defs.h:159
void setBandwidth(int bw=-1)
Set the Jacobian bandwidth. See the discussion of method bandwidth().
Definition: Domain1D.h:77
Base class for one-dimensional domains.
Definition: Domain1D.h:36
void setComponentType(size_t n, int ctype)
Definition: Domain1D.h:181
size_t lastPoint() const
The index of the last (i.e., right-most) grid point belonging to this domain.
Definition: Domain1D.h:419
virtual void getTransientMask(integer *mask)
Definition: Domain1D.h:485
std::string m_id
Identity tag for the domain.
Definition: Domain1D.h:579
void checkComponentArraySize(size_t nn) const
Check that an array size is at least nComponents().
Definition: Domain1D.h:145
virtual void resize(size_t nv, size_t np)
Definition: Domain1D.cpp:34
size_t bandwidth()
Set the Jacobian bandwidth for this domain.
Definition: Domain1D.h:96
void setID(const std::string &s)
Specify an identifying tag for this domain.
Definition: Domain1D.h:459
Domain1D * left() const
Return a pointer to the left neighbor.
Definition: Domain1D.h:444
virtual void _finalize(const doublereal *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate...
Definition: Domain1D.h:540
void incrementTime(doublereal dt)
Definition: Domain1D.h:349
virtual void showSolution(const doublereal *x)
Print the solution.
Definition: Domain1D.cpp:244
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
doublereal lowerBound(size_t n) const
Lower bound on the nth component.
Definition: Domain1D.h:253
void setDesc(const std::string &s)
Specify descriptive text for this domain.
Definition: Domain1D.h:473
virtual std::string componentName(size_t n) const
Name of the nth component. May be overloaded.
Definition: Domain1D.cpp:58
Refiner & refiner()
Return a reference to the grid refiner.
Definition: Domain1D.h:125
void evalss(doublereal *x, doublereal *r, integer *mask)
Definition: Domain1D.h:296
size_t componentIndex(const std::string &name) const
index of component with name name.
Definition: Domain1D.cpp:67
int domainType()
Domain type flag.
Definition: Domain1D.h:50
size_t domainIndex()
The left-to-right location of this domain.
Definition: Domain1D.h:55
void checkPointArraySize(size_t nn) const
Check that an array size is at least nPoints().
Definition: Domain1D.h:167
double prevSoln(size_t n, size_t j) const
Value of component n at point j in the previous solution.
Definition: Domain1D.h:454
size_t nComponents() const
Number of components at each grid point.
Definition: Domain1D.h:130
void setSteadyTolerances(doublereal rtol, doublereal atol, size_t n=npos)
Set tolerances for steady-state mode.
Definition: Domain1D.cpp:91
double transient_atol(size_t n)
Transient absolute tolerance of the nth component.
Definition: Domain1D.h:243
virtual void eval(size_t j, doublereal *x, doublereal *r, integer *mask, doublereal rdt=0.0)
Evaluate the residual function at point j.
Definition: Domain1D.cpp:112
void append(Domain1D *right)
Append domain &#39;right&#39; to this one, and update all links.
Definition: Domain1D.h:438
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
bool steady()
True if in steady-state mode.
Definition: Domain1D.h:275
int timeDerivativeFlag(size_t n)
Definition: Domain1D.h:325
void checkComponentIndex(size_t n) const
Check that the specified component index is in range.
Definition: Domain1D.h:136
double steady_atol(size_t n)
Steady absolute tolerance of the nth component.
Definition: Domain1D.h:233
Contains declarations for string manipulation functions within Cantera.
double transient_rtol(size_t n)
Transient relative tolerance of the nth component.
Definition: Domain1D.h:238
void linkRight(Domain1D *right)
Set the right neighbor to domain &#39;right.&#39;.
Definition: Domain1D.h:433
doublereal atol(size_t n)
Absolute tolerance of the nth component.
Definition: Domain1D.h:223
Refine Domain1D grids so that profiles satisfy adaptation tolerances.
Definition: refine.h:16
doublereal rtol(size_t n)
Relative tolerance of the nth component.
Definition: Domain1D.h:218
doublereal m_time
Definition: Domain1D.h:557
An array index is out of range.
Definition: ctexceptions.h:164
void needJacUpdate()
Definition: Domain1D.cpp:104
bool isConnector()
True if the domain is a connector domain.
Definition: Domain1D.h:60
doublereal upperBound(size_t n) const
Upper bound on the nth component.
Definition: Domain1D.h:248
size_t nPoints() const
Number of grid points in this domain.
Definition: Domain1D.h:152
Namespace for the Cantera kernel.
Definition: application.cpp:29
void setTransientTolerances(doublereal rtol, doublereal atol, size_t n=npos)
Set tolerances for time-stepping mode.
Definition: Domain1D.cpp:78
doublereal time() const
Definition: Domain1D.h:344
virtual void setupGrid(size_t n, const doublereal *z)
called to set up initial grid, and after grid refinement
Definition: Domain1D.cpp:234
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
virtual void init()
Definition: Domain1D.h:105
virtual size_t loc(size_t j=0) const
Location of the start of the local solution vector in the global solution vector,.
Definition: Domain1D.h:403
virtual void update(doublereal *x)
Definition: Domain1D.h:339
virtual doublereal initialValue(size_t n, size_t j)
Initial value of solution component n at grid point j.
Definition: Domain1D.cpp:302
void initTimeInteg(doublereal dt, const doublereal *x0)
Prepare to do time stepping with time step dt.
Definition: Domain1D.h:261