| Cantera 3.0.0

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Sim1D Class Reference
One-Dimensional Reacting Flows

One-dimensional simulations. More...

`#include <Sim1D.h>`

Inheritance diagram for Sim1D:
[legend]

## Detailed Description

One-dimensional simulations.

Class Sim1D extends class OneDim by storing the solution vector, and by adding a hybrid Newton/time-stepping solver.

Definition at line 21 of file Sim1D.h.

## Public Member Functions
| Sim1D ()
| Default constructor.
| Sim1D (vector< shared_ptr< Domain1D > > &domains)
| Standard constructor.
| Sim1D (vector< Domain1D * > &domains)
const double * | solution ()
void | setTimeStep (double stepsize, size_t n, const int *tsteps)
void | solve (int loglevel=0, bool refine_grid=true)
void | eval (double rdt=-1.0, int count=1)
void | getResidual (double rdt, double *resid)
int | refine (int loglevel=0)
| Refine the grid in all domains.
int | setFixedTemperature (double t)
| Add node for fixed temperature point of freely propagating flame.
double | fixedTemperature ()
| Return temperature at the point used to fix the flame location.
double | fixedTemperatureLocation ()
| Return location of the point where temperature is fixed.
void | setRefineCriteria (int dom=-1, double ratio=10.0, double slope=0.8, double curve=0.8, double prune=-0.1)
| Set grid refinement criteria.
vector< double > | getRefineCriteria (int dom)
| Get the grid refinement criteria.
void | setMaxGridPoints (int dom, int npoints)
| Set the maximum number of grid points in the domain.
size_t | maxGridPoints (size_t dom)
| Get the maximum number of grid points in this domain.
void | setGridMin (int dom, double gridmin)
| Set the minimum grid spacing in the specified domain(s).
void | restoreTimeSteppingSolution ()
| Set the current solution vector to the last successful time-stepping solution.
void | restoreSteadySolution ()
| Set the current solution vector and grid to the last successful steady- state solution.
void | getInitialSoln ()
void | setSolution (const double *soln)
const double * | solution () const
double | jacobian (int i, int j)
void | evalSSJacobian ()
void | solveAdjoint (const double *b, double *lambda)
| Solve the equation \( J^T \lambda = b \).
void | resize () override
| Call after one or more grids has changed size, for example after being refined.
void | setSteadyCallback (Func1 *callback)
| Set a function that will be called after each successful steady-state solve, before regridding.
Setting initial values
These methods are used to set the initial values of solution components.
void | setInitialGuess (const string &component, vector< double > &locs, vector< double > &vals)
| Set initial guess for one component for all domains.
void | setValue (size_t dom, size_t comp, size_t localPoint, double value)
| Set a single value in the solution vector.
double | value (size_t dom, size_t comp, size_t localPoint) const
| Get one entry in the solution vector.
double | workValue (size_t dom, size_t comp, size_t localPoint) const
void | setProfile (size_t dom, size_t comp, const vector< double > &pos, const vector< double > &values)
| Specify a profile for one component of one domain.
void | setFlatProfile (size_t dom, size_t comp, double v)
| Set component 'comp' of domain 'dom' to value 'v' at all points.
Logging, saving and restoring of solutions
void | showSolution (std::ostream &s)
| Output information on current solution for all domains to stream.
void | showSolution ()
| Show logging information on current solution for all domains.
void | show (std::ostream &s)
| Output information on current solution for all domains to stream.
void | show ()
| Show logging information on current solution for all domains.
void | save (const string &fname, const string &id, const string &desc, int loglevel)
| Save the current solution to a container file.
void | save (const string &fname, const string &name, const string &desc, bool overwrite=false, int compression=0, const string &basis="")
| Save current simulation data to a container file or CSV format.
void | saveResidual (const string &fname, const string &id, const string &desc, int loglevel)
| Save the residual of the current solution to a container file.
void | saveResidual (const string &fname, const string &name, const string &desc, bool overwrite=false, int compression=0)
| Save the residual of the current solution to a container file.
AnyMap | restore (const string &fname, const string &id, int loglevel)
| Initialize the solution with a previously-saved solution.
AnyMap | restore (const string &fname, const string &name)
| Retrieve data and settings from a previously saved simulation.
Public Member Functions inherited from OneDim
| OneDim (vector< shared_ptr< Domain1D > > &domains)
| Construct a OneDim container for the domains in the list domains.
| OneDim (vector< Domain1D * > domains)
| OneDim (const OneDim &)=delete
OneDim & | operator= (const OneDim &)=delete
void | addDomain (shared_ptr< Domain1D > d)
| Add a domain. Domains are added left-to-right.
void | addDomain (Domain1D *d)
MultiJac & | jacobian ()
| Return a reference to the Jacobian evaluator of an OneDim object.
MultiNewton & | newton ()
| Return a reference to the Newton iterator.
int | solve (double *x0, double *x1, int loglevel)
| Solve F(x) = 0, where F(x) is the multi-domain residual function.
size_t | nDomains () const
| Number of domains.
Domain1D & | domain (size_t i) const
| Return a reference to domain i.
size_t | domainIndex (const string &name)
void | checkDomainIndex (size_t n) const
| Check that the specified domain index is in range.
void | checkDomainArraySize (size_t nn) const
| Check that an array size is at least nDomains().
size_t | start (size_t i) const
| The index of the start of domain i in the solution vector.
size_t | size () const
| Total solution vector length;.
Domain1D * | left ()
| Pointer to left-most domain (first added).
Domain1D * | right ()
| Pointer to right-most domain (last added).
size_t | nVars (size_t jg)
| Number of solution components at global point jg.
size_t | loc (size_t jg)
| Location in the solution vector of the first component of global point jg.
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 solution vector.
size_t | bandwidth () const
| Jacobian bandwidth.
void | init ()
| Initialize all domains.
size_t | points ()
| Total number of points.
double | ssnorm (double *x, double *r)
| Steady-state max norm (infinity norm) of the residual evaluated using solution x.
double | rdt () const
| Reciprocal of the time step.
void | initTimeInteg (double dt, double *x)
| Prepare for time stepping beginning with solution x and timestep dt.
bool | transient () const
| True if transient mode.
bool | steady () const
| True if steady mode.
void | setSteadyMode ()
| Prepare to solve the steady-state problem.
void | eval (size_t j, double *x, double *r, double rdt=-1.0, int count=1)
| Evaluate the multi-domain residual function.
Domain1D * | pointDomain (size_t i)
| Return a pointer to the domain global point i belongs to.
vector< int > & | transientMask ()
double | timeStep (int nsteps, double dt, double *x, double *r, int loglevel)
| Take time steps using Backward Euler.
void | resetBadValues (double *x)
void | writeStats (int printTime=1)
| Write statistics about the number of iterations and Jacobians at each grid level.
AnyMap | serialize (const double *soln) const
void | setMinTimeStep (double tmin)
void | setMaxTimeStep (double tmax)
void | setTimeStepFactor (double tfactor)
void | setMaxTimeStepCount (int nmax)
| Set the maximum number of timeteps allowed before successful steady-state solve.
int | maxTimeStepCount () const
| Return the maximum number of timeteps allowed before successful steady-state solve.
void | setJacAge (int ss_age, int ts_age=-1)
void | saveStats ()
| Save statistics on function and Jacobian evaluation, and reset the counters.
void | clearStats ()
| Clear saved statistics.
const vector< size_t > & | gridSizeStats ()
| Return total grid size in each call to solve()
const vector< double > & | jacobianTimeStats ()
| Return CPU time spent evaluating Jacobians in each call to solve()
const vector< double > & | evalTimeStats ()
| Return CPU time spent on non-Jacobian function evaluations in each call to solve()
const vector< int > & | jacobianCountStats ()
| Return number of Jacobian evaluations made in each call to solve()
const vector< int > & | evalCountStats ()
| Return number of non-Jacobian function evaluations made in each call to solve()
const vector< int > & | timeStepStats ()
| Return number of time steps taken in each call to solve()
void | setInterrupt (Func1 *interrupt)
| Set a function that will be called every time eval is called.
void | setTimeStepCallback (Func1 *callback)
| Set a function that will be called after each successful timestep.

