Cantera  2.1.2
BEulerInt.h
Go to the documentation of this file.
1 /**
2  * @file BEulerInt.h
3  */
4 
5 /*
6  * Copyright 2004 Sandia Corporation. Under the terms of Contract
7  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
8  * retains certain rights in this software.
9  * See file License.txt for licensing information.
10  */
11 #ifndef CT_BEULERINT_H
12 #define CT_BEULERINT_H
13 
14 #include "cantera/base/ct_defs.h"
16 #include "cantera/base/utilities.h"
18 
21 
24 
25 #define OPT_SIZE 10
26 
27 #define SUCCESS 0
28 #define FAILURE 1
29 
30 #define STEADY 0
31 #define TRANSIENT 1
32 
33 namespace Cantera
34 {
35 
36 enum BEulerMethodType {
37  BEulerFixedStep,
38  BEulerVarStep
39 };
40 
41 /**
42  * Exception class thrown when a BEuler error is encountered.
43  */
44 class BEulerErr : public CanteraError
45 {
46 public:
47  /**
48  * Exception thrown when a BEuler error is encountered. We just call the
49  * Cantera Error handler in the initialization list.
50  */
51  explicit BEulerErr(const std::string& msg);
52 };
53 
54 
55 #define BEULER_JAC_ANAL 2
56 #define BEULER_JAC_NUM 1
57 
58 /*!
59  * Wrapper class for 'beuler' integrator
60  * We derive the class from the class Integrator
61  */
62 class BEulerInt : public Integrator
63 {
64 public:
65  /*!
66  * Constructor. Default settings: dense jacobian, no user-supplied
67  * Jacobian function, Newton iteration.
68  */
69  BEulerInt();
70 
71  virtual ~BEulerInt();
72 
73  virtual void setTolerances(double reltol, size_t n, double* abstol);
74  virtual void setTolerances(double reltol, double abstol);
75  virtual void setProblemType(int probtype);
76 
77  //! Find the initial conditions for y and ydot.
78  virtual void initializeRJE(double t0, ResidJacEval& func);
79  virtual void reinitializeRJE(double t0, ResidJacEval& func);
80  virtual double integrateRJE(double tout, double tinit = 0.0);
81 
82  // This routine advances the calculations one step using a predictor
83  // corrector approach. We use an implicit algorithm here.
84  virtual doublereal step(double tout);
85 
86  //! Set the solution weights. This is a very important routine as it affects
87  //! quite a few operations involving convergence.
88  virtual void setSolnWeights();
89 
90  virtual double& solution(size_t k) {
91  return m_y_n[k];
92  }
93  double* solution() {
94  return &m_y_n[0];
95  }
96  int nEquations() const {
97  return m_neq;
98  }
99 
100  //! Return the total number of function evaluations
101  virtual int nEvals() const;
102  virtual void setMethodBEMT(BEulerMethodType t);
103  virtual void setIterator(IterType t);
104  virtual void setMaxStep(double hmax);
105  virtual void setMaxNumTimeSteps(int);
106  virtual void setNumInitialConstantDeltaTSteps(int);
107 
108  void print_solnDelta_norm_contrib(const double* const soln0,
109  const char* const s0,
110  const double* const soln1,
111  const char* const s1,
112  const char* const title,
113  const double* const y0,
114  const double* const y1,
115  double damp,
116  int num_entries);
117 
118  //! This routine controls when the solution is printed
119  /*!
120  * @param printSolnStepInterval If greater than 0, then the soln is
121  * printed every printSolnStepInterval steps.
122  * @param printSolnNumberToTout The solution is printed at regular
123  * invervals a total of "printSolnNumberToTout" times.
124  * @param printSolnFirstSteps The solution is printed out the first
125  * "printSolnFirstSteps" steps. After these steps the
126  * other parameters determine the printing. default = 0
127  * @param dumpJacobians Dump jacobians to disk.
128  */
129  virtual void setPrintSolnOptions(int printSolnStepInterval,
130  int printSolnNumberToTout,
131  int printSolnFirstSteps = 0,
132  bool dumpJacobians = false);
133 
134  //! Set the options for the nonlinear method
135  /*!
136  * Defaults are set in the .h file. These are the defaults:
137  * min_newt_its = 0
138  * matrixConditioning = false
139  * colScaling = false
140  * rowScaling = true
141  */
142  void setNonLinOptions(int min_newt_its = 0,
143  bool matrixConditioning = false,
144  bool colScaling = false,
145  bool rowScaling = true);
146  virtual void setPrintFlag(int print_flag);
147 
148  //! Set the column scaling vector at the current time
149  virtual void setColumnScales();
150 
151  /**
152  * Calculate the solution error norm. if printLargest is true, then a table
153  * of the largest values is printed to standard output.
154  */
155  virtual double soln_error_norm(const double* const,
156  bool printLargest = false);
157  virtual void setInitialTimeStep(double delta_t);
158 
159  /*!
160  * Function called by to evaluate the Jacobian matrix and the current
161  * residual at the current time step.
162  * @param J = Jacobian matrix to be filled in
163  * @param f = Right hand side. This routine returns the current
164  * value of the rhs (output), so that it does
165  * not have to be computed again.
166  */
167  void beuler_jac(GeneralMatrix& J, double* const f,
168  double, double, double* const, double* const, int);
169 
170 protected:
171  //! Internal routine that sets up the fixed length storage based on
172  //! the size of the problem to solve.
173  void internalMalloc();
174 
175  /*!
176  * Function to calculate the predicted solution vector, m_y_pred_n for the
177  * (n+1)th time step. This routine can be used by a first order - forward
178  * Euler / backward Euler predictor / corrector method or for a second order
179  * Adams-Bashforth / Trapezoidal Rule predictor / corrector method. See
180  * Nachos documentation Sand86-1816 and Gresho, Lee, Sani LLNL report UCRL -
181  * 83282 for more information.
182  *
183  * on input:
184  *
185  * N - number of unknowns
186  * order - indicates order of method
187  * = 1 -> first order forward Euler/backward Euler
188  * predictor/corrector
189  * = 2 -> second order Adams-Bashforth/Trapezoidal Rule
190  * predictor/corrector
191  *
192  * delta_t_n - magnitude of time step at time n (i.e., = t_n+1 - t_n)
193  * delta_t_nm1 - magnitude of time step at time n - 1 (i.e., = t_n - t_n-1)
194  * y_n[] - solution vector at time n
195  * y_dot_n[] - acceleration vector from the predictor at time n
196  * y_dot_nm1[] - acceleration vector from the predictor at time n - 1
197  *
198  * on output:
199  *
200  * m_y_pred_n[] - predicted solution vector at time n + 1
201  */
202  void calc_y_pred(int);
203 
204  /*!
205  * Function to calculate the acceleration vector ydot for the first or
206  * second order predictor/corrector time integrator. This routine can be
207  * called by a first order - forward Euler / backward Euler predictor /
208  * corrector or for a second order Adams - Bashforth / Trapezoidal Rule
209  * predictor / corrector. See Nachos documentation Sand86-1816 and Gresho,
210  * Lee, Sani LLNL report UCRL - 83282 for more information.
211  *
212  * on input:
213  *
214  * N - number of local unknowns on the processor
215  * This is equal to internal plus border unknowns.
216  * order - indicates order of method
217  * = 1 -> first order forward Euler/backward Euler
218  * predictor/corrector
219  * = 2 -> second order Adams-Bashforth/Trapezoidal Rule
220  * predictor/corrector
221  *
222  * delta_t_n - Magnitude of the current time step at time n
223  * (i.e., = t_n - t_n-1)
224  * y_curr[] - Current Solution vector at time n
225  * y_nm1[] - Solution vector at time n-1
226  * ydot_nm1[] - Acceleration vector at time n-1
227  *
228  * on output:
229  *
230  * ydot_curr[] - Current acceleration vector at time n
231  *
232  * Note we use the current attribute to denote the possibility that
233  * y_curr[] may not be equal to m_y_n[] during the nonlinear solve
234  * because we may be using a look-ahead scheme.
235  */
236  void calc_ydot(int, double*, double*);
237 
238  /*!
239  * Calculates the time step truncation error estimate from a very simple
240  * formula based on Gresho et al. This routine can be called for a first
241  * order - forward Euler/backward Euler predictor/ corrector and for a
242  * second order Adams- Bashforth/Trapezoidal Rule predictor/corrector. See
243  * Nachos documentation Sand86-1816 and Gresho, Lee, LLNL report UCRL -
244  * 83282 for more information.
245  *
246  * on input:
247  *
248  * abs_error - Generic absolute error tolerance
249  * rel_error - Generic realtive error tolerance
250  * x_coor[] - Solution vector from the implicit corrector
251  * x_pred_n[] - Solution vector from the explicit predictor
252  *
253  * on output:
254  *
255  * delta_t_n - Magnitude of next time step at time t_n+1
256  * delta_t_nm1 - Magnitude of previous time step at time t_n
257  */
258  double time_error_norm();
259 
260  /*!
261  * Time step control function for the selection of the time step size based on
262  * a desired accuracy of time integration and on an estimate of the relative
263  * error of the time integration process. This routine can be called for a
264  * first order - forward Euler/backward Euler predictor/ corrector and for a
265  * second order Adams- Bashforth/Trapezoidal Rule predictor/corrector. See
266  * Nachos documentation Sand86-1816 and Gresho, Lee, Sani LLNL report UCRL -
267  * 83282 for more information.
268  *
269  * on input:
270  *
271  * order - indicates order of method
272  * = 1 -> first order forward Euler/backward Euler
273  * predictor/corrector
274  * = 2 -> second order forward Adams-Bashforth/Trapezoidal
275  * rule predictor/corrector
276  *
277  * delta_t_n - Magnitude of time step at time t_n
278  * delta_t_nm1 - Magnitude of time step at time t_n-1
279  * rel_error - Generic realtive error tolerance
280  * time_error_factor - Estimated value of the time step truncation error
281  * factor. This value is a ratio of the computed
282  * error norms. The premultiplying constants
283  * and the power are not yet applied to normalize the
284  * predictor/corrector ratio. (see output value)
285  *
286  * on output:
287  *
288  * return - delta_t for the next time step
289  * If delta_t is negative, then the current time step is
290  * rejected because the time-step truncation error is
291  * too large. The return value will contain the negative
292  * of the recommended next time step.
293  *
294  * time_error_factor - This output value is normalized so that
295  * values greater than one indicate the current time
296  * integration error is greater than the user
297  * specified magnitude.
298  */
299  double time_step_control(int m_order, double time_error_factor);
300 
301  //! Solve a nonlinear system
302  /*!
303  * Find the solution to F(X, xprime) = 0 by damped Newton iteration. On
304  * entry, y_comm[] contains an initial estimate of the solution and
305  * ydot_comm[] contains an estimate of the derivative.
306  * On successful return, y_comm[] contains the converged solution
307  * and ydot_comm[] contains the derivative
308  *
309  * @param y_comm[] Contains the input solution. On output y_comm[] contains
310  * the converged solution
311  * @param ydot_comm Contains the input derivative solution. On output
312  * y_comm[] contains the converged derivative solution
313  * @param CJ Inverse of the time step
314  * @param time_curr Current value of the time
315  * @param jac Jacobian
316  * @param num_newt_its number of newton iterations
317  * @param num_linear_solves number of linear solves
318  * @param num_backtracks number of backtracs
319  * @param loglevel Log level
320  */
321  int solve_nonlinear_problem(double* const y_comm,
322  double* const ydot_comm, double CJ,
323  double time_curr,
324  GeneralMatrix& jac,
325  int& num_newt_its,
326  int& num_linear_solves,
327  int& num_backtracks,
328  int loglevel);
329 
330  /**
331  * Compute the undamped Newton step. The residual function is
332  * evaluated at the current time, t_n, at the current values of the
333  * solution vector, m_y_n, and the solution time derivative, m_ydot_n,
334  * but the Jacobian is not recomputed.
335  */
336  void doNewtonSolve(double, double*, double*, double*,
337  GeneralMatrix&, int);
338 
339 
340  //! Bound the Newton step while relaxing the solution
341  /*!
342  * Return the factor by which the undamped Newton step 'step0'
343  * must be multiplied in order to keep all solution components in
344  * all domains between their specified lower and upper bounds.
345  * Other bounds may be applied here as well.
346  *
347  * Currently the bounds are hard coded into this routine:
348  *
349  * Minimum value for all variables: - 0.01 * m_ewt[i]
350  * Maximum value = none.
351  *
352  * Thus, this means that all solution components are expected
353  * to be numerical greater than zero in the limit of time step
354  * truncation errors going to zero.
355  *
356  * Delta bounds: The idea behind these is that the Jacobian
357  * couldn't possibly be representative if the
358  * variable is changed by a lot. (true for
359  * nonlinear systems, false for linear systems)
360  * Maximum increase in variable in any one newton iteration: factor of 2
361  * Maximum decrease in variable in any one newton iteration: factor of 5
362  *
363  * @param y Current value of the solution
364  * @param step0 Current raw step change in y[]
365  * @param loglevel Log level. This routine produces output if loglevel
366  * is greater than one
367  *
368  * @return Returns the damping coefficient
369  */
370  double boundStep(const double* const y, const double* const step0, int loglevel);
371 
372  /*!
373  * On entry, step0 must contain an undamped Newton step for the
374  * solution x0. This method attempts to find a damping coefficient
375  * such that the next undamped step would have a norm smaller than
376  * that of step0. If successful, the new solution after taking the
377  * damped step is returned in y1, and the undamped step at y1 is
378  * returned in step1.
379  */
380  int dampStep(double, const double*, const double*,
381  const double*, double*, double*,
382  double*, double&, GeneralMatrix&, int&, bool, int&);
383 
384  //! Compute Residual Weights
385  void computeResidWts(GeneralMatrix& jac);
386 
387  //! Filter a new step
388  double filterNewStep(double, double*, double*);
389 
390  //! Get the next time to print out
391  double getPrintTime(double time_current);
392 
393  /********************** Member data ***************************/
394  /*********************
395  * METHOD FLAGS
396  *********************/
397 
398  //! IterType is used to specify how the nonlinear equations are
399  //! to be relaxed at each time step.
401  /**
402  * MethodType is used to specify how the time step is to be
403  * chosen. Currently, there are two choices, one is a fixed
404  * step method while the other is based on a predictor-corrector
405  * algorithm and a time-step truncation error tolerance.
406  */
407  BEulerMethodType m_method;
408  /**
409  * m_jacFormMethod determines how a matrix is formed.
410  */
412  /**
413  * m_rowScaling is a boolean. If true then row sum scaling
414  * of the Jacobian matrix is carried out when solving the
415  * linear systems.
416  */
418  /**
419  * m_colScaling is a boolean. If true, then column scaling
420  * is performed on each solution of the linear system.
421  */
423  /**
424  * m_matrixConditioning is a boolean. If true, then the
425  * Jacobian and every rhs is multiplied by the inverse
426  * of a matrix that is suppose to reduce the condition
427  * number of the matrix. This is done before row scaling.
428  */
430  /**
431  * If m_itol =1 then each component has an individual
432  * value of atol. If m_itol = 0, the all atols are equal.
433  */
434  int m_itol;
435 
436  //! Relative time truncation error tolerances
437  double m_reltol;
438 
439  /**
440  * Absolute time truncation error tolerances, when uniform
441  * for all variables.
442  */
443  double m_abstols;
444  /**
445  * Vector of absolute time truncation error tolerance
446  * when not uniform for all variables.
447  */
449 
450  //! Error Weights. This is a surprisingly important quantity.
452 
453  //! Maximum step size
454  double m_hmax;
455 
456  //! Maximum integration order
457  int m_maxord;
458 
459  //! Current integration order
460  int m_order;
461 
462  //! Time step number
464  int m_time_step_attempts;
465 
466  //! Max time steps allowed
468  /**
469  * Number of initial time steps to take where the time truncation error
470  * tolerances are not checked. Instead the delta T is uniform
471  */
473 
474  //! Failure Counter -> keeps track of the number of consecutive failures
476 
477  //! Minimum Number of Newton Iterations per nonlinear step. default = 0
479  /************************
480  * PRINTING OPTIONS
481  ************************/
482  /**
483  * Step Interval at which to print out the solution
484  * default = 1;
485  * If set to zero, there is no printout
486  */
488  /**
489  * Number of evenly spaced printouts of the solution
490  * If zero, there is no printout from this option
491  * default 1
492  * If set to zero there is no printout.
493  */
495 
496  //! Number of initial steps that the solution is printed out. default = 0
498 
499  //! Dump Jacobians to disk. default false
501 
502  /*********************
503  * INTERNAL SOLUTION VALUES
504  *********************/
505 
506  //! Number of equations in the ode integrator
507  int m_neq;
508  vector_fp m_y_n;
509  vector_fp m_y_nm1;
510  vector_fp m_y_pred_n;
511  vector_fp m_ydot_n;
512  vector_fp m_ydot_nm1;
513  /************************
514  * TIME VARIABLES
515  ************************/
516 
517  //! Initial time at the start of the integration
518  double m_t0;
519 
520  //! Final time
521  double m_time_final;
522 
523  double time_n;
524  double time_nm1;
525  double time_nm2;
526  double delta_t_n;
527  double delta_t_nm1;
528  double delta_t_nm2;
529  double delta_t_np1;
530 
531  //! Maximum permissible time step
532  double delta_t_max;
533 
534  vector_fp m_resid;
535  vector_fp m_residWts;
536  vector_fp m_wksp;
537  ResidJacEval* m_func;
538  vector_fp m_rowScales;
539  vector_fp m_colScales;
540 
541  //! Pointer to the jacobian representing the time dependent problem
543 
544  /**
545  * Determines the level of printing for each time
546  * step.
547  * 0 -> absolutely nothing is printed for
548  * a single time step.
549  * 1 -> One line summary per time step
550  * 2 -> short description, points of interest
551  * 3 -> Lots printed per time step (default)
552  */
554  /***************************************************************************
555  * COUNTERS OF VARIOUS KINDS
556  ***************************************************************************/
557 
558  //! Number of function evaluations
559  int m_nfe;
560 
561  /**
562  * Number of Jacobian Evaluations and
563  * factorization steps (they are the same)
564  */
566 
567  //! Number of total newton iterations
569 
570  //! Total number of linear iterations
572 
573  //! Total number of convergence failures.
575 
576  //! Total Number of time truncation error failures
578 
579  int num_failures;
580 };
581 
582 } // namespace
583 
584 #endif // CT_BEULER
virtual void setPrintSolnOptions(int printSolnStepInterval, int printSolnNumberToTout, int printSolnFirstSteps=0, bool dumpJacobians=false)
This routine controls when the solution is printed.
Definition: BEulerInt.cpp:134
double m_time_final
Final time.
Definition: BEulerInt.h:521
int m_numTotalTruncFails
Total Number of time truncation error failures.
Definition: BEulerInt.h:577
double time_error_norm()
Definition: BEulerInt.cpp:678
virtual void setProblemType(int probtype)
Set the problem type.
Definition: BEulerInt.cpp:109
int m_printSolnNumberToTout
Number of evenly spaced printouts of the solution If zero, there is no printout from this option defa...
Definition: BEulerInt.h:494
double getPrintTime(double time_current)
Get the next time to print out.
Definition: BEulerInt.cpp:220
virtual void setIterator(IterType t)
Set the linear iterator.
Definition: BEulerInt.cpp:145
int m_printSolnStepInterval
Step Interval at which to print out the solution default = 1; If set to zero, there is no printout...
Definition: BEulerInt.h:487
int m_numTotalNewtIts
Number of total newton iterations.
Definition: BEulerInt.h:568
int m_neq
Number of equations in the ode integrator.
Definition: BEulerInt.h:507
virtual double soln_error_norm(const double *const, bool printLargest=false)
Calculate the solution error norm.
Definition: BEulerInt.cpp:1334
void doNewtonSolve(double, double *, double *, double *, GeneralMatrix &, int)
Compute the undamped Newton step.
Definition: BEulerInt.cpp:1388
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
int m_failure_counter
Failure Counter -> keeps track of the number of consecutive failures.
Definition: BEulerInt.h:475
BEulerMethodType m_method
MethodType is used to specify how the time step is to be chosen.
Definition: BEulerInt.h:407
bool m_rowScaling
m_rowScaling is a boolean.
Definition: BEulerInt.h:417
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
double m_reltol
Relative time truncation error tolerances.
Definition: BEulerInt.h:437
void beuler_jac(GeneralMatrix &J, double *const f, double, double, double *const, double *const, int)
Definition: BEulerInt.cpp:515
double m_t0
Initial time at the start of the integration.
Definition: BEulerInt.h:518
Generic matrix.
Definition: GeneralMatrix.h:23
bool m_matrixConditioning
m_matrixConditioning is a boolean.
Definition: BEulerInt.h:429
int m_min_newt_its
Minimum Number of Newton Iterations per nonlinear step. default = 0.
Definition: BEulerInt.h:478
int m_print_flag
Determines the level of printing for each time step.
Definition: BEulerInt.h:553
virtual double & solution(size_t k)
The current value of the solution of equation k.
Definition: BEulerInt.h:90
vector_fp m_abstol
Vector of absolute time truncation error tolerance when not uniform for all variables.
Definition: BEulerInt.h:448
BEulerErr(const std::string &msg)
Exception thrown when a BEuler error is encountered.
Definition: BEulerInt.cpp:19
IterType m_iter
IterType is used to specify how the nonlinear equations are to be relaxed at each time step...
Definition: BEulerInt.h:400
Wrappers for the function evaluators for Nonlinear solvers and Time steppers.
Definition: ResidJacEval.h:51
double delta_t_max
Maximum permissible time step.
Definition: BEulerInt.h:532
Exception class thrown when a BEuler error is encountered.
Definition: BEulerInt.h:44
int solve_nonlinear_problem(double *const y_comm, double *const ydot_comm, double CJ, double time_curr, GeneralMatrix &jac, int &num_newt_its, int &num_linear_solves, int &num_backtracks, int loglevel)
Solve a nonlinear system.
Definition: BEulerInt.cpp:1775
int m_numTotalLinearSolves
Total number of linear iterations.
Definition: BEulerInt.h:571
GeneralMatrix * tdjac_ptr
Pointer to the jacobian representing the time dependent problem.
Definition: BEulerInt.h:542
virtual void setSolnWeights()
Set the solution weights.
Definition: BEulerInt.cpp:260
Class that calculates the solution to a nonlinear, dense, set of equations (see Numerical Utilities w...
int m_printSolnFirstSteps
Number of initial steps that the solution is printed out. default = 0.
Definition: BEulerInt.h:497
virtual void setColumnScales()
Set the column scaling vector at the current time.
Definition: BEulerInt.cpp:282
int m_numInitialConstantDeltaTSteps
Number of initial time steps to take where the time truncation error tolerances are not checked...
Definition: BEulerInt.h:472
void calc_y_pred(int)
Definition: BEulerInt.cpp:628
double * solution()
The current value of the solution of the system of equations.
Definition: BEulerInt.h:93
int m_order
Current integration order.
Definition: BEulerInt.h:460
int m_nfe
Number of function evaluations.
Definition: BEulerInt.h:559
Dense, Square (not sparse) matrices.
virtual void initializeRJE(double t0, ResidJacEval &func)
Find the initial conditions for y and ydot.
Definition: BEulerInt.cpp:175
virtual void setTolerances(double reltol, size_t n, double *abstol)
Set or reset the number of equations.
Definition: BEulerInt.cpp:88
Abstract base class for ODE system integrators.
Definition: Integrator.h:53
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
int m_maxord
Maximum integration order.
Definition: BEulerInt.h:457
double m_abstols
Absolute time truncation error tolerances, when uniform for all variables.
Definition: BEulerInt.h:443
double time_step_control(int m_order, double time_error_factor)
Definition: BEulerInt.cpp:732
int dampStep(double, const double *, const double *, const double *, double *, double *, double *, double &, GeneralMatrix &, int &, bool, int &)
Definition: BEulerInt.cpp:1621
int m_max_time_step_attempts
Max time steps allowed.
Definition: BEulerInt.h:467
int nEquations() const
The number of equations.
Definition: BEulerInt.h:96
double filterNewStep(double, double *, double *)
Filter a new step.
Definition: BEulerInt.cpp:311
int m_jacFormMethod
m_jacFormMethod determines how a matrix is formed.
Definition: BEulerInt.h:411
int m_numTotalConvFails
Total number of convergence failures.
Definition: BEulerInt.h:574
virtual int nEvals() const
Return the total number of function evaluations.
Definition: BEulerInt.cpp:235
double boundStep(const double *const y, const double *const step0, int loglevel)
Bound the Newton step while relaxing the solution.
Definition: BEulerInt.cpp:1554
bool m_colScaling
m_colScaling is a boolean.
Definition: BEulerInt.h:422
IterType
Specifies the method used for iteration.
Definition: Integrator.h:41
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:165
void internalMalloc()
Internal routine that sets up the fixed length storage based on the size of the problem to solve...
Definition: BEulerInt.cpp:240
bool m_dumpJacobians
Dump Jacobians to disk. default false.
Definition: BEulerInt.h:500
virtual doublereal step(double tout)
Integrate the system of equations.
Definition: BEulerInt.cpp:927
Declarations for the class GeneralMatrix which is a virtual base class for matrices handled by solver...
int m_nJacEval
Number of Jacobian Evaluations and factorization steps (they are the same)
Definition: BEulerInt.h:565
void setNonLinOptions(int min_newt_its=0, bool matrixConditioning=false, bool colScaling=false, bool rowScaling=true)
Set the options for the nonlinear method.
Definition: BEulerInt.cpp:150
void calc_ydot(int, double *, double *)
Definition: BEulerInt.cpp:657
double m_hmax
Maximum step size.
Definition: BEulerInt.h:454
int m_itol
If m_itol =1 then each component has an individual value of atol.
Definition: BEulerInt.h:434
vector_fp m_ewt
Error Weights. This is a surprisingly important quantity.
Definition: BEulerInt.h:451
int m_time_step_num
Time step number.
Definition: BEulerInt.h:463
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
void computeResidWts(GeneralMatrix &jac)
Compute Residual Weights.
Definition: BEulerInt.cpp:287