Page MenuHomec4science

pypart_pybind.cpp
No OneTemporary

File Metadata

Created
Tue, May 21, 18:08

pypart_pybind.cpp

#include <functional>
#include <iostream>
#include <pybind11/pybind11.h>
#include "my_types.hh"
#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 ParticlesFactoryInterface class
py::class_<ParticlesFactoryInterface>(m, "ParticlesFactoryInterface")
// .def(py::init<>()) // constructor
.def("getInstance", &ParticlesFactoryInterface::getInstance) // getInstance method
;
// Wrap the MaterialPointsFactory class
py::class_<MaterialPointsFactory, ParticlesFactoryInterface>(m, "MaterialPointsFactory")
// .def(py::init<>()) // constructor
.def("getInstance", &MaterialPointsFactory::getInstance) // getInstance method
.def("createSimulation",
py::overload_cast<const std::string &, Real>(&MaterialPointsFactory::createSimulation)) // overloading with int
// .def("createSimulation",
// py::overload_cast<const std::string&, Real, py::function>(
// &MaterialPointsFactory::createSimulation, py::const_)) // overloading with const
;
// //Make a shared Compute Method
// py::class_<Compute, std::shared_ptr<Compute>>(m, "Compute");
// //Creates the ComputeTemeprature class and its functions
// py::class_<ComputeTemperature, Compute>(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);
}

Event Timeline