From e7b41f153bc88729a43daf65dfacd39b58aa4d9c Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Thu, 8 Aug 2024 11:46:43 -0500 Subject: [PATCH] [clib] Remove deprecated stflow functions --- include/cantera/clib/ctonedim.h | 10 ----- src/clib/ctonedim.cpp | 71 --------------------------------- test/clib/test_ctonedim.cpp | 22 ---------- 3 files changed, 103 deletions(-) diff --git a/include/cantera/clib/ctonedim.h b/include/cantera/clib/ctonedim.h index f198088fece..01daf79a1f6 100644 --- a/include/cantera/clib/ctonedim.h +++ b/include/cantera/clib/ctonedim.h @@ -67,16 +67,6 @@ extern "C" { size_t m, const double* temp); CANTERA_CAPI int flow1D_solveEnergyEqn(int i, int flag); - //! @todo: Remove all functions with `stflow` prefix after %Cantera 3.1 - CANTERA_CAPI int stflow_new(int iph, int ikin, int itr, int itype); - CANTERA_CAPI int stflow_setTransport(int i, int itr); - CANTERA_CAPI int stflow_enableSoret(int i, int iSoret); - CANTERA_CAPI int stflow_setPressure(int i, double p); - CANTERA_CAPI double stflow_pressure(int i); - CANTERA_CAPI int stflow_setFixedTempProfile(int i, size_t n, const double* pos, - size_t m, const double* temp); - CANTERA_CAPI int stflow_solveEnergyEqn(int i, int flag); - 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/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index ee55c77408d..b460950510b 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -490,77 +490,6 @@ extern "C" { } } - int stflow_new(int iph, int ikin, int itr, int itype) - { - try { - throw NotImplementedError("stflow_new", - "Function replaced by 'flow1D_new'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int stflow_setTransport(int i, int itr) - { - try { - throw NotImplementedError("stflow_setTransport", - "Function replaced by 'flow1D_setTransport'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int stflow_enableSoret(int i, int iSoret) - { - try { - throw NotImplementedError("stflow_enableSoret", - "Function replaced by 'flow1D_enableSoret'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int stflow_setPressure(int i, double p) - { - try { - throw NotImplementedError("stflow_setPressure", - "Function replaced by 'flow1D_setPressure'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - double stflow_pressure(int i) - { - try { - throw NotImplementedError("stflow_pressure", - "Function replaced by 'flow1D_pressure'."); - } catch (...) { - return handleAllExceptions(DERR, DERR); - } - } - - int stflow_setFixedTempProfile(int i, size_t n, const double* pos, - size_t m, const double* temp) - { - try { - throw NotImplementedError("stflow_setFixedTempProfile", - "Function replaced by 'flow1D_setFixedTempProfile'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - - int stflow_solveEnergyEqn(int i, int flag) - { - try { - throw NotImplementedError("stflow_solveEnergyEqn", - "Function replaced by 'flow1D_solveEnergyEqn'."); - } catch (...) { - return handleAllExceptions(-1, ERR); - } - } - //------------------- Sim1D -------------------------------------- int sim1D_new(size_t nd, const int* domains) diff --git a/test/clib/test_ctonedim.cpp b/test/clib/test_ctonedim.cpp index 24407c6e588..7d327cd374a 100644 --- a/test/clib/test_ctonedim.cpp +++ b/test/clib/test_ctonedim.cpp @@ -254,25 +254,3 @@ TEST(ctonedim, freeflame_from_parts) Tprev = T; } } - -TEST(ctonedim, stflow_tests) -{ - //! @todo: To be removed after Cantera 3.1 - ct_resetStorage(); - auto gas = newThermo("h2o2.yaml", "ohmech"); - - int sol = soln_newSolution("h2o2.yaml", "ohmech", "default"); - int ph = soln_thermo(sol); - int kin = soln_kinetics(sol); - int tr = soln_transport(sol); - - // spot check some errors - int itype = 2; // free flow - int ret = stflow_new(ph, kin, tr, itype); - ASSERT_EQ(ret, -1); // -1 is an error code - - int flow = flow1D_new(ph, kin, tr, itype); - ASSERT_EQ(stflow_setTransport(flow, tr), -1); - ASSERT_EQ(stflow_pressure(flow), DERR); // DERR is an error code - ASSERT_EQ(stflow_setPressure(flow, OneAtm), -1); -}