Newer
Older
Ian Bell
committed
#include "pybind11_wrapper.hpp"
Ian Bell
committed
// These are each in separate files to move the compilation into
// multiple compilation units so that multiple processors can be use
// at the same time
void add_vdW(py::module &m);
void add_PCSAFT(py::module& m);
void add_CPA(py::module& m);
void add_multifluid(py::module& m);
void add_multifluid_mutant(py::module& m);
/// Instantiate "instances" of models (really wrapped Python versions of the models), and then attach all derivative methods
void init_teqp(py::module& m) {
Ian Bell
committed
add_vdW(m);
add_PCSAFT(m);
add_CPA(m);
add_multifluid(m);
add_multifluid_mutant(m);
// 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>;
using namespace pybind11::literals; // for "arg"_a
m.def("___mysummerref", [](const double& c, const RAX x) { return c * x.sum(); }, "c"_a, "x"_a.noconvert());
m.def("___myadder", [](const double& c, const double& d) { return c+d; });