Skip to content

Commit

Permalink
Add boolean operation function in psDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Oct 31, 2023
1 parent cb2eafa commit e5f7de8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Examples/OxideRegrowth/OxideRegrowth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
domain=domain,
gridDelta=params["gridDelta"],
xExtent=params["xExtent"],
yExtent=0.0,
yExtent=params["yExtent"],
numLayers=int(params["numLayers"]),
layerHeight=params["layerHeight"],
substrateHeight=params["substrateHeight"],
Expand Down
4 changes: 4 additions & 0 deletions Python/pyWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) {
.def("insertNextLevelSetAsMaterial",
&psDomain<T, D>::insertNextLevelSetAsMaterial)
.def("duplicateTopLevelSet", &psDomain<T, D>::duplicateTopLevelSet)
.def("removeTopLevelSet", &psDomain<T, D>::removeTopLevelSet)
.def("applyBooleanOperation", &psDomain<T, D>::applyBooleanOperation)
.def("setMaterialMap", &psDomain<T, D>::setMaterialMap)
.def("getMaterialMap", &psDomain<T, D>::getMaterialMap)
.def("generateCellSet", &psDomain<T, D>::generateCellSet,
Expand Down Expand Up @@ -802,6 +804,8 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) {
.def("insertNextLevelSetAsMaterial",
&psDomain<T, 3>::insertNextLevelSetAsMaterial)
.def("duplicateTopLevelSet", &psDomain<T, 3>::duplicateTopLevelSet)
.def("applyBooleanOperation", &psDomain<T, 3>::applyBooleanOperation)
.def("removeTopLevelSet", &psDomain<T, 3>::removeTopLevelSet)
.def("setMaterialMap", &psDomain<T, 3>::setMaterialMap)
.def("getMaterialMap", &psDomain<T, 3>::getMaterialMap)
.def("generateCellSet", &psDomain<T, 3>::generateCellSet,
Expand Down
12 changes: 12 additions & 0 deletions include/psDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ template <class NumericType = float, int D = 3> class psDomain {
}
}

// Boolean Operation of all level sets in the domain with the specified LS
void applyBooleanOperation(lsDomainType levelSet,
lsBooleanOperationEnum operation) {
if (levelSets->empty()) {
return;
}

for (auto ls : *levelSets) {
lsBooleanOperation<NumericType, D>(ls, levelSet, operation).apply();
}
}

materialMapType getMaterialMap() const { return materialMap; }

void generateCellSet(const NumericType depth = 0.,
Expand Down

0 comments on commit e5f7de8

Please sign in to comment.