Skip to content

Commit

Permalink
Update version and add point data warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Jun 14, 2024
1 parent a5f90a3 commit d5e53d2
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 42 deletions.
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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})

Expand Down Expand Up @@ -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")
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/GDSReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/KDTreeBenchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
4 changes: 2 additions & 2 deletions examples/TEOSTrenchDeposition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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})
2 changes: 1 addition & 1 deletion examples/cantileverWetEtching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/exampleProcess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/holeEtching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/interpolationDemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/oxideRegrowth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/selectiveEpitaxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/stackEtching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/trenchDeposition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/trenchDepositionGeometric/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion examples/volumeModel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
9 changes: 5 additions & 4 deletions include/viennaps/psDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ template <class NumericType, int D> class Domain {
cellSet_ = csDomainType::New();
cellSet_->setCellSetPosition(isAboveSurface);
cellSet_->setCoverMaterial(static_cast<int>(coverMaterial));
cellSet_->fromLevelSets(levelSets_, materialMap_->getMaterialMap(),
position);
cellSet_->fromLevelSets(
levelSets_, materialMap_ ? materialMap_->getMaterialMap() : nullptr,
position);
}

void setMaterialMap(materialMapType passedMaterialMap) {
Expand Down Expand Up @@ -254,8 +255,8 @@ template <class NumericType, int D> class Domain {
}
meshConverter.apply();

psSurfacePointValuesToLevelSet<NumericType, D>(levelSets_.back(), mesh,
{"MaterialIds"})
SurfacePointValuesToLevelSet<NumericType, D>(levelSets_.back(), mesh,
{"MaterialIds"})
.apply();
}

Expand Down
2 changes: 1 addition & 1 deletion include/viennaps/psProcess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ template <typename NumericType, int D> 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 {
Expand Down
19 changes: 8 additions & 11 deletions include/viennaps/psSurfacePointValuesToLevelSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ namespace viennaps {

using namespace viennacore;

template <class NumericType, int D> class psSurfacePointValuesToLevelSet {
template <class NumericType, int D> class SurfacePointValuesToLevelSet {
using lsDomainType = SmartPointer<viennals::Domain<NumericType, D>>;

lsDomainType levelSet;
SmartPointer<viennals::Mesh<NumericType>> mesh;
std::vector<std::string> dataNames;

public:
psSurfacePointValuesToLevelSet() {}
SurfacePointValuesToLevelSet() {}

psSurfacePointValuesToLevelSet(
SurfacePointValuesToLevelSet(
lsDomainType passedLevelSet,
SmartPointer<viennals::Mesh<NumericType>> passedMesh,
std::vector<std::string> passedDataNames)
Expand All @@ -46,14 +46,14 @@ template <class NumericType, int D> 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;
}
Expand Down Expand Up @@ -84,13 +84,10 @@ template <class NumericType, int D> 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 {
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
1 change: 0 additions & 1 deletion python/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
28 changes: 28 additions & 0 deletions python/pyWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include <rayParticle.hpp>
#include <rayReflection.hpp>
#include <rayUtil.hpp>
#include <vcLogger.hpp>

using namespace viennaps;

Expand Down Expand Up @@ -308,6 +309,33 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) {
// set dimension
module.attr("D") = D;

// Logger
pybind11::enum_<LogLevel>(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_<Logger, SmartPointer<Logger>>(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 *
****************************************************************************/
Expand Down

0 comments on commit d5e53d2

Please sign in to comment.