Skip to content
Snippets Groups Projects
Commit 50b61af0 authored by Ian Bell's avatar Ian Bell
Browse files

Expose the mix_VLE_Tx routine to Python

parent e0f556ec
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,13 @@ void init_teqp(py::module& m) { ...@@ -53,6 +53,13 @@ void init_teqp(py::module& m) {
.def_readwrite("integration_order", &TVLEOptions::integration_order) .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 // Some functions for timing overhead of interface
m.def("___mysummer", [](const double &c, const Eigen::ArrayXd &x) { return c*x.sum(); }); m.def("___mysummer", [](const double &c, const Eigen::ArrayXd &x) { return c*x.sum(); });
using RAX = Eigen::Ref<Eigen::ArrayXd>; using RAX = Eigen::Ref<Eigen::ArrayXd>;
......
...@@ -53,6 +53,7 @@ void add_derivatives(py::module &m, Wrapper &cls) { ...@@ -53,6 +53,7 @@ void add_derivatives(py::module &m, Wrapper &cls) {
m.def("extrapolate_from_critical", &extrapolate_from_critical<Model, double>); m.def("extrapolate_from_critical", &extrapolate_from_critical<Model, double>);
m.def("pure_VLE_T", &pure_VLE_T<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("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")); 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"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment