From d5e53d24c66950d56d589393498c3281a248aaf5 Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Fri, 14 Jun 2024 16:26:10 +0200 Subject: [PATCH] Update version and add point data warnings --- CMakeLists.txt | 19 +++++++------ README.md | 2 +- examples/GDSReader/CMakeLists.txt | 2 +- examples/KDTreeBenchmark/CMakeLists.txt | 2 +- examples/TEOSTrenchDeposition/CMakeLists.txt | 4 +-- examples/cantileverWetEtching/CMakeLists.txt | 2 +- examples/exampleProcess/CMakeLists.txt | 2 +- examples/holeEtching/CMakeLists.txt | 2 +- examples/interpolationDemo/CMakeLists.txt | 2 +- examples/oxideRegrowth/CMakeLists.txt | 2 +- examples/selectiveEpitaxy/CMakeLists.txt | 2 +- examples/stackEtching/CMakeLists.txt | 2 +- examples/trenchDeposition/CMakeLists.txt | 2 +- .../trenchDepositionGeometric/CMakeLists.txt | 2 +- examples/volumeModel/CMakeLists.txt | 2 +- include/viennaps/psDomain.hpp | 9 +++--- include/viennaps/psProcess.hpp | 2 +- .../psSurfacePointValuesToLevelSet.hpp | 19 ++++++------- pyproject.toml | 1 - python/__init__.py.in | 1 - python/pyWrap.cpp | 28 +++++++++++++++++++ 21 files changed, 67 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb5d73b..236c41a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR) project( ViennaPS LANGUAGES CXX C - VERSION 2.0.2) + VERSION 3.0.0) # -------------------------------------------------------------------------------------------------------- # Library switches @@ -95,19 +95,20 @@ target_include_directories( include("cmake/cpm.cmake") CPMAddPackage( - NAME PackageProject - VERSION 1.11.2 - GIT_REPOSITORY "https://github.com/TheLartians/PackageProject.cmake") - -CPMFindPackage( NAME ViennaCore - GIT_TAG main + GIT_TAG v1.0.0 GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore" + OPTIONS "VIENNACORE_FORMAT_EXCLUDE docs/" EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}) +CPMAddPackage( + NAME PackageProject + VERSION 1.11.2 + GIT_REPOSITORY "https://github.com/TheLartians/PackageProject.cmake") + CPMFindPackage( NAME ViennaRay - GIT_TAG viennacore + GIT_TAG v3.0.0 GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay" EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}) @@ -176,4 +177,4 @@ packageProject( INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include/viennaps INCLUDE_DESTINATION include/viennaps-${PROJECT_VERSION} COMPATIBILITY SameMajorVersion - DEPENDENCIES "ViennaCS;ViennaLS;ViennaRay") + DEPENDENCIES "ViennaCore;ViennaCS;ViennaLS;ViennaRay") diff --git a/README.md b/README.md index c786f85..36d4d78 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ We recommend using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to consum * Installation with CPM ```cmake - CPMAddPackage("gh:viennatools/viennaps@2.0.0") + CPMAddPackage("gh:viennatools/viennaps@3.0.0") ``` * With a local installation diff --git a/examples/GDSReader/CMakeLists.txt b/examples/GDSReader/CMakeLists.txt index 10044e8..b6a411d 100644 --- a/examples/GDSReader/CMakeLists.txt +++ b/examples/GDSReader/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(GDSReader.py ${CMAKE_CURRENT_BINARY_DIR}/GDSReader.py COPYONLY) configure_file(mask.gds ${CMAKE_CURRENT_BINARY_DIR}/mask.gds COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/KDTreeBenchmark/CMakeLists.txt b/examples/KDTreeBenchmark/CMakeLists.txt index 148f092..eedbf9d 100644 --- a/examples/KDTreeBenchmark/CMakeLists.txt +++ b/examples/KDTreeBenchmark/CMakeLists.txt @@ -4,4 +4,4 @@ add_executable(${PROJECT_NAME} "${PROJECT_NAME}.cpp") target_link_libraries(${PROJECT_NAME} PRIVATE ViennaPS) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/TEOSTrenchDeposition/CMakeLists.txt b/examples/TEOSTrenchDeposition/CMakeLists.txt index 426732d..98c0522 100644 --- a/examples/TEOSTrenchDeposition/CMakeLists.txt +++ b/examples/TEOSTrenchDeposition/CMakeLists.txt @@ -7,7 +7,7 @@ configure_file(singleTEOS.py ${CMAKE_CURRENT_BINARY_DIR}/singleTEOS.py COPYONLY) configure_file(singleTEOS_config.txt ${CMAKE_CURRENT_BINARY_DIR}/singleTEOS_config.txt COPYONLY) add_dependencies(ViennaPS_Examples singleTEOS) -viennacore_setup_bat(singleTEOS ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(singleTEOS ${CMAKE_CURRENT_BINARY_DIR}) add_executable(multiTEOS "multiTEOS.cpp") target_link_libraries(multiTEOS PRIVATE ViennaPS) @@ -16,4 +16,4 @@ configure_file(multiTEOS.py ${CMAKE_CURRENT_BINARY_DIR}/multiTEOS.py COPYONLY) configure_file(multiTEOS_config.txt ${CMAKE_CURRENT_BINARY_DIR}/multiTEOS_config.txt COPYONLY) add_dependencies(ViennaPS_Examples multiTEOS) -viennacore_setup_bat(multiTEOS ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(multiTEOS ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/cantileverWetEtching/CMakeLists.txt b/examples/cantileverWetEtching/CMakeLists.txt index cbbe29e..db25df1 100644 --- a/examples/cantileverWetEtching/CMakeLists.txt +++ b/examples/cantileverWetEtching/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(cantileverWetEtching.py ${CMAKE_CURRENT_BINARY_DIR}/cantileverWet configure_file(cantilever_mask.gds ${CMAKE_CURRENT_BINARY_DIR}/cantilever_mask.gds COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/exampleProcess/CMakeLists.txt b/examples/exampleProcess/CMakeLists.txt index b286ba8..a65259a 100644 --- a/examples/exampleProcess/CMakeLists.txt +++ b/examples/exampleProcess/CMakeLists.txt @@ -4,4 +4,4 @@ add_executable(${PROJECT_NAME} "${PROJECT_NAME}.cpp") target_link_libraries(${PROJECT_NAME} PRIVATE ViennaPS) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/holeEtching/CMakeLists.txt b/examples/holeEtching/CMakeLists.txt index b904b52..8694b90 100644 --- a/examples/holeEtching/CMakeLists.txt +++ b/examples/holeEtching/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(holeEtching.py ${CMAKE_CURRENT_BINARY_DIR}/holeEtching.py COPYONL configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/interpolationDemo/CMakeLists.txt b/examples/interpolationDemo/CMakeLists.txt index 2993152..8790fde 100644 --- a/examples/interpolationDemo/CMakeLists.txt +++ b/examples/interpolationDemo/CMakeLists.txt @@ -8,4 +8,4 @@ configure_file(scatterdata.csv ${CMAKE_CURRENT_BINARY_DIR}/scatterdata.csv COPYO configure_file(plot.py ${CMAKE_CURRENT_BINARY_DIR}/plot.py COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/oxideRegrowth/CMakeLists.txt b/examples/oxideRegrowth/CMakeLists.txt index 57ec877..ec6bdca 100644 --- a/examples/oxideRegrowth/CMakeLists.txt +++ b/examples/oxideRegrowth/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(oxideRegrowth.py ${CMAKE_CURRENT_BINARY_DIR}/oxideRegrowth.py COP configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/selectiveEpitaxy/CMakeLists.txt b/examples/selectiveEpitaxy/CMakeLists.txt index 8680210..24e4686 100644 --- a/examples/selectiveEpitaxy/CMakeLists.txt +++ b/examples/selectiveEpitaxy/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(selectiveEpitaxy.py ${CMAKE_CURRENT_BINARY_DIR}/selectiveEpitaxy. configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/stackEtching/CMakeLists.txt b/examples/stackEtching/CMakeLists.txt index d4434fd..cb18fc0 100644 --- a/examples/stackEtching/CMakeLists.txt +++ b/examples/stackEtching/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(stackEtching.py ${CMAKE_CURRENT_BINARY_DIR}/stackEtching.py COPYO configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/trenchDeposition/CMakeLists.txt b/examples/trenchDeposition/CMakeLists.txt index 8e87b38..5bcb17d 100644 --- a/examples/trenchDeposition/CMakeLists.txt +++ b/examples/trenchDeposition/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(trenchDeposition.py ${CMAKE_CURRENT_BINARY_DIR}/trenchDeposition. configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/trenchDepositionGeometric/CMakeLists.txt b/examples/trenchDepositionGeometric/CMakeLists.txt index 21fdda5..2c2f85d 100644 --- a/examples/trenchDepositionGeometric/CMakeLists.txt +++ b/examples/trenchDepositionGeometric/CMakeLists.txt @@ -8,4 +8,4 @@ configure_file(trenchDepositionGeometric.py configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/examples/volumeModel/CMakeLists.txt b/examples/volumeModel/CMakeLists.txt index ccfc611..525f896 100644 --- a/examples/volumeModel/CMakeLists.txt +++ b/examples/volumeModel/CMakeLists.txt @@ -7,4 +7,4 @@ configure_file(volumeModel.py ${CMAKE_CURRENT_BINARY_DIR}/volumeModel.py COPYONL configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY) add_dependencies(ViennaPS_Examples ${PROJECT_NAME}) -viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_EXAMPLES_LIB}) +viennacore_setup_bat(${PROJECT_NAME} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/include/viennaps/psDomain.hpp b/include/viennaps/psDomain.hpp index 29cf097..131e69e 100644 --- a/include/viennaps/psDomain.hpp +++ b/include/viennaps/psDomain.hpp @@ -177,8 +177,9 @@ template class Domain { cellSet_ = csDomainType::New(); cellSet_->setCellSetPosition(isAboveSurface); cellSet_->setCoverMaterial(static_cast(coverMaterial)); - cellSet_->fromLevelSets(levelSets_, materialMap_->getMaterialMap(), - position); + cellSet_->fromLevelSets( + levelSets_, materialMap_ ? materialMap_->getMaterialMap() : nullptr, + position); } void setMaterialMap(materialMapType passedMaterialMap) { @@ -254,8 +255,8 @@ template class Domain { } meshConverter.apply(); - psSurfacePointValuesToLevelSet(levelSets_.back(), mesh, - {"MaterialIds"}) + SurfacePointValuesToLevelSet(levelSets_.back(), mesh, + {"MaterialIds"}) .apply(); } diff --git a/include/viennaps/psProcess.hpp b/include/viennaps/psProcess.hpp index 84b5aae..a5828f5 100644 --- a/include/viennaps/psProcess.hpp +++ b/include/viennaps/psProcess.hpp @@ -714,7 +714,7 @@ template class Process { for (const auto iter : *translator.get()) { levelSetData[iter.first] = cov->at(iter.second); } - if (auto data = topLS->getPointData().getScalarData(covName); + if (auto data = topLS->getPointData().getScalarData(covName, true); data != nullptr) { *data = std::move(levelSetData); } else { diff --git a/include/viennaps/psSurfacePointValuesToLevelSet.hpp b/include/viennaps/psSurfacePointValuesToLevelSet.hpp index 6bee2a8..fd0e9f9 100644 --- a/include/viennaps/psSurfacePointValuesToLevelSet.hpp +++ b/include/viennaps/psSurfacePointValuesToLevelSet.hpp @@ -11,7 +11,7 @@ namespace viennaps { using namespace viennacore; -template class psSurfacePointValuesToLevelSet { +template class SurfacePointValuesToLevelSet { using lsDomainType = SmartPointer>; lsDomainType levelSet; @@ -19,9 +19,9 @@ template class psSurfacePointValuesToLevelSet { std::vector dataNames; public: - psSurfacePointValuesToLevelSet() {} + SurfacePointValuesToLevelSet() {} - psSurfacePointValuesToLevelSet( + SurfacePointValuesToLevelSet( lsDomainType passedLevelSet, SmartPointer> passedMesh, std::vector passedDataNames) @@ -46,14 +46,14 @@ template class psSurfacePointValuesToLevelSet { void apply() { if (!levelSet) { Logger::getInstance() - .addWarning("No level set passed to psSurfacePointValuesToLevelSet.") + .addWarning("No level set passed to SurfacePointValuesToLevelSet.") .print(); return; } if (!mesh) { Logger::getInstance() - .addWarning("No mesh passed to psSurfacePointValuesToLevelSet.") + .addWarning("No mesh passed to SurfacePointValuesToLevelSet.") .print(); return; } @@ -84,13 +84,10 @@ template class psSurfacePointValuesToLevelSet { for (const auto dataName : dataNames) { auto pointData = mesh->getCellData().getScalarData(dataName); - if (!pointData) { - Logger::getInstance() - .addWarning("Could not find " + dataName + " in mesh values.") - .print(); + if (!pointData) continue; - } - auto data = levelSet->getPointData().getScalarData(dataName); + + auto data = levelSet->getPointData().getScalarData(dataName, true); if (data != nullptr) { data->resize(levelSet->getNumberOfPoints()); } else { diff --git a/pyproject.toml b/pyproject.toml index 7f5e95c..cd7558a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ readme = "README.md" license = {file = "LICENSE"} description = "Semiconductor fabrication process simulation library" # dependencies = ['vtk >= 9.0.0, < 10'] -dependencies = ['ViennaCore_Python >= 0.0.1'] [project.urls] Homepage = "https://viennatools.github.io/ViennaPS/" diff --git a/python/__init__.py.in b/python/__init__.py.in index b232b74..8110c96 100644 --- a/python/__init__.py.in +++ b/python/__init__.py.in @@ -28,7 +28,6 @@ if sys.platform == "win32": _windows_dll_path() from .@NAME@ import * -import viennacore as core # Config file reader helper function def ReadConfigFile(fileName: str): diff --git a/python/pyWrap.cpp b/python/pyWrap.cpp index f9c28e8..005565b 100644 --- a/python/pyWrap.cpp +++ b/python/pyWrap.cpp @@ -63,6 +63,7 @@ #include #include #include +#include using namespace viennaps; @@ -308,6 +309,33 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { // set dimension module.attr("D") = D; + // Logger + pybind11::enum_(module, "LogLevel", pybind11::module_local()) + .value("ERROR", LogLevel::ERROR) + .value("WARNING", LogLevel::WARNING) + .value("INFO", LogLevel::INFO) + .value("TIMING", LogLevel::TIMING) + .value("INTERMEDIATE", LogLevel::INTERMEDIATE) + .value("DEBUG", LogLevel::DEBUG) + .export_values(); + + pybind11::class_>(module, "Logger", + pybind11::module_local()) + .def_static("setLogLevel", &Logger::setLogLevel) + .def_static("getLogLevel", &Logger::getLogLevel) + .def_static("getInstance", &Logger::getInstance, + pybind11::return_value_policy::reference) + .def("addDebug", &Logger::addDebug) + .def("addTiming", + (Logger & (Logger::*)(std::string, double)) & Logger::addTiming) + .def("addTiming", (Logger & (Logger::*)(std::string, double, double)) & + Logger::addTiming) + .def("addInfo", &Logger::addInfo) + .def("addWarning", &Logger::addWarning) + .def("addError", &Logger::addError, pybind11::arg("s"), + pybind11::arg("shouldAbort") = true) + .def("print", [](Logger &instance) { instance.print(std::cout); }); + /**************************************************************************** * MODEL FRAMEWORK * ****************************************************************************/