Cantera  3.2.0a2
Loading...
Searching...
No Matches
ctonedim Library

Generated CLib API for Cantera's Sim1D class. More...

Collaboration diagram for ctonedim Library:

Detailed Description

Generated CLib API for Cantera's Sim1D class.

Warning
This library is an experimental part of the Cantera API and may be changed or removed without notice.

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.
 

Function Documentation

◆ sim1D_newSim1D()

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)
Parameters
[in]domainsLenLength of array reserved for domains.
domainsMemory 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
Returns
Handle to stored Sim1D object or -1 for exception handling.

Definition at line 40 of file ctonedim.cpp.

◆ sim1D_setValue()

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)

Parameters
handleHandle to queried Sim1D object.
domdomain number, beginning with 0 for the leftmost domain.
compcomponent number
localPointgrid point within the domain, beginning with 0 for the leftmost grid point in the domain.
valuethe value.

Definition at line 54 of file ctonedim.cpp.

◆ sim1D_setProfile()

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>&)

Parameters
handleHandle to queried Sim1D object.
domdomain number, beginning with 0 for the leftmost domain.
compcomponent number
[in]posLenLength of vector reserved for pos.
posA 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]valuesLenLength of vector reserved for values.
valuesA vector of values corresponding to the relative position locations.

Definition at line 65 of file ctonedim.cpp.

◆ sim1D_setFlatProfile()

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)

Parameters
handleHandle to queried Sim1D object.
domUndocumented.
compUndocumented.
vUndocumented.

Definition at line 78 of file ctonedim.cpp.

◆ sim1D_setInitialGuess()

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>&)

Parameters
handleHandle to queried Sim1D object.
componentcomponent name
[in]locsLenLength of vector reserved for locs.
locsA 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]valsLenLength of vector reserved for vals.
valsA vector of values corresponding to the relative position locations.

Definition at line 89 of file ctonedim.cpp.

◆ sim1D_show()

int32_t sim1D_show ( int32_t  handle)

Show logging information on current solution for all domains.

Wraps C++ method: void Sim1D::show()

Parameters
handleHandle to queried Sim1D object.

Definition at line 102 of file ctonedim.cpp.

◆ sim1D_setTimeStep()

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*)

Parameters
handleHandle to queried SteadyStateSystem object.
stepsizeInitial time step size [s]
nLength of
[in]tstepsLenLength of array reserved for tsteps.
tstepsA 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.

◆ sim1D_getInitialSoln()

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()

Parameters
handleHandle to queried Sim1D object.

Definition at line 124 of file ctonedim.cpp.

◆ sim1D_solve()

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)

Parameters
handleHandle to queried Sim1D object.
loglevelControls the amount of diagnostic output.
refine_gridIf

Definition at line 135 of file ctonedim.cpp.

◆ sim1D_refine()

int32_t sim1D_refine ( int32_t  handle,
int32_t  loglevel 
)

Refine the grid in all domains.

Wraps C++ method: int Sim1D::refine(int)

Parameters
handleHandle to queried Sim1D object.
loglevelUndocumented.

Definition at line 147 of file ctonedim.cpp.

◆ sim1D_setRefineCriteria()

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)

Parameters
handleHandle to queried Sim1D object.
domUndocumented.
ratioUndocumented.
slopeUndocumented.
curveUndocumented.
pruneUndocumented.

Definition at line 157 of file ctonedim.cpp.

◆ sim1D_setGridMin()

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)

Parameters
handleHandle to queried Sim1D object.
domDomain index. If dom == -1, the specified spacing is applied to all domains.
gridminThe minimum allowable grid spacing [m]

Definition at line 168 of file ctonedim.cpp.

◆ sim1D_save()

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&)

Parameters
handleHandle to queried Sim1D object.
fnameName of output file (CSV, YAML or HDF)
nameIdentifier of storage location within the container file; this node/group contains header information and multiple subgroups holding domain-specific SolutionArray data (YAML/HDF only)
descCustom comment describing the dataset to be stored (YAML/HDF only)

Definition at line 179 of file ctonedim.cpp.

◆ sim1D_writeStats()

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)

Parameters
handleHandle to queried OneDim object.
printTimeBoolean 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.

◆ sim1D_domainIndex()

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&)

Parameters
handleHandle to queried OneDim object.
nameUndocumented.

Definition at line 201 of file ctonedim.cpp.

◆ sim1D_value()

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)

Parameters
handleHandle to queried Sim1D object.
domdomain number, beginning with 0 for the leftmost domain.
compcomponent number
localPointgrid point within the domain, beginning with 0 for the leftmost grid point in the domain.

Definition at line 211 of file ctonedim.cpp.

◆ sim1D_workValue()

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)

Parameters
handleHandle to queried Sim1D object.
domdomain index
compcomponent index
localPointgrid point within the domain

Definition at line 221 of file ctonedim.cpp.

◆ sim1D_eval()

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)

Parameters
handleHandle to queried Sim1D object.
[in]xLenLength of array reserved for x.
[in]xState vector
[in]rLenLength of array reserved for r.
[out]rOn return, contains the residual vector
rdtReciprocal of the time step. if omitted, then the internally stored value (accessible using the rdt() method) is used.
countSet to zero to omit this call from the statistics

Definition at line 231 of file ctonedim.cpp.

◆ sim1D_setMaxJacAge()

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)

Parameters
handleHandle to queried SteadyStateSystem object.
ss_ageAge limit during steady-state mode
ts_ageAge 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.

◆ sim1D_setFixedTemperature()

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)

Parameters
handleHandle to queried Sim1D object.
tUndocumented.

Definition at line 253 of file ctonedim.cpp.

◆ sim1D_del()

int32_t sim1D_del ( int32_t  handle)

Delete Sim1D object.

Wraps C++ destructor: undefined

Parameters
handleHandle to Sim1D object.
Returns
Zero for success and -1 for exception handling.

Definition at line 263 of file ctonedim.cpp.

◆ sim1D_cabinetSize()

int32_t sim1D_cabinetSize ( )

Return size of Sim1D storage.

Wraps C++ reserved CLib function: custom code

Returns
Size or -1 for exception handling.

Definition at line 274 of file ctonedim.cpp.

◆ sim1D_parentHandle()

int32_t sim1D_parentHandle ( int32_t  handle)

Return handle to parent of Sim1D object.

Wraps C++ reserved CLib function: custom code

Parameters
handleHandle to queried Sim1D object.
Returns
Parent handle or -1 for exception handling.

Definition at line 286 of file ctonedim.cpp.