diff --git a/work/week14/particle-pybind/starting_point/pypart_pybind.cpp b/work/week14/particle-pybind/starting_point/pypart_pybind.cpp index e5b0521..1d04bbe 100644 --- a/work/week14/particle-pybind/starting_point/pypart_pybind.cpp +++ b/work/week14/particle-pybind/starting_point/pypart_pybind.cpp @@ -1,48 +1,77 @@ #include #include #include #include "my_types.hh" +#include "system_evolution.cc" +#include "system.cc" #include "csv_writer.cc" #include "particles_factory_interface.cc" #include "ping_pong_balls_factory.cc" #include "material_points_factory.cc" #include "planets_factory.cc" #include "compute_temperature.cc" namespace py = pybind11; PYBIND11_MODULE(pypart, m) { +// Wrap the SystemEvolution class +py::class_(m, "System") + .def(py::init<>()) // constructor + ; + +// Wrap the SystemEvolution class +py::class_(m, "SystemEvolution") + // .def(py::init>(), + // py::arg("system") = system) // with a default) // constructor + ; + // Wrap the ParticlesFactoryInterface class - py::class_(m, "ParticlesFactoryInterface") +py::class_(m, "ParticlesFactoryInterface") // .def(py::init<>()) // constructor .def("getInstance", &ParticlesFactoryInterface::getInstance) // getInstance method + .def("createSimulation",(&ParticlesFactoryInterface::createSimulation)) // overloading with int + ; + +// Wrap the PlanetsFactory class +py::class_(m, "MaterialPointsFactory") + // .def(py::init<>()) // constructor + .def("getInstance", &PlanetsFactory::getInstance) // getInstance method + + .def("createSimulation", &PlanetsFactory::createSimulation) // overloading with int + ; + +// Wrap the PingPongBallsFactory class +py::class_(m, "MaterialPointsFactory") + // .def(py::init<>()) // constructor + .def("getInstance", &PingPongBallsFactory::getInstance) // getInstance method + + .def("createSimulation", &PingPongBallsFactory::createSimulation) // overloading with int ; // Wrap the MaterialPointsFactory class - py::class_(m, "MaterialPointsFactory") +py::class_(m, "MaterialPointsFactory") // .def(py::init<>()) // constructor .def("getInstance", &MaterialPointsFactory::getInstance) // getInstance method - .def("createSimulation", - py::overload_cast(&MaterialPointsFactory::createSimulation)) // overloading with int // .def("createSimulation", - // py::overload_cast( - // &MaterialPointsFactory::createSimulation, py::const_)) // overloading with const + // py::overload_cast(&MaterialPointsFactory::createSimulation)) // overloading with int + .def("createSimulation", + py::overload_cast(&MaterialPointsFactory::createSimulation)) // overloading with const ; // //Make a shared Compute Method // py::class_>(m, "Compute"); // //Creates the ComputeTemeprature class and its functions // py::class_(m, "ComputeTemperature") // .def(py::init<>()) // constructor) // .def("getConductivity", &ComputeTemperature::getConductivity) // method only in Dog; // .def("getCapacity", &ComputeTemperature::getCapacity) // .def("getDensity", &ComputeTemperature::getDensity) // .def("getL", &ComputeTemperature::getL) // .def("getDeltat", &ComputeTemperature::getDeltat); }