## Protected Attributes
vector< double > | m_xlast_ts
| the solution vector after the last successful timestepping
vector< double > | m_xlast_ss
| the solution vector after the last successful steady-state solve (stored before grid refinement)
vector< vector< double > > | m_grid_last_ss
| the grids for each domain after the last successful steady-state solve (stored before grid refinement)
vector< double > | m_xnew
| a work array used to hold the residual or the new solution
double | m_tstep
| timestep
vector< int > | m_steps
| array of number of steps to take before re-attempting the steady-state solution
Func1 * | m_steady_callback
| User-supplied function called after a successful steady-state solve.
Protected Attributes inherited from OneDim
double | m_tmin = 1e-16
| minimum timestep size
double | m_tmax = 1e+08
| maximum timestep size
double | m_tfactor = 0.5
| factor time step is multiplied by if time stepping fails ( < 1 )
shared_ptr< vector< double > > | m_state
| Solution vector.
unique_ptr< MultiJac > | m_jac
| Jacobian evaluator.
unique_ptr< MultiNewton > | m_newt
| Newton iterator.
double | m_rdt = 0.0
| reciprocal of time step
bool | m_jac_ok = false
| if true, Jacobian is current
size_t | m_bw = 0
| Jacobian bandwidth.
size_t | m_size = 0
| solution vector size
vector< shared_ptr< Domain1D > > | m_sharedDom
vector< shared_ptr< Domain1D > > | m_sharedConnect
vector< shared_ptr< Domain1D > > | m_sharedBulk
vector< Domain1D * > | m_dom
vector< Domain1D * > | m_connect
vector< Domain1D * > | m_bulk
bool | m_init = false
vector< size_t > | m_nvars
vector< size_t > | m_loc
vector< int > | m_mask
size_t | m_pts = 0
int | m_ss_jac_age = 20
int | m_ts_jac_age = 20
Func1 * | m_interrupt = nullptr
| Function called at the start of every call to eval.
Func1 * | m_time_step_callback = nullptr
| User-supplied function called after each successful timestep.
int | m_nsteps = 0
| Number of time steps taken in the current call to solve()
int | m_nsteps_max = 500
| Maximum number of timesteps allowed per call to solve()

## Private Member Functions
void | finalize ()
| Calls method _finalize in each domain.
int | newtonSolve (int loglevel)
| Wrapper around the Newton solver.

## Additional Inherited Members
Protected Member Functions inherited from OneDim
void | evalSSJacobian (double *x, double *xnew)

## Constructor & Destructor Documentation

## ◆ Sim1D() [1/3]

Sim1D | ( |  | ) |
| inline

Default constructor.

This constructor is provided to make the class default-constructible, but is not meant to be used in most applications. Use the next constructor

Definition at line 29 of file Sim1D.h.

## ◆ Sim1D() [2/3]

Sim1D | ( | vector< shared_ptr< Domain1D > > & | domains | ) |

Standard constructor.

Parameters

  domains | A vector of shared pointers to the domains to be linked together. The domain pointers must be entered in left-to-right order — that is, the pointer to the leftmost domain is domain[0], the pointer to the domain to its right is domain[1], etc.

Definition at line 25 of file Sim1D.cpp.

## ◆ Sim1D() [3/3]

Sim1D | ( | vector< Domain1D * > & | domains | ) |

Deprecated:
  To be removed after Cantera 3.0; superseded by Sim1D() using shared_ptr

Definition at line 41 of file Sim1D.cpp.

## Member Function Documentation

