From 52c2f6da8c39737196aa3a1a33a92b796978090e Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Wed, 30 Oct 2024 15:20:05 +0100 Subject: [PATCH] Small fixes in Python wrapper --- python/pyWrap.cpp | 49 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/python/pyWrap.cpp b/python/pyWrap.cpp index c9194ff..cb7b6b3 100644 --- a/python/pyWrap.cpp +++ b/python/pyWrap.cpp @@ -938,7 +938,7 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { // GEOMETRIES // *************************************************************************** - // MakePlane + // Plane pybind11::class_>(module, "MakePlane") .def(pybind11::init(), @@ -953,7 +953,7 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { .def("apply", &MakePlane::apply, "Create a plane geometry or add plane to existing geometry."); - // MakeTrench + // Trench pybind11::class_>(module, "MakeTrench") .def(pybind11::init::apply, "Create a trench geometry."); - // MakeHole + // Hole pybind11::class_>(module, "MakeHole") .def(pybind11::init::apply, "Create a hole geometry."); - // MakeFin + // Fin pybind11::class_>(module, "MakeFin") .def(pybind11::init::apply, "Create a fin geometry."); - // MakeStack + // Stack pybind11::class_>(module, "MakeStack") .def(pybind11::init::setIntegrationScheme, "Set the integration scheme for solving the level-set equation. " "Possible integration schemes are specified in " - "lsIntegrationSchemeEnum.") + "viennals::IntegrationSchemeEnum.") .def("setTimeStepRatio", &Process::setTimeStepRatio, "Set the CFL condition to use during advection. The CFL condition " "sets the maximum distance a surface can be moved during one " @@ -1168,7 +1168,8 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { .def("saveVolumeMesh", &Domain::saveVolumeMesh, pybind11::arg("filename"), "Save the volume representation of the domain.") - .def("saveLevelSets", &Domain::saveLevelSets) + .def("saveLevelSets", &Domain::saveLevelSets, + pybind11::arg("filename")) .def("clear", &Domain::clear); // MaterialMap @@ -1227,12 +1228,10 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { "Calculate the mean thermal velocity of a gas molecule."); // Planarize - pybind11::class_, SmartPointer>>(module, - "Planarize") - .def(pybind11::init(&SmartPointer>::New<>)) - .def(pybind11::init( - &SmartPointer>::New), - pybind11::arg("geometry"), pybind11::arg("cutoffHeight") = 0.) + pybind11::class_>(module, "Planarize") + .def(pybind11::init()) + .def(pybind11::init(), pybind11::arg("geometry"), + pybind11::arg("cutoffHeight") = 0.) .def("setDomain", &Planarize::setDomain, "Set the domain in the planarization.") .def("setCutoffPosition", &Planarize::setCutoffPosition, @@ -1275,13 +1274,10 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { }, "Get the bounds of the geometry."); - pybind11::class_, SmartPointer>>(module, - "GDSReader") + pybind11::class_>(module, "GDSReader") // constructors - .def(pybind11::init(&SmartPointer>::New<>)) - .def(pybind11::init( - &SmartPointer>::New> &, - std::string>)) + .def(pybind11::init()) + .def(pybind11::init> &, std::string>()) // methods .def("setGeometry", &GDSReader::setGeometry, "Set the domain to be parsed in.") @@ -1297,21 +1293,24 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { // methods .def("deepCopy", &Domain::deepCopy) .def("insertNextLevelSet", &Domain::insertNextLevelSet, - pybind11::arg("levelSet"), pybind11::arg("wrapLowerLevelSet") = true, + pybind11::arg("levelset"), pybind11::arg("wrapLowerLevelSet") = true, "Insert a level set to domain.") .def("insertNextLevelSetAsMaterial", &Domain::insertNextLevelSetAsMaterial, pybind11::arg("levelSet"), pybind11::arg("material"), pybind11::arg("wrapLowerLevelSet") = true, "Insert a level set to domain as a material.") - .def("duplicateTopLevelSet", &Domain::duplicateTopLevelSet) - .def("applyBooleanOperation", &Domain::applyBooleanOperation) + .def("duplicateTopLevelSet", &Domain::duplicateTopLevelSet, + "Duplicate the top level set. Should be used before a deposition " + "process.") .def("removeTopLevelSet", &Domain::removeTopLevelSet) + .def("applyBooleanOperation", &Domain::applyBooleanOperation) + .def("removeLevelSet", &Domain::removeLevelSet) + .def("removeMaterial", &Domain::removeMaterial) .def("setMaterialMap", &Domain::setMaterialMap) .def("getMaterialMap", &Domain::getMaterialMap) .def("generateCellSet", &Domain::generateCellSet, - pybind11::arg("position"), pybind11::arg("coverMaterial"), - pybind11::arg("isAboveSurface"), "Generate the cell set.") + "Generate the cell set.") .def("getLevelSets", &Domain::getLevelSets) .def("getCellSet", &Domain::getCellSet, "Get the cell set.") .def("getGrid", &Domain::getGrid, "Get the grid") @@ -1320,7 +1319,7 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { pybind11::arg("filename"), pybind11::arg("width") = 1, "Save the level set grids of layers in the domain.") .def("saveSurfaceMesh", &Domain::saveSurfaceMesh, - pybind11::arg("filename"), pybind11::arg("addMaterialIds") = true, + pybind11::arg("filename"), pybind11::arg("addMaterialIds") = false, "Save the surface of the domain.") .def("saveVolumeMesh", &Domain::saveVolumeMesh, pybind11::arg("filename"),