28 OneDim(std::vector<Domain1D*> domains);
46 int solve(doublereal* x0, doublereal* x1,
int loglevel);
58 size_t domainIndex(
const std::string& name);
79 return m_dom[i]->loc();
132 doublereal
ssnorm(doublereal* x, doublereal* r);
143 bool transient()
const {
144 return (m_rdt != 0.0);
149 return (m_rdt == 0.0);
171 void eval(
size_t j,
double* x,
double* r, doublereal
rdt=-1.0,
199 double timeStep(
int nsteps,
double dt,
double* x,
200 double* r,
int loglevel);
210 void save(
const std::string& fname, std::string
id,
211 const std::string& desc, doublereal* sol,
int loglevel);
214 void setMinTimeStep(doublereal tmin) {
217 void setMaxTimeStep(doublereal tmax) {
220 void setTimeStepFactor(doublereal tfactor) {
223 void setJacAge(
int ss_age,
int ts_age=-1) {
224 m_ss_jac_age = ss_age;
226 m_ts_jac_age = ts_age;
228 m_ts_jac_age = m_ss_jac_age;
253 void evalSSJacobian(doublereal* x, doublereal* xnew);
257 doublereal m_tfactor;
271 std::vector<Domain1D*> m_dom, m_connect, m_bulk;
274 std::vector<size_t> m_nvars;
275 std::vector<size_t> m_loc;
278 doublereal m_solve_time;
281 int m_ss_jac_age, m_ts_jac_age;
289 doublereal m_evaltime;
290 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.
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.