## ◆ setInitialGuess()

void setInitialGuess | ( | const string & | component,
|  | vector< double > & | locs,
|  | vector< double > & | vals
| ) |  |

Set initial guess for one component for all domains.

Parameters

  component | component name
  locs | A vector of relative positions, beginning with 0.0 at the left of the domain, and ending with 1.0 at the right of the domain.
  vals | A vector of values corresponding to the relative position locations.

Definition at line 61 of file Sim1D.cpp.

## ◆ setValue()

void setValue | ( | size_t | dom,
|  | size_t | comp,
|  | size_t | localPoint,
|  | double | value
| ) |  |

Set a single value in the solution vector.

Parameters

  dom | domain number, beginning with 0 for the leftmost domain.
  comp | component number
  localPoint | grid point within the domain, beginning with 0 for the leftmost grid point in the domain.
  value | the value.

Definition at line 75 of file Sim1D.cpp.

## ◆ value()

double value | ( | size_t | dom,
|  | size_t | comp,
|  | size_t | localPoint
| ) |  | const

Get one entry in the solution vector.

Parameters

  dom | domain number, beginning with 0 for the leftmost domain.
  comp | component number
  localPoint | grid point within the domain, beginning with 0 for the leftmost grid point in the domain.

Definition at line 83 of file Sim1D.cpp.

## ◆ workValue()

double workValue | ( | size_t | dom,
|  | size_t | comp,
|  | size_t | localPoint
| ) |  | const

Definition at line 91 of file Sim1D.cpp.

## ◆ setProfile()

void setProfile | ( | size_t | dom,
|  | size_t | comp,
|  | const vector< double > & | pos,
|  | const vector< double > & | values
| ) |  |

Specify a profile for one component of one domain.

Parameters

  dom | domain number, beginning with 0 for the leftmost domain.
  comp | component number
  pos | A vector of relative positions, beginning with 0.0 at the left of the domain, and ending with 1.0 at the right of the domain.
  values | A vector of values corresponding to the relative position locations.

Note that the vector pos and values can have lengths different than the number of grid points, but their lengths must be equal. The values at the grid points will be linearly interpolated based on the (pos, values) specification.

Definition at line 99 of file Sim1D.cpp.

## ◆ setFlatProfile()

void setFlatProfile | ( | size_t | dom,
|  | size_t | comp,
|  | double | v
| ) |  |

Set component 'comp' of domain 'dom' to value 'v' at all points.

Definition at line 373 of file Sim1D.cpp.

## ◆ showSolution() [1/2]

void showSolution | ( | std::ostream & | s | ) |

Output information on current solution for all domains to stream.

Parameters

  s | Output stream

Deprecated:
  To be removed after Cantera 3.0; replaced by show()

Definition at line 381 of file Sim1D.cpp.

## ◆ showSolution() [2/2]

void showSolution | ( |  | ) |

Show logging information on current solution for all domains.

Deprecated:
  To be removed after Cantera 3.0; replaced by show()

Definition at line 388 of file Sim1D.cpp.

## ◆ show() [1/2]

void show | ( | std::ostream & | s | ) |

Output information on current solution for all domains to stream.

Parameters

  s | Output stream

Since
  New in Cantera 3.0.

Definition at line 395 of file Sim1D.cpp.

## ◆ show() [2/2]

void show | ( |  | ) |

Show logging information on current solution for all domains.

Since
  New in Cantera 3.0.

Definition at line 404 of file Sim1D.cpp.

## ◆ save() [1/2]

void save | ( | const string & | fname,
|  | const string & | id,
|  | const string & | desc,
|  | int | loglevel
| ) |  |

Save the current solution to a container file.

Parameters

  fname | Name of output container file
  id | Identifier of solution within the container file
  desc | Description of the solution
  loglevel | Level of diagnostic output

Deprecated:
  To be removed after Cantera 3.0; loglevel is deprecated.

Definition at line 118 of file Sim1D.cpp.

## ◆ save() [2/2]

void save | ( | const string & | fname,
|  | const string & | name,
|  | const string & | desc,
|  | bool | overwrite = `false`,
|  | int | compression = `0`,
|  | const string & | basis = `""`
| ) |  |

Save current simulation data to a container file or CSV format.

In order to save the content of a Sim1D object, individual domains are converted to SolutionArray objects and saved using the SolutionArray::save() method. For HDF and YAML output, all domains are written to a single container file with shared header information. Simulation settings of individual domains are preserved as meta data of the corresponding SolutionArray objects. For CSV files, only state and auxiliary data of the main 1D domain are saved.

The complete state of the current object can be restored from HDF and YAML container files using the restore() method, while individual domains can be loaded using SolutionArray::restore() for further analysis. While CSV do not contain complete information, they can still be used for setting initial states of individual simulation objects for some Cantera API's.

Parameters

  fname | Name of output file (CSV, YAML or HDF)
  name | Identifier of storage location within the container file; this node/group contains header information and multiple subgroups holding domain-specific SolutionArray data (YAML/HDF only)
  desc | Custom comment describing the dataset to be stored (YAML/HDF only)
  overwrite | Force overwrite if file/name exists; optional (default=false)
  compression | Compression level (0-9); optional (default=0; HDF only)
  basis | Output mass ("Y"/"mass") or mole ("X"/"mole") fractions; if not specified (default=""), the native basis of the underlying ThermoPhase manager is used -

See also
  nativeState (CSV only)

Definition at line 129 of file Sim1D.cpp.

## ◆ saveResidual() [1/2]

void saveResidual | ( | const string & | fname,
|  | const string & | id,
|  | const string & | desc,
|  | int | loglevel
| ) |  |

Save the residual of the current solution to a container file.

Parameters

  fname | Name of output container file
  id | Identifier of solution within the container file
  desc | Description of the solution
  loglevel | Level of diagnostic output

Deprecated:
  To be removed after Cantera 3.0; loglevel is deprecated.

Definition at line 178 of file Sim1D.cpp.

## ◆ saveResidual() [2/2]

void saveResidual | ( | const string & | fname,
|  | const string & | name,
|  | const string & | desc,
|  | bool | overwrite = `false`,
|  | int | compression = `0`
| ) |  |

Save the residual of the current solution to a container file.

Parameters

  fname | Name of output container file
  name | Identifier of solution within the container file
  desc | Description of the solution
  overwrite | Force overwrite if name exists; optional (default=false)
  compression | Compression level (optional; HDF only)

Definition at line 189 of file Sim1D.cpp.

## ◆ restore() [1/2]

AnyMap restore | ( | const string & | fname,
|  | const string & | id,
|  | int | loglevel
| ) |  |

Initialize the solution with a previously-saved solution.

Parameters

  fname | Name of container file
  id | Identifier of solution within the container file
  loglevel | Level of diagnostic output

Deprecated:
  To be removed after Cantera 3.0; loglevel is deprecated.

Returns
  AnyMap containing header information

Definition at line 289 of file Sim1D.cpp.

## ◆ restore() [2/2]

AnyMap restore | ( | const string & | fname,
|  | const string & | name
| ) |  |

Retrieve data and settings from a previously saved simulation.

This method restores a simulation object from YAML or HDF data previously saved using the save() method.

Parameters

  fname | Name of container file (YAML or HDF)
  name | Identifier of location within the container file; this node/group contains header information and subgroups with domain-specific SolutionArray data

Returns
  AnyMap containing header information

Definition at line 296 of file Sim1D.cpp.

## ◆ solution() [1/2]

const double * solution | ( |  | ) |
| inline

