diff --git a/exercice_4/src/pypart_pybind.cc b/exercice_4/src/pypart_pybind.cc index 00285b3..71653ec 100644 --- a/exercice_4/src/pypart_pybind.cc +++ b/exercice_4/src/pypart_pybind.cc @@ -1,38 +1,51 @@ #include "material_points_factory.hh" #include "particles_factory_interface.hh" #include "ping_pong_balls_factory.hh" #include "planets_factory.hh" -//#include "compute_temperatures.hh" +#include "compute_temperature.hh" #include namespace py = pybind11; PYBIND11_MODULE(pypart, m) { m.doc() = "pybind for particles code"; py::class_(m, "ParticlesFactoryInterface") .def("getInstance", &ParticlesFactoryInterface::getInstance) .def("createSimulation", &ParticlesFactoryInterface::createSimulation); py::class_( m, "MaterialPointsFactory") .def("getInstance", &MaterialPointsFactory::getInstance) /*.def("createSimulation", py::overload_cast( &MaterialPointsFactory::createSimulation)) // no need for py::overload_cast .def("createSimulation", py::overload_cast( &MaterialPointsFactory::createSimulation)); */ .def("createSimulation", // less elegant way to do the overload cast --> forum (SystemEvolution& (MaterialPointsFactory::*)(const std::string &, Real)) & MaterialPointsFactory::createSimulation ); py::class_( m, "PingPongBallsFactory") .def("getInstance", &PingPongBallsFactory::getInstance) .def("createSimulation", &PingPongBallsFactory::createSimulation); py::class_(m, "PlanetsFactory") .def("getInstance", &PlanetsFactory::getInstance) .def("createSimulation", &PlanetsFactory::createSimulation); + + py::class_(m, "Compute"); + + py::class_(m, "ComputeTemperature") + .def("compute", &ComputeTemperature::compute) + .def_property("conductivity", &ComputeTemperature::setConductivity, + &ComputeTemperature::getConductivity) + .def_property("capacity", &ComputeTemperature::setCapacity, &ComputeTemperature::getCapacity) + .def_property("density", &ComputeTemperature::setDensity, &ComputeTemperature::getDensity) + .def_property("L", &ComputeTemperature::setL, &ComputeTemperature::getL) + .def_property("delta_t", &ComputeTemperature::setDeltat, &ComputeTemperature::getDeltat) + ; + }