Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63670156
pypart_pybind.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, May 21, 18:08
Size
1 KB
Mime Type
text/x-c
Expires
Thu, May 23, 18:08 (2 d)
Engine
blob
Format
Raw Data
Handle
17804611
Attached To
R7571 SP4E-TB-TL-FR
pypart_pybind.cpp
View Options
#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
Log In to Comment