Deprecated:
  To be removed after Cantera 3.0 (unused)

Definition at line 222 of file Sim1D.h.

## ◆ setTimeStep()

void setTimeStep | ( | double | stepsize,
|  | size_t | n,
|  | const int * | tsteps
| ) |  |

Definition at line 451 of file Sim1D.cpp.

## ◆ solve()

void solve | ( | int | loglevel = `0`,
|  | bool | refine_grid = `true`
| ) |  |

Definition at line 474 of file Sim1D.cpp.

## ◆ eval()

void eval | ( | double | rdt = `-1.0`,
|  | int | count = `1`
| ) |  |
| inline

Definition at line 232 of file Sim1D.h.

## ◆ getResidual()

void getResidual | ( | double | rdt,
|  | double * | resid
| ) |  |
| inline

Definition at line 237 of file Sim1D.h.

## ◆ refine()

int refine | ( | int | loglevel = `0` | ) |

Refine the grid in all domains.

Definition at line 585 of file Sim1D.cpp.

## ◆ setFixedTemperature()

int setFixedTemperature | ( | double | t | ) |

Add node for fixed temperature point of freely propagating flame.

Definition at line 674 of file Sim1D.cpp.

## ◆ fixedTemperature()

double fixedTemperature | ( |  | ) |

Return temperature at the point used to fix the flame location.

Definition at line 764 of file Sim1D.cpp.

## ◆ fixedTemperatureLocation()

double fixedTemperatureLocation | ( |  | ) |

Return location of the point where temperature is fixed.

Definition at line 777 of file Sim1D.cpp.

## ◆ setRefineCriteria()

void setRefineCriteria | ( | int | dom = `-1`,
|  | double | ratio = `10.0`,
|  | double | slope = `0.8`,
|  | double | curve = `0.8`,
|  | double | prune = `-0.1`
| ) |  |

Set grid refinement criteria.

If dom >= 0, then the settings apply only to the specified domain. If dom < 0, the settings are applied to each domain.

See also
  Refiner::setCriteria.

Definition at line 790 of file Sim1D.cpp.

## ◆ getRefineCriteria()

vector< double > getRefineCriteria | ( | int | dom | ) |

Get the grid refinement criteria.

dom must be greater than or equal to zero (that is, the domain must be specified).

See also
  Refiner::getCriteria

Definition at line 804 of file Sim1D.cpp.

## ◆ setMaxGridPoints()

void setMaxGridPoints | ( | int | dom,
|  | int | npoints
| ) |  |

Set the maximum number of grid points in the domain.

If dom >= 0, then the settings apply only to the specified domain. If dom < 0, the settings are applied to each domain.

See also
  Refiner::setMaxPoints.

Definition at line 828 of file Sim1D.cpp.

## ◆ maxGridPoints()

size_t maxGridPoints | ( | size_t | dom | ) |

Get the maximum number of grid points in this domain.

See also
  Refiner::maxPoints

Parameters

  dom | domain number, beginning with 0 for the leftmost domain.

Definition at line 841 of file Sim1D.cpp.

## ◆ setGridMin()

void setGridMin | ( | int | dom,
|  | double | gridmin
| ) |  |

Set the minimum grid spacing in the specified domain(s).

Parameters

  dom | Domain index. If dom == -1, the specified spacing is applied to all domains.
  gridmin | The minimum allowable grid spacing [m]

Definition at line 815 of file Sim1D.cpp.

## ◆ restoreTimeSteppingSolution()

void restoreTimeSteppingSolution | ( |  | ) |

Set the current solution vector to the last successful time-stepping solution.

This can be used to examine the solver progress after a failed integration.

Definition at line 415 of file Sim1D.cpp.

## ◆ restoreSteadySolution()

void restoreSteadySolution | ( |  | ) |

Set the current solution vector and grid to the last successful steady- state solution.

