27 OneDim(std::vector<Domain1D*> domains);
45 int solve(doublereal* x0, doublereal* x1,
int loglevel);
57 size_t domainIndex(
const std::string& name);
78 return m_dom[i]->loc();
131 doublereal
ssnorm(doublereal* x, doublereal* r);
142 bool transient()
const {
143 return (m_rdt != 0.0);
148 return (m_rdt == 0.0);
170 void eval(
size_t j,
double* x,
double* r, doublereal
rdt=-1.0,
198 double timeStep(
int nsteps,
double dt,
double* x,
199 double* r,
int loglevel);
209 void save(
const std::string& fname, std::string
id,
210 const std::string& desc, doublereal* sol,
int loglevel);
213 void setMinTimeStep(doublereal tmin) {
216 void setMaxTimeStep(doublereal tmax) {
219 void setTimeStepFactor(doublereal tfactor) {
222 void setJacAge(
int ss_age,
int ts_age=-1) {
223 m_ss_jac_age = ss_age;
225 m_ts_jac_age = ts_age;
227 m_ts_jac_age = m_ss_jac_age;
255 void evalSSJacobian(doublereal* x, doublereal* xnew);
259 doublereal m_tfactor;
273 std::vector<Domain1D*> m_dom, m_connect, m_bulk;
276 std::vector<size_t> m_nvars;
277 std::vector<size_t> m_loc;
280 doublereal m_solve_time;
283 int m_ss_jac_age, m_ts_jac_age;
291 doublereal m_evaltime;
292 std::vector<size_t> m_gridpts;
Container class for multiple-domain 1D problems.
void checkDomainArraySize(size_t nn) const
Check that an array size is at least nDomains() Throws an exception if nn is less than nDomains()...
size_t m_nd
number of domains
Domain1D * left()
Pointer to left-most domain (first added).
void addDomain(Domain1D *d)
Add a domain. Domains are added left-to-right.
double timeStep(int nsteps, double dt, double *x, double *r, int loglevel)
void resize()
Call after one or more grids has been refined.
bool steady() const
True if steady mode.
doublereal ssnorm(doublereal *x, doublereal *r)
Steady-state max norm (infinity norm) of the residual evaluated using solution x. ...
void eval(size_t j, double *x, double *r, doublereal rdt=-1.0, int count=1)
Evaluate the multi-domain residual function.
MultiJac & jacobian()
Return a reference to the Jacobian evaluator.
int solve(doublereal *x0, doublereal *x1, int loglevel)
Solve F(x) = 0, where F(x) is the multi-domain residual function.
size_t loc(size_t jg)
Location in the solution vector of the first component of global point jg.
MultiNewton & newton()
Return a reference to the Newton iterator.
doublereal rdt() const
Reciprocal of the time step.
void checkDomainIndex(size_t n) const
Check that the specified domain index is in range Throws an exception if n is greater than nDomains()...
std::vector< int > vector_int
Vector of ints.
Base class for one-dimensional domains.
size_t bandwidth() const
Jacobian bandwidth.
size_t points()
Total number of points.
size_t start(size_t i) const
The index of the start of domain i in the solution vector.
Domain1D & domain(size_t i) const
Return a reference to domain i.
Base class for 'functor' classes that evaluate a function of one variable.
void saveStats()
Save statistics on function and Jacobian evaluation, and reset the counters.
void clearStats()
Clear saved statistics.
size_t nDomains() const
Number of domains.
void writeStats(int printTime=1)
Write statistics about the number of iterations and Jacobians at each grid level. ...
Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplie...
void initTimeInteg(doublereal dt, doublereal *x)
Prepare for time stepping beginning with solution x and timestep dt.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void setInterrupt(Func1 *interrupt)
Set a function that will be called every time eval is called.
Func1 * m_interrupt
Function called at the start of every call to eval.
Newton iterator for multi-domain, one-dimensional problems.
An array index is out of range.
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 size() const
Total solution vector length;.
Domain1D * pointDomain(size_t i)
Return a pointer to the domain global point i belongs to.