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 @@ ...@@ -5,16 +5,24 @@
void add_multifluid_mutant(py::module& m) { void add_multifluid_mutant(py::module& m) {
// A typedef for the base model
using MultiFluid = decltype(build_multifluid_model(std::vector<std::string>{"", ""}, "", "")); using MultiFluid = decltype(build_multifluid_model(std::vector<std::string>{"", ""}, "", ""));
{
m.def("build_multifluid_mutant", &build_multifluid_mutant<MultiFluid>); // Wrap the function for generating a multifluid mutant
using RedType = std::decay_t<decltype(MultiFluid::redfunc)>; m.def("build_multifluid_mutant", &build_multifluid_mutant<MultiFluid>);
using DepType = std::decay_t<decltype(MultiFluid::dep)>;
using BIPmod = std::decay_t<MultiFluidAdapter<RedType, DepType, MultiFluid>>; // The reducing function type and the departure function types are the same
auto wMFBIP = py::class_<BIPmod>(m, "MultiFluidMutant") // as the base model
.def("set_meta", [](BIPmod& c, const std::string &s) { return c.set_meta(s); }) using RedType = std::decay_t<decltype(MultiFluid::redfunc)>;
.def("get_meta", [](const BIPmod& c) { return c.get_meta(); }) using DepType = std::decay_t<decltype(MultiFluid::dep)>;
;
add_derivatives<BIPmod>(m, wMFBIP); // 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