diff --git a/include/cantera/clib/ct.h b/include/cantera/clib/ct.h index f780e61b0..e073cf807 100644 --- a/include/cantera/clib/ct.h +++ b/include/cantera/clib/ct.h @@ -152,14 +152,15 @@ extern "C" { CANTERA_CAPI int trans_getMassFluxes(int n, const double* state1, const double* state2, double delta, double* fluxes); - CANTERA_CAPI int getCanteraError(int buflen, char* buf); - CANTERA_CAPI int setLogWriter(void* logger); - CANTERA_CAPI int addCanteraDirectory(size_t buflen, const char* buf); + CANTERA_CAPI int ct_getCanteraError(int buflen, char* buf); + CANTERA_CAPI int ct_setLogWriter(void* logger); + CANTERA_CAPI int ct_addCanteraDirectory(size_t buflen, const char* buf); CANTERA_CAPI int ct_getDataDirectories(int buflen, char* buf, const char* sep); - CANTERA_CAPI int clearStorage(); + CANTERA_CAPI int ct_clearStorage(); - 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); + CANTERA_CAPI int ct_ck2cti(const char* in_file, const char* db_file, + const char* tr_file, const char* id_tag, + int debug, int validate); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctfunc.h b/include/cantera/clib/ctfunc.h index 8b30ea2eb..e2e9e099a 100644 --- a/include/cantera/clib/ctfunc.h +++ b/include/cantera/clib/ctfunc.h @@ -16,11 +16,11 @@ 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 double func_value(int i, double t); CANTERA_CAPI int func_derivative(int i); CANTERA_CAPI int func_duplicate(int i); CANTERA_CAPI int func_write(int i, size_t lennm, const char* arg, char* nm); + CANTERA_CAPI int ct_clearFunc(); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctmultiphase.h b/include/cantera/clib/ctmultiphase.h index daaddc724..11cf726f1 100644 --- a/include/cantera/clib/ctmultiphase.h +++ b/include/cantera/clib/ctmultiphase.h @@ -16,7 +16,7 @@ extern "C" { CANTERA_CAPI int mix_new(); CANTERA_CAPI int mix_del(int i); - CANTERA_CAPI int mix_clear(); + CANTERA_CAPI int ct_clearMix(); 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); diff --git a/include/cantera/clib/ctonedim.h b/include/cantera/clib/ctonedim.h index 77c856ed4..9dbe0d6c1 100644 --- a/include/cantera/clib/ctonedim.h +++ b/include/cantera/clib/ctonedim.h @@ -14,7 +14,7 @@ extern "C" { #endif - CANTERA_CAPI int domain_clear(); + CANTERA_CAPI int ct_clearOneDim(); CANTERA_CAPI int domain_del(int i); CANTERA_CAPI int domain_type(int i); CANTERA_CAPI size_t domain_index(int i); @@ -64,7 +64,6 @@ extern "C" { size_t m, const double* temp); CANTERA_CAPI int stflow_solveEnergyEqn(int i, int flag); - CANTERA_CAPI int sim1D_clear(); CANTERA_CAPI int sim1D_new(size_t nd, const int* domains); CANTERA_CAPI int sim1D_del(int i); CANTERA_CAPI int sim1D_setValue(int i, int dom, int comp, int localPoint, double value); diff --git a/include/cantera/clib/ctreactor.h b/include/cantera/clib/ctreactor.h index 6e2a6f16a..8fcea2b84 100644 --- a/include/cantera/clib/ctreactor.h +++ b/include/cantera/clib/ctreactor.h @@ -80,7 +80,7 @@ extern "C" { CANTERA_CAPI int reactorsurface_setArea(int i, double v); CANTERA_CAPI int reactorsurface_addSensitivityReaction(int i, int rxn); - CANTERA_CAPI int clear_reactors(); + CANTERA_CAPI int ct_clearReactors(); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctrpath.h b/include/cantera/clib/ctrpath.h index 8e44c664a..eab9137f9 100644 --- a/include/cantera/clib/ctrpath.h +++ b/include/cantera/clib/ctrpath.h @@ -42,7 +42,7 @@ extern "C" { CANTERA_CAPI int rbuild_build(int i, int k, const char* el, const char* dotfile, int idiag, int iquiet); - CANTERA_CAPI int clear_rxnpath(); + CANTERA_CAPI int ct_clearReactionPath(); #ifdef __cplusplus } diff --git a/include/cantera/clib/ctxml.h b/include/cantera/clib/ctxml.h index 5b4e11c80..a00fac349 100644 --- a/include/cantera/clib/ctxml.h +++ b/include/cantera/clib/ctxml.h @@ -17,7 +17,6 @@ extern "C" { CANTERA_CAPI int xml_new(const char* name); CANTERA_CAPI int xml_get_XML_File(const char* file, int debug); CANTERA_CAPI int xml_del(int i); - 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_attrib(int i, const char* key, size_t lenval, char* value); @@ -34,6 +33,7 @@ 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 ct_clearXML(); #ifdef __cplusplus } diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index 8affdc6ff..8ee3c5ed9 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -1389,7 +1389,7 @@ extern "C" { } } - int getCanteraError(int buflen, char* buf) + int ct_getCanteraError(int buflen, char* buf) { try { string e = Application::Instance()->lastErrorMessage(); @@ -1400,7 +1400,7 @@ extern "C" { } } - int addCanteraDirectory(size_t buflen, const char* buf) + int ct_addCanteraDirectory(size_t buflen, const char* buf) { try { addDirectory(buf); @@ -1419,7 +1419,7 @@ extern "C" { } } - int setLogWriter(void* logger) + int ct_setLogWriter(void* logger) { try { Logger* logwriter = (Logger*)logger; @@ -1430,7 +1430,7 @@ extern "C" { } } - int clearStorage() + int ct_clearStorage() { try { ThermoCabinet::clear(); @@ -1472,7 +1472,7 @@ extern "C" { } } - int ck_to_cti(const char* in_file, const char* db_file, const char* tr_file, + int ct_ck2cti(const char* in_file, const char* db_file, const char* tr_file, const char* id_tag, int debug, int validate) { try { diff --git a/src/clib/ctfunc.cpp b/src/clib/ctfunc.cpp index 4da835ad7..de1678d47 100644 --- a/src/clib/ctfunc.cpp +++ b/src/clib/ctfunc.cpp @@ -111,7 +111,7 @@ extern "C" { } } - int func_clear() + int ct_clearFunc() { try { FuncCabinet::clear(); diff --git a/src/clib/ctmultiphase.cpp b/src/clib/ctmultiphase.cpp index 5047fb812..098e79567 100644 --- a/src/clib/ctmultiphase.cpp +++ b/src/clib/ctmultiphase.cpp @@ -40,7 +40,7 @@ extern "C" { } } - int mix_clear() + int ct_clearMix() { try { mixCabinet::clear(); diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index 98d1dccd5..f868e1dfa 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -31,10 +31,11 @@ typedef Cabinet TransportCabinet; extern "C" { - int domain_clear() + int ct_clearOneDim() { try { DomainCabinet::clear(); + SimCabinet::clear(); return 0; } catch (...) { return handleAllExceptions(-1, ERR); @@ -472,16 +473,6 @@ extern "C" { } } - int sim1D_clear() - { - try { - SimCabinet::clear(); - return 0; - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - int sim1D_del(int i) { try { diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index e70cf8510..bd9df570e 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -670,7 +670,7 @@ extern "C" { } } - int clear_reactors() + int ct_clearReactors() { try { ReactorCabinet::clear(); diff --git a/src/clib/ctrpath.cpp b/src/clib/ctrpath.cpp index 9a980828b..d47c68806 100644 --- a/src/clib/ctrpath.cpp +++ b/src/clib/ctrpath.cpp @@ -303,7 +303,7 @@ extern "C" { } } - int clear_rxnpath() + int ct_clearReactionPath() { try { DiagramCabinet::clear(); diff --git a/src/clib/ctxml.cpp b/src/clib/ctxml.cpp index bc9d15794..9812cd7ab 100644 --- a/src/clib/ctxml.cpp +++ b/src/clib/ctxml.cpp @@ -48,7 +48,7 @@ extern "C" { } } - int xml_clear() + int ct_clearXML() { try { XmlCabinet::clear(); diff --git a/src/matlab/ctfunctions.cpp b/src/matlab/ctfunctions.cpp index 5488cb44c..598fbc1cc 100644 --- a/src/matlab/ctfunctions.cpp +++ b/src/matlab/ctfunctions.cpp @@ -23,9 +23,9 @@ void reportError() { int buflen = 0; char* output_buf = 0; - buflen = getCanteraError(buflen, output_buf) + 1; + buflen = ct_getCanteraError(buflen, output_buf) + 1; output_buf = (char*)mxCalloc(buflen, sizeof(char)); - getCanteraError(buflen, output_buf); + ct_getCanteraError(buflen, output_buf); mexErrMsgTxt(output_buf); } @@ -51,14 +51,14 @@ void ctfunctions(int nlhs, mxArray* plhs[], idtag = getString(prhs[5]); dbg = getInt(prhs[6]); validate = getInt(prhs[7]); - iok = ck_to_cti(infile, dbfile, trfile, idtag, dbg, validate); + iok = ct_ck2cti(infile, dbfile, trfile, idtag, dbg, validate); break; // get Cantera error case 2: - buflen = getCanteraError(buflen, output_buf) + 1; + buflen = ct_getCanteraError(buflen, output_buf) + 1; output_buf = (char*)mxCalloc(buflen, sizeof(char)); - iok = getCanteraError(buflen, output_buf); + iok = ct_getCanteraError(buflen, output_buf); plhs[0] = mxCreateString(output_buf); iok = 0; return; @@ -66,19 +66,18 @@ void ctfunctions(int nlhs, mxArray* plhs[], // add directory case 3: infile = getString(prhs[2]); - iok = addCanteraDirectory(strlen(infile), infile); + iok = ct_addCanteraDirectory(strlen(infile), infile); break; // clear storage case 4: - iok = domain_clear(); - iok = sim1D_clear(); - iok = mix_clear(); - iok = xml_clear(); - iok = func_clear(); - iok = clearStorage(); - iok = clear_reactors(); - iok = clear_rxnpath(); + iok = ct_clearOneDim(); + iok = ct_clearMix(); + iok = ct_clearXML(); + iok = ct_clearFunc(); + iok = ct_clearStorage(); + iok = ct_clearReactors(); + iok = ct_clearReactionPath(); break; // get string of data directories diff --git a/src/matlab/ctmethods.cpp b/src/matlab/ctmethods.cpp index a85278414..0dfa20d7e 100644 --- a/src/matlab/ctmethods.cpp +++ b/src/matlab/ctmethods.cpp @@ -86,7 +86,7 @@ void initLogger() if (!_logger) { _logger = new Cantera::ML_Logger; // Call the DLL program to set the logger - setLogWriter(_logger); + ct_setLogWriter(_logger); } }