Generated CLib API for Cantera's Sim1D class. More...
Generated CLib API for Cantera's Sim1D class.
Functions | |
int32_t | sim1D_newSim1D (int32_t domainsLen, int32_t *domains) |
Create a Sim1D object with a list of domains. | |
int32_t | sim1D_setValue (int32_t handle, int32_t dom, int32_t comp, int32_t localPoint, double value) |
Set a single value in the solution vector. | |
int32_t | sim1D_setProfile (int32_t handle, int32_t dom, int32_t comp, int32_t posLen, const double *pos, int32_t valuesLen, const double *values) |
Specify a profile for one component of one domain. | |
int32_t | sim1D_setFlatProfile (int32_t handle, int32_t dom, int32_t comp, double v) |
Set component 'comp' of domain 'dom' to value 'v' at all points. | |
int32_t | sim1D_setInitialGuess (int32_t handle, const char *component, int32_t locsLen, double *locs, int32_t valsLen, double *vals) |
Set initial guess for one component for all domains. | |
int32_t | sim1D_show (int32_t handle) |
Show logging information on current solution for all domains. | |
int32_t | sim1D_setTimeStep (int32_t handle, double stepsize, int32_t n, int32_t tstepsLen, const int32_t *tsteps) |
Set the number of time steps to try when the steady Newton solver is unsuccessful. | |
int32_t | sim1D_getInitialSoln (int32_t handle) |
Get the initial value of the system state from each domain in the simulation. | |
int32_t | sim1D_solve (int32_t handle, int32_t loglevel, int32_t refine_grid) |
Performs the hybrid Newton steady/time-stepping solution. | |
int32_t | sim1D_refine (int32_t handle, int32_t loglevel) |
Refine the grid in all domains. | |
int32_t | sim1D_setRefineCriteria (int32_t handle, int32_t dom, double ratio, double slope, double curve, double prune) |
Set grid refinement criteria. | |
int32_t | sim1D_setGridMin (int32_t handle, int32_t dom, double gridmin) |
Set the minimum grid spacing in the specified domain(s). | |
int32_t | sim1D_save (int32_t handle, const char *fname, const char *name, const char *desc) |
Save current simulation data to a container file or CSV format. | |
int32_t | sim1D_writeStats (int32_t handle, int32_t printTime) |
Write statistics about the number of iterations and Jacobians at each grid level. | |
int32_t | sim1D_domainIndex (int32_t handle, const char *name) |
Get the index of the domain named. | |
double | sim1D_value (int32_t handle, int32_t dom, int32_t comp, int32_t localPoint) |
Get one entry in the solution vector. | |
double | sim1D_workValue (int32_t handle, int32_t dom, int32_t comp, int32_t localPoint) |
Get an entry in the work vector, which may contain either a new system state or the current residual of the system. | |
int32_t | sim1D_eval (int32_t handle, int32_t xLen, double *x, int32_t rLen, double *r, double rdt, int32_t count) |
Evaluate the residual function. | |
int32_t | sim1D_setMaxJacAge (int32_t handle, int32_t ss_age, int32_t ts_age) |
Set the maximum number of steps that can be taken using the same Jacobian before it must be re-evaluated. | |
int32_t | sim1D_setFixedTemperature (int32_t handle, double t) |
Add node for fixed temperature point of freely propagating flame. | |
int32_t | sim1D_del (int32_t handle) |
Delete Sim1D object. | |
int32_t | sim1D_cabinetSize () |
Return size of Sim1D storage. | |
int32_t | sim1D_parentHandle (int32_t handle) |
Return handle to parent of Sim1D object. | |
int32_t sim1D_newSim1D | ( | int32_t | domainsLen, |
int32_t * | domains | ||
) |
Create a Sim1D object with a list of domains.
Wraps C++ constructor: shared_ptr<Sim1D> newSim1D(vector<shared_ptr<Domain1D>>&)
Uses:
Domain1D& OneDim::domain(size_t)
[in] | domainsLen | Length of array reserved for domains. |
domains | Memory holding Domain1D objects. A vector of shared pointers to the domains to be linked together. The domain pointers must be entered in left-to-right order |
Definition at line 40 of file ctonedim.cpp.
int32_t sim1D_setValue | ( | int32_t | handle, |
int32_t | dom, | ||
int32_t | comp, | ||
int32_t | localPoint, | ||
double | value | ||
) |
Set a single value in the solution vector.
Wraps C++ method: void Sim1D::setValue(size_t, size_t, size_t, double)
handle | Handle to queried Sim1D object. |
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 54 of file ctonedim.cpp.
int32_t sim1D_setProfile | ( | int32_t | handle, |
int32_t | dom, | ||
int32_t | comp, | ||
int32_t | posLen, | ||
const double * | pos, | ||
int32_t | valuesLen, | ||
const double * | values | ||
) |
Specify a profile for one component of one domain.
Wraps C++ method: void Sim1D::setProfile(size_t, size_t, const vector<double>&, const vector<double>&)
handle | Handle to queried Sim1D object. | |
dom | domain number, beginning with 0 for the leftmost domain. | |
comp | component number | |
[in] | posLen | Length of vector reserved for pos. |
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. | |
[in] | valuesLen | Length of vector reserved for values. |
values | A vector of values corresponding to the relative position locations. |
Definition at line 65 of file ctonedim.cpp.
int32_t sim1D_setFlatProfile | ( | int32_t | handle, |
int32_t | dom, | ||
int32_t | comp, | ||
double | v | ||
) |
Set component 'comp' of domain 'dom' to value 'v' at all points.
Wraps C++ method: void Sim1D::setFlatProfile(size_t, size_t, double)
handle | Handle to queried Sim1D object. |
dom | Undocumented. |
comp | Undocumented. |
v | Undocumented. |
Definition at line 78 of file ctonedim.cpp.
int32_t sim1D_setInitialGuess | ( | int32_t | handle, |
const char * | component, | ||
int32_t | locsLen, | ||
double * | locs, | ||
int32_t | valsLen, | ||
double * | vals | ||
) |
Set initial guess for one component for all domains.
Wraps C++ method: void Sim1D::setInitialGuess(const string&, vector<double>&, vector<double>&)
handle | Handle to queried Sim1D object. | |
component | component name | |
[in] | locsLen | Length of vector reserved for locs. |
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. | |
[in] | valsLen | Length of vector reserved for vals. |
vals | A vector of values corresponding to the relative position locations. |
Definition at line 89 of file ctonedim.cpp.
int32_t sim1D_show | ( | int32_t | handle | ) |
Show logging information on current solution for all domains.
Wraps C++ method: void Sim1D::show()
handle | Handle to queried Sim1D object. |
Definition at line 102 of file ctonedim.cpp.
int32_t sim1D_setTimeStep | ( | int32_t | handle, |
double | stepsize, | ||
int32_t | n, | ||
int32_t | tstepsLen, | ||
const int32_t * | tsteps | ||
) |
Set the number of time steps to try when the steady Newton solver is unsuccessful.
Wraps C++ method: void SteadyStateSystem::setTimeStep(double, size_t, const int*)
handle | Handle to queried SteadyStateSystem object. | |
stepsize | Initial time step size [s] | |
n | Length of | |
[in] | tstepsLen | Length of array reserved for tsteps. |
tsteps | A sequence of time step counts to take after subsequent failures of the steady-state solver. The last value in |
Definition at line 113 of file ctonedim.cpp.
int32_t sim1D_getInitialSoln | ( | int32_t | handle | ) |
Get the initial value of the system state from each domain in the simulation.
Wraps C++ method: void Sim1D::getInitialSoln()
handle | Handle to queried Sim1D object. |
Definition at line 124 of file ctonedim.cpp.
int32_t sim1D_solve | ( | int32_t | handle, |
int32_t | loglevel, | ||
int32_t | refine_grid | ||
) |
Performs the hybrid Newton steady/time-stepping solution.
Wraps C++ method: void Sim1D::solve(int, bool)
handle | Handle to queried Sim1D object. |
loglevel | Controls the amount of diagnostic output. |
refine_grid | If |
Definition at line 135 of file ctonedim.cpp.
int32_t sim1D_refine | ( | int32_t | handle, |
int32_t | loglevel | ||
) |
Refine the grid in all domains.
Wraps C++ method: int Sim1D::refine(int)
handle | Handle to queried Sim1D object. |
loglevel | Undocumented. |
Definition at line 147 of file ctonedim.cpp.
int32_t sim1D_setRefineCriteria | ( | int32_t | handle, |
int32_t | dom, | ||
double | ratio, | ||
double | slope, | ||
double | curve, | ||
double | prune | ||
) |
Set grid refinement criteria.
Wraps C++ method: void Sim1D::setRefineCriteria(int, double, double, double, double)
handle | Handle to queried Sim1D object. |
dom | Undocumented. |
ratio | Undocumented. |
slope | Undocumented. |
curve | Undocumented. |
prune | Undocumented. |
Definition at line 157 of file ctonedim.cpp.
int32_t sim1D_setGridMin | ( | int32_t | handle, |
int32_t | dom, | ||
double | gridmin | ||
) |
Set the minimum grid spacing in the specified domain(s).
Wraps C++ method: void Sim1D::setGridMin(int, double)
handle | Handle to queried Sim1D object. |
dom | Domain index. If dom == -1, the specified spacing is applied to all domains. |
gridmin | The minimum allowable grid spacing [m] |
Definition at line 168 of file ctonedim.cpp.
int32_t sim1D_save | ( | int32_t | handle, |
const char * | fname, | ||
const char * | name, | ||
const char * | desc | ||
) |
Save current simulation data to a container file or CSV format.
Wraps C++ method: void Sim1D::save(const string&, const string&, const string&)
handle | Handle to queried Sim1D object. |
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) |
Definition at line 179 of file ctonedim.cpp.
int32_t sim1D_writeStats | ( | int32_t | handle, |
int32_t | printTime | ||
) |
Write statistics about the number of iterations and Jacobians at each grid level.
Wraps C++ setter: void OneDim::writeStats(int)
handle | Handle to queried OneDim object. |
printTime | Boolean that indicates whether time should be printed out The default is true. It's turned off for test problems where we don't want to print any times |
Definition at line 190 of file ctonedim.cpp.
int32_t sim1D_domainIndex | ( | int32_t | handle, |
const char * | name | ||
) |
Get the index of the domain named.
Wraps C++ method: size_t OneDim::domainIndex(const string&)
handle | Handle to queried OneDim object. |
name | Undocumented. |
Definition at line 201 of file ctonedim.cpp.
double sim1D_value | ( | int32_t | handle, |
int32_t | dom, | ||
int32_t | comp, | ||
int32_t | localPoint | ||
) |
Get one entry in the solution vector.
Wraps C++ method: double Sim1D::value(size_t, size_t, size_t)
handle | Handle to queried Sim1D object. |
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 211 of file ctonedim.cpp.
double sim1D_workValue | ( | int32_t | handle, |
int32_t | dom, | ||
int32_t | comp, | ||
int32_t | localPoint | ||
) |
Get an entry in the work vector, which may contain either a new system state or the current residual of the system.
Wraps C++ method: double Sim1D::workValue(size_t, size_t, size_t)
handle | Handle to queried Sim1D object. |
dom | domain index |
comp | component index |
localPoint | grid point within the domain |
Definition at line 221 of file ctonedim.cpp.
int32_t sim1D_eval | ( | int32_t | handle, |
int32_t | xLen, | ||
double * | x, | ||
int32_t | rLen, | ||
double * | r, | ||
double | rdt, | ||
int32_t | count | ||
) |
Evaluate the residual function.
Wraps C++ method: void Sim1D::eval(double*, double*, double, int)
handle | Handle to queried Sim1D object. | |
[in] | xLen | Length of array reserved for x. |
[in] | x | State vector |
[in] | rLen | Length of array reserved for r. |
[out] | r | On return, contains the residual vector |
rdt | Reciprocal of the time step. if omitted, then the internally stored value (accessible using the rdt() method) is used. | |
count | Set to zero to omit this call from the statistics |
Definition at line 231 of file ctonedim.cpp.
int32_t sim1D_setMaxJacAge | ( | int32_t | handle, |
int32_t | ss_age, | ||
int32_t | ts_age | ||
) |
Set the maximum number of steps that can be taken using the same Jacobian before it must be re-evaluated.
Wraps C++ method: void SteadyStateSystem::setJacAge(int, int)
handle | Handle to queried SteadyStateSystem object. |
ss_age | Age limit during steady-state mode |
ts_age | Age limit during time stepping mode. If not specified, the steady-state age is also used during time stepping. |
Definition at line 242 of file ctonedim.cpp.
int32_t sim1D_setFixedTemperature | ( | int32_t | handle, |
double | t | ||
) |
Add node for fixed temperature point of freely propagating flame.
Wraps C++ method: int Sim1D::setFixedTemperature(double)
handle | Handle to queried Sim1D object. |
t | Undocumented. |
Definition at line 253 of file ctonedim.cpp.
int32_t sim1D_del | ( | int32_t | handle | ) |
Delete Sim1D object.
Wraps C++ destructor: undefined
handle | Handle to Sim1D object. |
Definition at line 263 of file ctonedim.cpp.
int32_t sim1D_cabinetSize | ( | ) |
Return size of Sim1D storage.
Wraps C++ reserved CLib function: custom code
Definition at line 274 of file ctonedim.cpp.
int32_t sim1D_parentHandle | ( | int32_t | handle | ) |
Return handle to parent of Sim1D object.
Wraps C++ reserved CLib function: custom code
handle | Handle to queried Sim1D object. |
Definition at line 286 of file ctonedim.cpp.