38 Sim1D(vector<shared_ptr<Domain1D>>& domains);
54 vector<double>& vals);
64 void setValue(
size_t dom,
size_t comp,
size_t localPoint,
double value);
73 double value(
size_t dom,
size_t comp,
size_t localPoint)
const;
80 double workValue(
size_t dom,
size_t comp,
size_t localPoint)
const;
96 void setProfile(
size_t dom,
size_t comp,
const vector<double>& pos,
97 const vector<double>& values);
141 void save(
const string& fname,
const string& name,
const string& desc,
142 bool overwrite=
false,
int compression=0,
const string& basis=
"");
152 void saveResidual(
const string& fname,
const string& name,
153 const string& desc,
bool overwrite=
false,
int compression=0);
196 void writeDebugInfo(
const string& header_suffix,
const string& message,
int loglevel,
197 int attempt_counter)
override;
219 void solve(
int loglevel = 0,
bool refine_grid =
true);
221 void eval(
double rdt=-1.0,
int count = 1) {
238 int refine(
int loglevel=0);
279 double slope = 0.8,
double curve = 0.8,
280 double prune = -0.1);
380shared_ptr<Sim1D>
newSim1D(vector<shared_ptr<Domain1D>>& domains);
A map of string keys to values whose type can vary at runtime.
Base class for 'functor' classes that evaluate a function of one variable.
Container class for multiple-domain 1D problems.
void eval(size_t j, double *x, double *r, double rdt=-1.0, int count=1)
Evaluate the multi-domain residual function.
std::tuple< string, size_t, string > component(size_t i) const
Return the domain, local point index, and component name for the i-th component of the global solutio...
One-dimensional simulations.
void getInitialSoln()
Get the initial value of the system state from each domain in the simulation.
void restoreTimeSteppingSolution()
Set the current solution vector to the last successful time-stepping solution.
void resize() override
Call to set the size of internal data structures after first defining the system or if the problem si...
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.
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.
double fixedTemperatureLocation()
Return location of the point where temperature is fixed.
vector< vector< double > > m_grid_last_ss
the grids for each domain after the last successful steady-state solve (stored before grid refinement...
void finalize()
Calls method _finalize in each domain.
void setValue(size_t dom, size_t comp, size_t localPoint, double value)
Set a single value in the solution vector.
void setSteadyCallback(Func1 *callback)
Set a function that will be called after each successful steady-state solve, before regridding.
int refine(int loglevel=0)
Refine the grid in all domains.
void show()
Show logging information on current solution for all domains.
double fixedTemperature()
Return temperature at the point used to fix the flame location.
void clearDebugFile() override
Deletes a debug_sim1d.yaml file if it exists.
vector< double > m_xlast_ss
the solution vector after the last successful steady-state solve (stored before grid refinement)
void setMaxGridPoints(int dom, int npoints)
Set the maximum number of grid points in the domain.
int setFixedTemperature(double t)
Add node for fixed temperature point of freely propagating flame.
void getResidual(double rdt, double *resid)
Evaluate the governing equations and return the vector of residuals.
void setInitialGuess(const string &component, vector< double > &locs, vector< double > &vals)
Set initial guess for one component for all domains.
void solve(int loglevel=0, bool refine_grid=true)
Performs the hybrid Newton steady/time-stepping solution.
void evalSSJacobian()
Evaluate the Jacobian in steady-state mode.
void solveAdjoint(const double *b, double *lambda)
Solve the equation .
AnyMap restore(const string &fname, const string &name)
Retrieve data and settings from a previously saved simulation.
Func1 * m_steady_callback
User-supplied function called after a successful steady-state solve.
void restoreSteadySolution()
Set the current solution vector and grid to the last successful steady- state solution.
size_t maxGridPoints(size_t dom)
Get the maximum number of grid points in this domain.
void setFlatProfile(size_t dom, size_t comp, double v)
Set component 'comp' of domain 'dom' to value 'v' at all points.
void writeDebugInfo(const string &header_suffix, const string &message, int loglevel, int attempt_counter) override
Write solver debugging information to a YAML file based on the specified log level.
void setRightControlPoint(double temperature)
Set the right control point location using the specified temperature.
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
Get an entry in the work vector, which may contain either a new system state or the current residual ...
vector< double > getRefineCriteria(int dom)
Get the grid refinement criteria.
Sim1D()
Default constructor.
void setGridMin(int dom, double gridmin)
Set the minimum grid spacing in the specified domain(s).
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 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 setLeftControlPoint(double temperature)
Set the left control point location using the specified temperature.
vector< double > m_xnew
Work array used to hold the residual or the new solution.
double rdt() const
Reciprocal of the time step.
shared_ptr< vector< double > > m_state
Solution vector.
MultiJac & jacobian()
Return a reference to the Jacobian evaluator of an OneDim object.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
shared_ptr< Sim1D > newSim1D(vector< shared_ptr< Domain1D > > &domains)
Create a Sim1D object with a list of domains.