This can be used to examine the solver progress after a failure during grid refinement.

Definition at line 424 of file Sim1D.cpp.

## ◆ getInitialSoln()

void getInitialSoln | ( |  | ) |

Definition at line 437 of file Sim1D.cpp.

## ◆ setSolution()

void setSolution | ( | const double * | soln | ) |
| inline

Deprecated:
  To be removed after Cantera 3.0 (unused)

Definition at line 304 of file Sim1D.h.

## ◆ solution() [2/2]

const double * solution | ( |  | ) | const
| inline

Deprecated:
  To be removed after Cantera 3.0 (unused)

Definition at line 311 of file Sim1D.h.

## ◆ jacobian()

double jacobian | ( | int | i,
|  | int | j
| ) |  |

Definition at line 847 of file Sim1D.cpp.

## ◆ evalSSJacobian()

void evalSSJacobian | ( |  | ) |

Definition at line 852 of file Sim1D.cpp.

## ◆ solveAdjoint()

void solveAdjoint | ( | const double * | b,
|  | double * | lambda
| ) |  |

Solve the equation \( J^T \lambda = b \).

Here, \( J = \partial f/\partial x \) is the Jacobian matrix of the system of equations \( f(x,p)=0 \). This can be used to efficiently solve for the sensitivities of a scalar objective function \( g(x,p) \) to a vector of parameters \( p \) by solving:

\[ J^T \lambda = \left( \frac{\partial g}{\partial x} \right)^T \]

for \( \lambda \) and then computing:

\[ \left.\frac{dg}{dp}\right|_{f=0} = \frac{\partial g}{\partial p} - \lambda^T \frac{\partial f}{\partial p} \]

Definition at line 857 of file Sim1D.cpp.

## ◆ resize()

void resize | ( |  | ) |
| override virtual

Call after one or more grids has changed size, for example after being refined.

Reimplemented from OneDim.

Definition at line 881 of file Sim1D.cpp.

## ◆ setSteadyCallback()

void setSteadyCallback | ( | Func1 * | callback | ) |
| inline

Set a function that will be called after each successful steady-state solve, before regridding.

Intended to be used for observing solver progress for debugging purposes.

Definition at line 341 of file Sim1D.h.

## ◆ finalize()

void finalize | ( |  | ) |
| private

Calls method _finalize in each domain.

Definition at line 444 of file Sim1D.cpp.

## ◆ newtonSolve()

int newtonSolve | ( | int | loglevel | ) |
| private

Wrapper around the Newton solver.

Returns
  0 if successful, -1 on failure

Definition at line 460 of file Sim1D.cpp.

## Member Data Documentation

## ◆ m_xlast_ts

vector<double> m_xlast_ts
| protected

the solution vector after the last successful timestepping

Definition at line 347 of file Sim1D.h.

## ◆ m_xlast_ss

vector<double> m_xlast_ss
| protected

the solution vector after the last successful steady-state solve (stored before grid refinement)

Definition at line 351 of file Sim1D.h.

## ◆ m_grid_last_ss

vector<vector<double> > m_grid_last_ss
| protected

the grids for each domain after the last successful steady-state solve (stored before grid refinement)

Definition at line 355 of file Sim1D.h.

## ◆ m_xnew

vector<double> m_xnew
| protected

a work array used to hold the residual or the new solution

Definition at line 358 of file Sim1D.h.

## ◆ m_tstep

double m_tstep
| protected

timestep

Definition at line 361 of file Sim1D.h.

## ◆ m_steps

vector<int> m_steps
| protected

array of number of steps to take before re-attempting the steady-state solution

Definition at line 365 of file Sim1D.h.

## ◆ m_steady_callback

Func1* m_steady_callback
| protected

User-supplied function called after a successful steady-state solve.

Definition at line 368 of file Sim1D.h.

The documentation for this class was generated from the following files:

- Sim1D.h
- Sim1D.cpp