Skip to content

Commit

Permalink
Expose the mix_VLE_Tx routine to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhbell committed Feb 4, 2022
1 parent e0f556e commit 50b61af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions interface/pybind11_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ void init_teqp(py::module& m) {
.def_readwrite("integration_order", &TVLEOptions::integration_order)
;

py::enum_<VLE_return_code>(m, "VLE_return_code")
.value("unset", VLE_return_code::unset)
.value("xtol_satisfied", VLE_return_code::xtol_satisfied)
.value("functol_satisfied", VLE_return_code::functol_satisfied)
.value("maxiter_met", VLE_return_code::maxiter_met)
;

// Some functions for timing overhead of interface
m.def("___mysummer", [](const double &c, const Eigen::ArrayXd &x) { return c*x.sum(); });
using RAX = Eigen::Ref<Eigen::ArrayXd>;
Expand Down
1 change: 1 addition & 0 deletions interface/pybind11_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void add_derivatives(py::module &m, Wrapper &cls) {

m.def("extrapolate_from_critical", &extrapolate_from_critical<Model, double>);
m.def("pure_VLE_T", &pure_VLE_T<Model, double>);
m.def("mix_VLE_Tx", &mix_VLE_Tx<Model, double, Eigen::ArrayXd>);
m.def("get_drhovecdp_Tsat", &get_drhovecdp_Tsat<Model, double, RAX>, py::arg("model"), py::arg("T"), py::arg("rhovecL").noconvert(), py::arg("rhovecV").noconvert());
m.def("trace_VLE_isotherm_binary", &trace_VLE_isotherm_binary<Model, double, Eigen::ArrayXd>, py::arg("model"), py::arg("T"), py::arg("rhovecL0").noconvert(), py::arg("rhovecV0").noconvert(), py::arg_v("options", std::nullopt, "None"));

Expand Down

0 comments on commit 50b61af

Please sign in to comment.