From 8b54e51cb1c493f433d87772eea8ea9f2929e853 Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Wed, 30 Oct 2024 10:22:47 +0100 Subject: [PATCH] Remove smart pointer holders for geometry builders --- python/pyWrap.cpp | 88 +++++++++++------------------------------------ 1 file changed, 20 insertions(+), 68 deletions(-) diff --git a/python/pyWrap.cpp b/python/pyWrap.cpp index 05a47f6..c9194ff 100644 --- a/python/pyWrap.cpp +++ b/python/pyWrap.cpp @@ -939,44 +939,25 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { // *************************************************************************** // MakePlane - pybind11::class_, SmartPointer>>(module, - "MakePlane") - .def(pybind11::init([](DomainType Domain, const T GridDelta, - const T XExtent, const T YExtent, const T Height, - const bool Periodic, const Material Material) { - return SmartPointer>::New(Domain, GridDelta, - XExtent, YExtent, Height, - Periodic, Material); - }), + pybind11::class_>(module, "MakePlane") + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("gridDelta"), pybind11::arg("xExtent"), pybind11::arg("yExtent"), pybind11::arg("height") = 0., pybind11::arg("periodicBoundary") = false, pybind11::arg("material") = Material::None) - .def(pybind11::init( - [](DomainType Domain, T Height, const Material Material) { - return SmartPointer>::New(Domain, Height, - Material); - }), + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("height") = 0., pybind11::arg("material") = Material::None) .def("apply", &MakePlane::apply, "Create a plane geometry or add plane to existing geometry."); // MakeTrench - pybind11::class_, SmartPointer>>( - module, "MakeTrench") - .def(pybind11::init([](DomainType Domain, const T GridDelta, - const T XExtent, const T YExtent, - const T TrenchWidth, const T TrenchDepth, - const T TaperingAngle, const T BaseHeight, - const bool PeriodicBoundary, const bool MakeMask, - const Material Material) { - return SmartPointer>::New( - Domain, GridDelta, XExtent, YExtent, TrenchWidth, TrenchDepth, - TaperingAngle, BaseHeight, PeriodicBoundary, MakeMask, - Material); - }), + pybind11::class_>(module, "MakeTrench") + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("gridDelta"), pybind11::arg("xExtent"), pybind11::arg("yExtent"), pybind11::arg("trenchWidth"), pybind11::arg("trenchDepth"), @@ -988,19 +969,10 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { .def("apply", &MakeTrench::apply, "Create a trench geometry."); // MakeHole - pybind11::class_, SmartPointer>>(module, - "MakeHole") - .def(pybind11::init([](DomainType domain, const T GridDelta, - const T xExtent, const T yExtent, - const T HoleRadius, const T HoleDepth, - const T TaperingAngle, const T BaseHeight, - const bool PeriodicBoundary, const bool MakeMask, - const Material material) { - return SmartPointer>::New( - domain, GridDelta, xExtent, yExtent, HoleRadius, HoleDepth, - TaperingAngle, BaseHeight, PeriodicBoundary, MakeMask, - material); - }), + pybind11::class_>(module, "MakeHole") + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("gridDelta"), pybind11::arg("xExtent"), pybind11::arg("yExtent"), pybind11::arg("holeRadius"), pybind11::arg("holeDepth"), @@ -1012,17 +984,10 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { .def("apply", &MakeHole::apply, "Create a hole geometry."); // MakeFin - pybind11::class_, SmartPointer>>(module, - "MakeFin") - .def(pybind11::init([](DomainType domain, const T gridDelta, - const T xExtent, const T yExtent, const T finWidth, - const T finHeight, const T taperAngle, - const T baseHeight, const bool periodicBoundary, - const bool makeMask, const Material material) { - return SmartPointer>::New( - domain, gridDelta, xExtent, yExtent, finWidth, finHeight, - taperAngle, baseHeight, periodicBoundary, makeMask, material); - }), + pybind11::class_>(module, "MakeFin") + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("gridDelta"), pybind11::arg("xExtent"), pybind11::arg("yExtent"), pybind11::arg("finWidth"), pybind11::arg("finHeight"), @@ -1033,23 +998,10 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { .def("apply", &MakeFin::apply, "Create a fin geometry."); // MakeStack - pybind11::class_, SmartPointer>>(module, - "MakeStack") - .def(pybind11::init(&SmartPointer>::New< - DomainType &, const T /*gridDelta*/, - const T - /*xExtent*/, - const T /*yExtent*/, - const int - /*numLayers*/, - const T /*layerHeight*/, - const T - /*substrateHeight*/, - const T /*holeRadius*/, - const T - /*trenchWidth*/, - const T /*maskHeight*/, const bool - /*PeriodicBoundary*/>), + pybind11::class_>(module, "MakeStack") + .def(pybind11::init(), pybind11::arg("domain"), pybind11::arg("gridDelta"), pybind11::arg("xExtent"), pybind11::arg("yExtent"), pybind11::arg("numLayers"), pybind11::arg("layerHeight"),