Go to the documentation of this file.
38 Sim1D(std::vector<Domain1D*>& domains);
66 void setValue(
size_t dom,
size_t comp,
size_t localPoint, doublereal
value);
75 doublereal
value(
size_t dom,
size_t comp,
size_t localPoint)
const;
77 doublereal workValue(
size_t dom,
size_t comp,
size_t localPoint)
const;
101 void save(
const std::string& fname,
const std::string&
id,
102 const std::string& desc,
int loglevel=1);
104 void saveResidual(
const std::string& fname,
const std::string&
id,
105 const std::string& desc,
int loglevel=1);
108 void showSolution(std::ostream& s);
111 const doublereal* solution() {
115 void setTimeStep(
double stepsize,
size_t n,
const int* tsteps);
117 void solve(
int loglevel = 0,
bool refine_grid =
true);
119 void eval(doublereal
rdt=-1.0,
int count = 1) {
124 void getResidual(
double rdt,
double* resid) {
129 int refine(
int loglevel=0);
146 double slope = 0.8,
double curve = 0.8,
147 double prune = -0.1);
179 void restore(
const std::string& fname,
const std::string&
id,
int loglevel=2);
191 void getInitialSoln();
193 void setSolution(
const doublereal* soln) {
194 std::copy(soln, soln +
m_x.size(),
m_x.data());
197 const doublereal* solution()
const {
203 void evalSSJacobian();
void finalize()
Calls method _finalize in each domain.
int setFixedTemperature(double t)
Add node for fixed temperature point of freely propagating flame.
virtual void resize()
Call after one or more grids has changed size, e.g. after being refined.
void setSteadyCallback(Func1 *callback)
Set a function that will be called after each successful steady-state solve, before regridding.
void setFlatProfile(size_t dom, size_t comp, doublereal v)
Set component 'comp' of domain 'dom' to value 'v' at all points.
Container class for multiple-domain 1D problems.
Sim1D()
Default constructor.
doublereal m_tstep
timestep
vector_fp m_xnew
a work array used to hold the residual or the new solution
double fixedTemperatureLocation()
Return location of the point where temperature is fixed.
doublereal value(size_t dom, size_t comp, size_t localPoint) const
Get one entry in the solution vector.
MultiJac & jacobian()
Return a reference to the Jacobian evaluator.
void restoreSteadySolution()
Set the current solution vector and grid to the last successful steady- state solution.
void setProfile(size_t dom, size_t comp, const vector_fp &pos, const vector_fp &values)
Specify a profile for one component of one domain.
double fixedTemperature()
Return temperature at the point used to fix the flame location.
int refine(int loglevel=0)
Refine the grid in all domains.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void setMaxGridPoints(int dom, int npoints)
Set the maximum number of grid points in the domain.
void setGridMin(int dom, double gridmin)
Set the minimum grid spacing in the specified domain(s).
std::vector< vector_fp > m_grid_last_ss
the grids for each domain after the last successful steady-state solve (stored before grid refinement...
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.
void restore(const std::string &fname, const std::string &id, int loglevel=2)
Initialize the solution with a previously-saved solution.
vector_fp m_xlast_ts
the solution vector after the last successful timestepping
std::tuple< std::string, size_t, std::string > component(size_t i)
Return the domain, local point index, and component name for the i-th component of the global solutio...
size_t maxGridPoints(size_t dom)
Get the maximum number of grid points in this domain.
vector_fp m_x
the solution vector
void setInitialGuess(const std::string &component, vector_fp &locs, vector_fp &vals)
Set initial guess for one component for all domains.
vector_fp m_xlast_ss
the solution vector after the last successful steady-state solve (stored before grid refinement)
void setValue(size_t dom, size_t comp, size_t localPoint, doublereal value)
Set a single value in the solution vector.
Base class for 'functor' classes that evaluate a function of one variable.
vector_int m_steps
array of number of steps to take before re-attempting the steady-state solution
int newtonSolve(int loglevel)
Wrapper around the Newton solver.
void solveAdjoint(const double *b, double *lambda)
Solve the equation .
vector_fp getRefineCriteria(int dom)
Get the grid refinement criteria.
std::vector< int > vector_int
Vector of ints.
const size_t npos
index returned by functions to indicate "no position"
doublereal rdt() const
Reciprocal of the time step.
Namespace for the Cantera kernel.
One-dimensional simulations.
void restoreTimeSteppingSolution()
Set the current solution vector to the last successful time-stepping solution.
void eval(size_t j, double *x, double *r, doublereal rdt=-1.0, int count=1)
Evaluate the multi-domain residual function.
Func1 * m_steady_callback
User-supplied function called after a successful steady-state solve.