Skip to content

Commit

Permalink
[C API] Add interface to the new PureFluid property pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Jan 22, 2016
1 parent 59a1152 commit f85c5ed
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
70 changes: 70 additions & 0 deletions src/clib/ct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,76 @@ extern "C" {
}
}

int th_set_ST(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_ST(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_TV(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_TV(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_PV(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_PV(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_UP(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_UP(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_VH(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_VH(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_TH(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_TH(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_set_SH(int n, double* vals)
{
try {
ThermoCabinet::item(n).setState_SH(vals[0],vals[1]);
return 0;
} catch (...) {
return handleAllExceptions(-1, ERR);
}
}

int th_equil(int n, char* XY, int solver,
double rtol, int maxsteps, int maxiter, int loglevel)
{
Expand Down
7 changes: 7 additions & 0 deletions src/clib/ct.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ extern "C" {
CANTERA_CAPI int th_set_UV(int n, double* vals);
CANTERA_CAPI int th_set_SV(int n, double* vals);
CANTERA_CAPI int th_set_SP(int n, double* vals);
CANTERA_CAPI int th_set_ST(int n, double* vals);
CANTERA_CAPI int th_set_TV(int n, double* vals);
CANTERA_CAPI int th_set_PV(int n, double* vals);
CANTERA_CAPI int th_set_UP(int n, double* vals);
CANTERA_CAPI int th_set_VH(int n, double* vals);
CANTERA_CAPI int th_set_TH(int n, double* vals);
CANTERA_CAPI int th_set_SH(int n, double* vals);
CANTERA_CAPI int th_equil(int n, char* XY, int solver,
double rtol, int maxsteps, int maxiter, int loglevel);

Expand Down

0 comments on commit f85c5ed

Please sign in to comment.