37template<> SolutionCabinet* SolutionCabinet::s_storage = 0;
40template<> TransportCabinet* TransportCabinet::s_storage;
43template<> InterfaceCabinet* InterfaceCabinet::s_storage;
46template<> ThermoPhaseCabinet* ThermoPhaseCabinet::s_storage;
49template<> KineticsCabinet* KineticsCabinet::s_storage;
55 int32_t
sol_newSolution(
const char* infile,
const char* name,
const char* transport)
59 return SolutionCabinet::add(
newSolution(infile, name, transport));
65 int32_t
sol_newInterface(
const char* infile,
const char* name, int32_t adjacentLen,
const int32_t* adjacent)
69 vector<shared_ptr<Solution>> adjacent_;
70 for (
int i = 0; i < adjacentLen; i++) {
71 adjacent_.push_back(SolutionCabinet::at(adjacent[i]));
73 return SolutionCabinet::add(
newInterface(infile, name, adjacent_));
79 int32_t
sol_name(int32_t handle, int32_t bufLen,
char* buf)
83 string out = SolutionCabinet::at(handle)->name();
85 return int(out.size()) + 1;
95 SolutionCabinet::at(handle)->setName(name);
106 return ThermoPhaseCabinet::add(SolutionCabinet::at(handle)->thermo());
116 return KineticsCabinet::add(SolutionCabinet::at(handle)->kinetics());
126 return TransportCabinet::add(SolutionCabinet::at(handle)->transport());
136 string out = SolutionCabinet::at(handle)->transportModel();
138 return int(out.size()) + 1;
148 SolutionCabinet::at(handle)->setTransportModel(model);
159 return SolutionCabinet::at(handle)->nAdjacent();
169 if (i < 0 || i >= SolutionCabinet::at(handle)->nAdjacent()) {
170 throw IndexError(
"sol_adjacent",
"", i, SolutionCabinet::at(handle)->nAdjacent());
172 return SolutionCabinet::add(SolutionCabinet::at(handle)->adjacent(i));
182 string out = SolutionCabinet::at(handle)->adjacentName(i);
184 return int(out.size()) + 1;
190 int32_t
sol_source(int32_t handle, int32_t bufLen,
char* buf)
194 string out = SolutionCabinet::at(handle)->source();
196 return int(out.size()) + 1;
206 SolutionCabinet::del(handle);
218 return SolutionCabinet::size();
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Header file defining class TransportFactory (see TransportFactory)
Template for classes to hold pointers to objects.
An array index is out of range.
CTSOL - Generated CLib Cantera interface library.
int32_t sol_adjacent(int32_t handle, int32_t i)
Get the Solution object for an adjacent phase by index.
int32_t sol_newInterface(const char *infile, const char *name, int32_t adjacentLen, const int32_t *adjacent)
Create and initialize a new Interface from an input file.
int32_t sol_adjacentName(int32_t handle, int32_t i, int32_t bufLen, char *buf)
Get the name of an adjacent phase by index.
int32_t sol_newSolution(const char *infile, const char *name, const char *transport)
Create and initialize a new Solution manager from an input file.
int32_t sol_source(int32_t handle, int32_t bufLen, char *buf)
Retrieve source used for object creation; usually an input file name.
int32_t sol_del(int32_t handle)
Delete Solution object.
int32_t sol_transport(int32_t handle)
Accessor for the Transport pointer.
int32_t sol_thermo(int32_t handle)
Accessor for the ThermoPhase pointer.
int32_t sol_transportModel(int32_t handle, int32_t bufLen, char *buf)
Retrieve transport model name.
int32_t sol_cabinetSize()
Return size of Solution storage.
int32_t sol_nAdjacent(int32_t handle)
Get the number of adjacent phases.
int32_t sol_kinetics(int32_t handle)
Accessor for the Kinetics pointer.
int32_t sol_name(int32_t handle, int32_t bufLen, char *buf)
Return the name of this Solution object.
int32_t sol_setTransportModel(int32_t handle, const char *model)
Set the Transport object by name.
int32_t sol_setName(int32_t handle, const char *name)
Set the name of this Solution object.
size_t copyString(const string &source, char *dest, size_t length)
Copy the contents of a string into a char array of a given length.
shared_ptr< Solution > newSolution(const string &infile, const string &name, const string &transport, const vector< shared_ptr< Solution > > &adjacent)
Create and initialize a new Solution manager from an input file.
shared_ptr< Interface > newInterface(const string &infile, const string &name, const vector< string > &adjacent)
Create and initialize a new Interface from an input file.
Namespace for the Cantera kernel.
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.
Contains declarations for string manipulation functions within Cantera.