Skip to content

Commit

Permalink
[clib] Remove deprecated stflow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Aug 10, 2024
1 parent 023956d commit e7b41f1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 103 deletions.
10 changes: 0 additions & 10 deletions include/cantera/clib/ctonedim.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
71 changes: 0 additions & 71 deletions src/clib/ctonedim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 0 additions & 22 deletions test/clib/test_ctonedim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit e7b41f1

Please sign in to comment.