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

Some docs for the mutant wrapping

parent 4951e95a
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,24 @@
void add_multifluid_mutant(py::module& m) {
// A typedef for the base model
using MultiFluid = decltype(build_multifluid_model(std::vector<std::string>{"", ""}, "", ""));
{
m.def("build_multifluid_mutant", &build_multifluid_mutant<MultiFluid>);
using RedType = std::decay_t<decltype(MultiFluid::redfunc)>;
using DepType = std::decay_t<decltype(MultiFluid::dep)>;
using BIPmod = std::decay_t<MultiFluidAdapter<RedType, DepType, MultiFluid>>;
auto wMFBIP = py::class_<BIPmod>(m, "MultiFluidMutant")
.def("set_meta", [](BIPmod& c, const std::string &s) { return c.set_meta(s); })
.def("get_meta", [](const BIPmod& c) { return c.get_meta(); })
;
add_derivatives<BIPmod>(m, wMFBIP);
}
// Wrap the function for generating a multifluid mutant
m.def("build_multifluid_mutant", &build_multifluid_mutant<MultiFluid>);
// The reducing function type and the departure function types are the same
// as the base model
using RedType = std::decay_t<decltype(MultiFluid::redfunc)>;
using DepType = std::decay_t<decltype(MultiFluid::dep)>;
// Typedef for modified mutant type
using BIPmod = std::decay_t<MultiFluidAdapter<RedType, DepType, MultiFluid>>;
// Define python wrapper of the mutant class
auto wMFBIP = py::class_<BIPmod>(m, "MultiFluidMutant")
.def("set_meta", [](BIPmod& c, const std::string &s) { return c.set_meta(s); })
.def("get_meta", [](const BIPmod& c) { return c.get_meta(); })
;
add_derivatives<BIPmod>(m, wMFBIP);
}
\ No newline at end of file
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