diff --git a/include/cantera/clib/ct.h b/include/cantera/clib/ct.h index f57cfff51..38c1b28f3 100644 --- a/include/cantera/clib/ct.h +++ b/include/cantera/clib/ct.h @@ -51,7 +51,6 @@ extern "C" { CANTERA_CAPI int phase_addElement(int n, const char* name, double weight); CANTERA_CAPI int newThermoFromXML(int mxml); - CANTERA_CAPI size_t th_nSpecies(size_t n); CANTERA_CAPI int th_eosType(int n); CANTERA_CAPI double th_refPressure(int n); CANTERA_CAPI double th_minTemp(int n, int k); @@ -106,8 +105,6 @@ extern "C" { CANTERA_CAPI size_t newKineticsFromXML(int mxml, int iphase, int neighbor1, int neighbor2, int neighbor3, int neighbor4); - CANTERA_CAPI int installRxnArrays(int pxml, int ikin, - const char* default_phase); CANTERA_CAPI size_t kin_nSpecies(int n); CANTERA_CAPI size_t kin_nReactions(int n); CANTERA_CAPI size_t kin_nPhases(int n); @@ -154,9 +151,6 @@ extern "C" { CANTERA_CAPI int trans_getMassFluxes(int n, const double* state1, const double* state2, double delta, double* fluxes); - CANTERA_CAPI int import_phase(int nth, int nxml, const char* id); - CANTERA_CAPI int import_kinetics(int nxml, const char* id, - int nphases, const int* ith, int nkin); CANTERA_CAPI int getCanteraError(int buflen, char* buf); CANTERA_CAPI int showCanteraErrors(); CANTERA_CAPI int setLogWriter(void* logger); @@ -165,9 +159,6 @@ extern "C" { CANTERA_CAPI int delThermo(int n); CANTERA_CAPI int delKinetics(int n); CANTERA_CAPI int delTransport(int n); - CANTERA_CAPI int readlog(int n, char* buf); - CANTERA_CAPI int buildSolutionFromXML(const char* src, int ixml, const char* id, - int ith, int ikin); CANTERA_CAPI int ck_to_cti(const char* in_file, const char* db_file, const char* tr_file, const char* id_tag, int debug, int validate); diff --git a/include/cantera/clib/ctfunc.h b/include/cantera/clib/ctfunc.h index 76eee2a63..8b30ea2eb 100644 --- a/include/cantera/clib/ctfunc.h +++ b/include/cantera/clib/ctfunc.h @@ -17,7 +17,6 @@ extern "C" { CANTERA_CAPI int func_new(int type, size_t n, size_t lenp, const double* p); CANTERA_CAPI int func_del(int i); CANTERA_CAPI int func_clear(); - CANTERA_CAPI int func_copy(int i); CANTERA_CAPI double func_value(int i, double t); CANTERA_CAPI int func_derivative(int i); CANTERA_CAPI int func_duplicate(int i); diff --git a/include/cantera/clib/ctmultiphase.h b/include/cantera/clib/ctmultiphase.h index 43587c449..daaddc724 100644 --- a/include/cantera/clib/ctmultiphase.h +++ b/include/cantera/clib/ctmultiphase.h @@ -17,7 +17,6 @@ extern "C" { CANTERA_CAPI int mix_new(); CANTERA_CAPI int mix_del(int i); CANTERA_CAPI int mix_clear(); - CANTERA_CAPI int mix_copy(int i); CANTERA_CAPI int mix_addPhase(int i, int j, double moles); CANTERA_CAPI int mix_init(int i); CANTERA_CAPI int mix_updatePhases(int i); @@ -43,14 +42,7 @@ extern "C" { CANTERA_CAPI double mix_elementMoles(int i, int m); CANTERA_CAPI double mix_equilibrate(int i, const char* XY, double err, int maxsteps, int maxiter, int loglevel); - CANTERA_CAPI double mix_vcs_equilibrate(int i, const char* XY, int estimateEquil, - int printLvl, int solver, - double rtol, int maxsteps, - int maxiter, int loglevel); CANTERA_CAPI int mix_getChemPotentials(int i, size_t lenmu, double* mu); - CANTERA_CAPI int mix_getValidChemPotentials(int i, double bad_mu, - int standard, size_t lenmu, - double* mu); CANTERA_CAPI double mix_enthalpy(int i); CANTERA_CAPI double mix_entropy(int i); CANTERA_CAPI double mix_gibbs(int i); diff --git a/include/cantera/clib/ctonedim.h b/include/cantera/clib/ctonedim.h index 83af12410..0770ada99 100644 --- a/include/cantera/clib/ctonedim.h +++ b/include/cantera/clib/ctonedim.h @@ -34,7 +34,6 @@ extern "C" { CANTERA_CAPI double domain_atol(int i, int n); CANTERA_CAPI int domain_setupGrid(int i, size_t npts, const double* grid); CANTERA_CAPI int domain_setID(int i, const char* id); - CANTERA_CAPI int domain_setDesc(int i, const char* desc); CANTERA_CAPI double domain_grid(int i, int n); CANTERA_CAPI int bdry_setMdot(int i, double mdot); @@ -90,12 +89,7 @@ extern "C" { int icomp, int localPoint); CANTERA_CAPI int sim1D_eval(int i, double rdt, int count); CANTERA_CAPI int sim1D_setMaxJacAge(int i, int ss_age, int ts_age); - CANTERA_CAPI int sim1D_timeStepFactor(int i, double tfactor); - CANTERA_CAPI int sim1D_setTimeStepLimits(int i, double tsmin, double tsmax); CANTERA_CAPI int sim1D_setFixedTemperature(int i, double temp); - CANTERA_CAPI int sim1D_evalSSJacobian(int i); - CANTERA_CAPI double sim1D_jacobian(int i, int m, int n); - CANTERA_CAPI size_t sim1D_size(int i); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctreactor.h b/include/cantera/clib/ctreactor.h index c13ebe0f4..6e2a6f16a 100644 --- a/include/cantera/clib/ctreactor.h +++ b/include/cantera/clib/ctreactor.h @@ -16,7 +16,6 @@ extern "C" { CANTERA_CAPI int reactor_new(int type); CANTERA_CAPI int reactor_del(int i); - CANTERA_CAPI int reactor_copy(int i); CANTERA_CAPI int reactor_setInitialVolume(int i, double v); CANTERA_CAPI int reactor_setChemistry(int i, int cflag); CANTERA_CAPI int reactor_setEnergy(int i, int eflag); @@ -36,7 +35,6 @@ extern "C" { CANTERA_CAPI int reactornet_new(); CANTERA_CAPI int reactornet_del(int i); - CANTERA_CAPI int reactornet_copy(int i); CANTERA_CAPI int reactornet_setInitialTime(int i, double t); CANTERA_CAPI int reactornet_setMaxTimeStep(int i, double maxstep); CANTERA_CAPI int reactornet_setTolerances(int i, double rtol, double atol); @@ -57,11 +55,9 @@ extern "C" { CANTERA_CAPI int flowdev_setMassFlowRate(int i, double mdot); CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v); CANTERA_CAPI int flowdev_setFunction(int i, int n); - CANTERA_CAPI int flowdev_ready(int i); CANTERA_CAPI int wall_new(int type); CANTERA_CAPI int wall_del(int i); - CANTERA_CAPI int wall_copy(int i); CANTERA_CAPI int wall_install(int i, int n, int m); CANTERA_CAPI int wall_setkinetics(int i, int n, int m); CANTERA_CAPI double wall_vdot(int i, double t); @@ -75,7 +71,6 @@ extern "C" { CANTERA_CAPI int wall_setVelocity(int i, int n); CANTERA_CAPI int wall_setEmissivity(int i, double epsilon); CANTERA_CAPI int wall_ready(int i); - CANTERA_CAPI int wall_addSensitivityReaction(int i, int lr, int rxn); CANTERA_CAPI int reactorsurface_new(int type); CANTERA_CAPI int reactorsurface_del(int i); diff --git a/include/cantera/clib/ctxml.h b/include/cantera/clib/ctxml.h index 483f6bd10..cef79614a 100644 --- a/include/cantera/clib/ctxml.h +++ b/include/cantera/clib/ctxml.h @@ -20,7 +20,6 @@ extern "C" { CANTERA_CAPI int xml_clear(); CANTERA_CAPI int xml_copy(int i); CANTERA_CAPI int xml_build(int i, const char* file); - CANTERA_CAPI int xml_preprocess_and_build(int i, const char* file, int debug); CANTERA_CAPI int xml_attrib(int i, const char* key, char* value); CANTERA_CAPI int xml_addAttrib(int i, const char* key, const char* value); CANTERA_CAPI int xml_addComment(int i, const char* comment); @@ -35,7 +34,6 @@ extern "C" { CANTERA_CAPI int xml_addChildNode(int i, int j); CANTERA_CAPI int xml_write(int i, const char* file); CANTERA_CAPI int xml_removeChild(int i, int j); - CANTERA_CAPI int ctml_getFloatArray(int i, size_t n, double* data, int iconvert); #ifdef __cplusplus } diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index 35360711c..76ec6417a 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -357,15 +357,6 @@ extern "C" { } } - size_t th_nSpecies(size_t n) - { - try { - return ThermoCabinet::item(n).nSpecies(); - } catch (...) { - return handleAllExceptions(npos, npos); - } - } - int th_eosType(int n) { try { @@ -912,19 +903,6 @@ extern "C" { } } - int installRxnArrays(int pxml, int ikin, - const char* default_phase) - { - try { - XML_Node& p = XmlCabinet::item(pxml); - Kinetics& k = KineticsCabinet::item(ikin); - installReactionArrays(p, k, default_phase); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - //------------------------------------- int kin_type(int n) { @@ -1389,35 +1367,6 @@ extern "C" { //-------------------- Functions --------------------------- - int import_phase(int nth, int nxml, const char* id) - { - try { - ThermoPhase& thrm = ThermoCabinet::item(nth); - XML_Node& node = XmlCabinet::item(nxml); - importPhase(node, &thrm); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int import_kinetics(int nxml, const char* id, int nphases, const int* ith, int nkin) - { - try { - vector phases; - for (int i = 0; i < nphases; i++) { - phases.push_back(&ThermoCabinet::item(ith[i])); - } - XML_Node& node = XmlCabinet::item(nxml); - Kinetics& k = KineticsCabinet::item(nkin); - importKinetics(node, phases, &k); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int phase_report(int nth, int ibuf, char* buf, int show_thermo) { try { @@ -1486,25 +1435,6 @@ extern "C" { } } - int readlog(int n, char* buf) - { - try { - string s; - writelog("function readlog is deprecated!"); - int nlog = static_cast(s.size()); - if (n < 0) { - return nlog; - } - int nn = min(n-1, nlog); - copy(s.begin(), s.begin() + nn, - buf); - buf[min(nlog, n-1)] = '\0'; - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - - } int clearStorage() { try { @@ -1547,43 +1477,6 @@ extern "C" { } } - int buildSolutionFromXML(const char* src, int ixml, const char* id, - int ith, int ikin) - { - try { - XML_Node* root = 0; - if (ixml > 0) { - root = &XmlCabinet::item(ixml); - } - - ThermoPhase& t = ThermoCabinet::item(ith); - Kinetics& kin = KineticsCabinet::item(ikin); - XML_Node* r = 0; - if (root) { - r = &root->root(); - } - XML_Node* x = get_XML_Node(src, r); - if (!x) { - return false; - } - importPhase(*x, &t); - kin.addPhase(t); - kin.init(); - installReactionArrays(*x, kin, x->id()); - t.setState_TP(300.0, OneAtm); - if (r) { - if (&x->root() != &r->root()) { - delete &x->root(); - } - } else { - delete &x->root(); - } - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int ck_to_cti(const char* in_file, const char* db_file, const char* tr_file, const char* id_tag, int debug, int validate) { diff --git a/src/clib/ctfunc.cpp b/src/clib/ctfunc.cpp index 307101313..4da835ad7 100644 --- a/src/clib/ctfunc.cpp +++ b/src/clib/ctfunc.cpp @@ -121,15 +121,6 @@ extern "C" { } } - int func_copy(int i) - { - try { - return FuncCabinet::newCopy(i); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - double func_value(int i, double t) { try { diff --git a/src/clib/ctmultiphase.cpp b/src/clib/ctmultiphase.cpp index 5cde74a5d..5047fb812 100644 --- a/src/clib/ctmultiphase.cpp +++ b/src/clib/ctmultiphase.cpp @@ -50,15 +50,6 @@ extern "C" { } } - int mix_copy(int i) - { - try { - return mixCabinet::newCopy(i); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int mix_addPhase(int i, int j, double moles) { try { @@ -317,30 +308,6 @@ extern "C" { } } - doublereal mix_vcs_equilibrate(int i, const char* XY, int estimateEquil, - int printLvl, int solver, doublereal rtol, - int maxsteps, int maxiter, int loglevel) - { - try { - string ssolver; - if (solver < 0) { - ssolver = "auto"; - } else if (solver == 1) { - ssolver = "gibbs"; - } else if (solver == 2) { - ssolver = "vcs"; - } else { - throw CanteraError("mix_vcs_equilibrate", - "Invalid equilibrium solver specified."); - } - mixCabinet::item(i).equilibrate(XY, ssolver, rtol, maxsteps, - maxiter, estimateEquil, loglevel); - return 0; - } catch (...) { - return handleAllExceptions(ERR, ERR); - } - } - int mix_getChemPotentials(int i, size_t lenmu, double* mu) { try { @@ -353,20 +320,6 @@ extern "C" { } } - int mix_getValidChemPotentials(int i, double bad_mu, - int standard, size_t lenmu, double* mu) - { - try { - bool st = (standard == 1); - MultiPhase& mix = mixCabinet::item(i); - mix.checkSpeciesArraySize(lenmu); - mixCabinet::item(i).getValidChemPotentials(bad_mu, mu, st); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - double mix_enthalpy(int i) { try { diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index 53d618586..293a0a1ce 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -222,18 +222,6 @@ extern "C" { } } - - int domain_setDesc(int i, const char* desc) - { - try { - DomainCabinet::item(i).setDesc(desc); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int inlet_new() { try { @@ -710,31 +698,6 @@ extern "C" { } } - int sim1D_timeStepFactor(int i, double tfactor) - { - try { - SimCabinet::item(i).setTimeStepFactor(tfactor); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int sim1D_setTimeStepLimits(int i, double tsmin, double tsmax) - { - try { - if (tsmin > 0.0) { - SimCabinet::item(i).setMinTimeStep(tsmin); - } - if (tsmax > 0.0) { - SimCabinet::item(i).setMaxTimeStep(tsmax); - } - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int sim1D_setFixedTemperature(int i, double temp) { try { @@ -744,32 +707,4 @@ extern "C" { return handleAllExceptions(-1, ERR); } } - - int sim1D_evalSSJacobian(int i) - { - try { - SimCabinet::item(i).evalSSJacobian(); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - double sim1D_jacobian(int i, int m, int n) - { - try { - return SimCabinet::item(i).jacobian(m,n); - } catch (...) { - return handleAllExceptions(DERR, DERR); - } - } - - size_t sim1D_size(int i) - { - try { - return SimCabinet::item(i).size(); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } } diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index 1d734123d..e70cf8510 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -59,15 +59,6 @@ extern "C" { } } - int reactor_copy(int i) - { - try { - return ReactorCabinet::newCopy(i); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int reactor_setInitialVolume(int i, double v) { try { @@ -249,15 +240,6 @@ extern "C" { } } - int reactornet_copy(int i) - { - try { - return NetworkCabinet::newCopy(i); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int reactornet_setInitialTime(int i, double t) { try { @@ -463,15 +445,6 @@ extern "C" { } } - int flowdev_ready(int i) - { - try { - return int(FlowDeviceCabinet::item(i).ready()); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - ///////////// Walls /////////////////////// int wall_new(int type) @@ -493,15 +466,6 @@ extern "C" { } } - int wall_copy(int i) - { - try { - return WallCabinet::newCopy(i); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int wall_install(int i, int n, int m) { try { @@ -636,16 +600,6 @@ extern "C" { } } - int wall_addSensitivityReaction(int i, int lr, int rxn) - { - try { - WallCabinet::item(i).addSensitivityReaction(lr, rxn); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - // ReactorSurface int reactorsurface_new(int type) diff --git a/src/clib/ctxml.cpp b/src/clib/ctxml.cpp index b060654c3..da1fd3256 100644 --- a/src/clib/ctxml.cpp +++ b/src/clib/ctxml.cpp @@ -100,16 +100,6 @@ extern "C" { } } - int xml_preprocess_and_build(int i, const char* file, int debug) - { - try { - XmlCabinet::item(i) = *get_XML_File(file); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int xml_attrib(int i, const char* key, char* value) { try { @@ -270,30 +260,4 @@ extern "C" { return 0; } - int ctml_getFloatArray(int i, size_t n, doublereal* data, int iconvert) - { - try { - XML_Node& node = XmlCabinet::item(i); - vector_fp v; - bool conv = false; - if (iconvert > 0) { - conv = true; - } - getFloatArray(node, v, conv); - size_t nv = v.size(); - - // array not big enough - if (n < nv) { - throw CanteraError("ctml_getFloatArray", - "array must be dimensioned at least {}", nv); - } - - for (size_t i = 0; i < nv; i++) { - data[i] = v[i]; - } - } catch (...) { - return handleAllExceptions(-1, ERR); - } - return 0; - } } diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index c7217ba44..61e23084d 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -367,15 +367,6 @@ extern "C" { } } - integer th_nspecies_(const integer* n) - { - try { - return _fth(n)->nSpecies(); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - integer th_eostype_(const integer* n) { try { diff --git a/src/matlab/thermomethods.cpp b/src/matlab/thermomethods.cpp index a3173b5bc..41c4e5a0a 100644 --- a/src/matlab/thermomethods.cpp +++ b/src/matlab/thermomethods.cpp @@ -219,7 +219,7 @@ static void thermoget(int nlhs, mxArray* plhs[], } } else if (job < 50) { int iok = 0; - size_t nsp = th_nSpecies(n); + size_t nsp = phase_nSpecies(n); std::vector x(nsp); switch (job) { case 32: