Skip to content

Commit

Permalink
Add Python stub files to package, hull mesh, and IBE example (#111)
Browse files Browse the repository at this point in the history
* Use updated bounding box intersector from ViennaRay

* Add python stubs to project package

* Add stubs in build process

* Bump ViennaRay

* Fix more Python stubs

* Bump version

* Format

* Add hull mesh

* Use hull mesh in examples

* Bump viennals

* Add IBE with repeposition example

* Fix particle in fcage process

* Add Python example
  • Loading branch information
tobre1 authored Feb 19, 2025
1 parent 040be83 commit 7702af0
Show file tree
Hide file tree
Showing 33 changed files with 359 additions and 107 deletions.
6 changes: 3 additions & 3 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 3.2.0)
VERSION 3.3.0)

# --------------------------------------------------------------------------------------------------------
# Library switches
Expand Down Expand Up @@ -108,13 +108,13 @@ CPMAddPackage(

CPMFindPackage(
NAME ViennaRay
VERSION 3.1.3
VERSION 3.1.4
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})

CPMFindPackage(
NAME ViennaLS
VERSION 4.1.3
VERSION 4.2.0
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaLS"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Releases are tagged on the master branch and available in the [releases section]

### Dependencies (installed automatically)

* [ViennaCore](https://github.com/ViennaTools/viennacore) >= 1.1.0
* [ViennaCore](https://github.com/ViennaTools/viennacore) >= 1.2.0

* [ViennaLS](https://github.com/ViennaTools/viennals) >= 4.1.1
* [ViennaHRLE](https://github.com/ViennaTools/viennahrle) >= 0.4.0
* [ViennaLS](https://github.com/ViennaTools/viennals) >= 4.2.0
* [ViennaHRLE](https://github.com/ViennaTools/viennahrle) >= 0.5.0
* [VTK](https://vtk.org/) >= 9.0.0

* [ViennaRay](https://github.com/ViennaTools/viennaray) >= 3.1.0
* [ViennaRay](https://github.com/ViennaTools/viennaray) >= 3.1.4
* [Embree](https://www.embree.org/) >= 4.0.0

* [ViennaCS](https://github.com/ViennaTools/viennacs) >= 1.0.0
Expand Down Expand Up @@ -98,7 +98,7 @@ We recommend using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to consum

* Installation with CPM
```cmake
CPMAddPackage("gh:viennatools/viennaps@3.2.0")
CPMAddPackage("gh:viennatools/viennaps@3.3.0")
```

* With a local installation
Expand Down Expand Up @@ -218,7 +218,7 @@ The configuration file must obey a certain structure in order to be parsed corre

## Contributing

If you want to contribute to ViennaCS, make sure to follow the [LLVM Coding guidelines](https://llvm.org/docs/CodingStandards.html).
If you want to contribute to ViennaPS, make sure to follow the [LLVM Coding guidelines](https://llvm.org/docs/CodingStandards.html).

Make sure to format all files before creating a pull request:
```bash
Expand All @@ -228,7 +228,7 @@ cmake --build build --target format

## Authors

Current contributors: Tobias Reiter, Noah Karnel, Julius Piso
Current contributors: Tobias Reiter, Noah Karnel, Lado Filipovic

Contact us via: [email protected]

Expand Down
2 changes: 1 addition & 1 deletion examples/faradayCageEtching/config.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Geometry
gridDelta = 0.1
gridDelta = 0.125
xExtent = 10.0
yExtent = 10.0

Expand Down
15 changes: 8 additions & 7 deletions examples/faradayCageEtching/faradayCageEtching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ps = viennaps;

int main(int argc, char *argv[]) {
using NumericType = double;
constexpr int D = 2;
constexpr int D = 3;

ps::Logger::setLogLevel(ps::LogLevel::INTERMEDIATE);
omp_set_num_threads(16);
Expand All @@ -24,10 +24,10 @@ int main(int argc, char *argv[]) {

// geometry setup
auto geometry = ps::SmartPointer<ps::Domain<NumericType, D>>::New();
ps::MakeFin<NumericType, D>(geometry, params.get("gridDelta"),
params.get("xExtent"), params.get("yExtent"),
params.get("finWidth"), params.get("maskHeight"),
0.0, 0.0, true, true, ps::Material::Si)
ps::MakeFin<NumericType, D>(
geometry, params.get("gridDelta"), params.get("xExtent"),
params.get("yExtent"), params.get("finWidth"), params.get("maskHeight"),
0.0, 0.0, true /*enables periodic BCs*/, true, ps::Material::Si)
.apply();

std::vector<ps::Material> maskMaterials = {ps::Material::Mask};
Expand All @@ -41,9 +41,10 @@ int main(int argc, char *argv[]) {
ps::Process<NumericType, D> process;
process.setDomain(geometry);
process.setProcessModel(model);
process.setMaxCoverageInitIterations(10);
process.setNumberOfRaysPerPoint(params.get("raysPerPoint"));
process.setProcessDuration(params.get("etchTime"));
process.setIntegrationScheme(
ps::IntegrationScheme::LOCAL_LAX_FRIEDRICHS_1ST_ORDER);

// print initial surface
geometry->saveSurfaceMesh("initial.vtp");
Expand All @@ -52,5 +53,5 @@ int main(int argc, char *argv[]) {
process.apply();

// print final surface
geometry->saveSurfaceMesh("final.vtp");
geometry->saveHullMesh("final");
}
2 changes: 1 addition & 1 deletion examples/holeEtching/testFluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

# simulation parameters
processDuration = 3 # min
integrationScheme = vps.ls.IntegrationSchemeEnum.ENGQUIST_OSHER_2ND_ORDER
integrationScheme = vps.IntegrationScheme.ENGQUIST_OSHER_2ND_ORDER
numberOfRaysPerPoint = int(1000)

for i in range(len(yo2)):
Expand Down
9 changes: 9 additions & 0 deletions examples/ionBeamEtching/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project(ionBeamEtching LANGUAGES CXX)

add_executable("${PROJECT_NAME}" "${PROJECT_NAME}.cpp")
target_link_libraries("${PROJECT_NAME}" PRIVATE ViennaPS)

configure_file(config.txt ${CMAKE_CURRENT_BINARY_DIR}/config.txt COPYONLY)

add_dependencies(ViennaPS_Examples ${PROJECT_NAME})
viennacore_setup_bat(${PROJECT_NAME} ${VIENNAPS_ARTIFACTS_DIRECTORY})
23 changes: 23 additions & 0 deletions examples/ionBeamEtching/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Config file for a ion beam etching example
# Domain
gridDelta=0.1
xExtent=10
yExtent=10

# Geometry
trenchWidth=5
maskHeight=1
trenchDepth=10

# Model
meanEnergy=100
sigmaEnergy=10
thresholdEnergy=10
exponent=100

# Process
redepositionRate=0.05
planeWaferRate=1.0
angle=35.0

processTime=3
74 changes: 74 additions & 0 deletions examples/ionBeamEtching/ionBeamEtching.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#include <geometries/psMakeTrench.hpp>
#include <models/psDirectionalEtching.hpp>
#include <models/psIonBeamEtching.hpp>

#include <psProcess.hpp>
#include <psUtils.hpp>

using namespace viennaps;

int main(int argc, char *argv[]) {
using NumericType = double;
constexpr int D = 2;
Logger::setLogLevel(LogLevel::INTERMEDIATE);

// Parse the parameters
utils::Parameters params;
if (argc > 1) {
params.readConfigFile(argv[1]);
} else {
std::cout << "Usage: " << argv[0] << " <config file>" << std::endl;
return 1;
}

auto geometry = SmartPointer<Domain<NumericType, D>>::New();
MakeTrench<NumericType, D>(
geometry, params.get("gridDelta"), params.get("xExtent"),
params.get("yExtent"), params.get("trenchWidth"),
params.get("maskHeight"), 0.0 /* tapering angle */, 0.0 /* base height */,
true /*periodic*/, true /*make mask*/, Material::Si)
.apply();

{
// etch trench
Vec3D<NumericType> direction{0., 0., 0.};
direction[D - 1] = -1.;
auto model =
SmartPointer<DirectionalEtching<NumericType, D>>::New(direction, -1.0);
Process<NumericType, D>(geometry, model, params.get("trenchDepth")).apply();
}

// copy top layer to capture deposition
geometry->duplicateTopLevelSet(Material::Polymer);

IBEParameters<NumericType> ibeParams;
ibeParams.tiltAngle = params.get("angle");
ibeParams.exponent = params.get("exponent");

ibeParams.meanEnergy = params.get("meanEnergy");
ibeParams.sigmaEnergy = params.get("sigmaEnergy");
ibeParams.thresholdEnergy = params.get("thresholdEnergy");

ibeParams.redepositionRate = params.get("redepositionRate");
ibeParams.planeWaferRate = params.get("planeWaferRate");

auto model = SmartPointer<IonBeamEtching<NumericType, D>>::New(
std::vector<Material>{Material::Mask}, ibeParams);
Vec3D<NumericType> direction{0., 0., 0.};
direction[D - 1] = -std::cos(ibeParams.tiltAngle * M_PI / 180.);
direction[D - 2] = std::sin(ibeParams.tiltAngle * M_PI / 180.);
model->setPrimaryDirection(direction);

Process<NumericType, D> process;
process.setDomain(geometry);
process.setProcessModel(model);
process.setProcessDuration(params.get("processTime"));
process.setIntegrationScheme(
viennals::IntegrationSchemeEnum::LAX_FRIEDRICHS_2ND_ORDER);

geometry->saveHullMesh("initial");

process.apply();

geometry->saveHullMesh("final");
}
82 changes: 82 additions & 0 deletions examples/ionBeamEtching/ionBeamEtching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
from argparse import ArgumentParser
import numpy as np

# parse config file name and simulation dimension
parser = ArgumentParser(
prog="ionBeamEtching",
description="Run an IBE process on a trench geometry.",
)
parser.add_argument("-D", "-DIM", dest="dim", type=int, default=2)
parser.add_argument("filename")
args = parser.parse_args()

# switch between 2D and 3D mode
if args.dim == 2:
print("Running 2D simulation.")
import viennaps2d as vps
else:
print("Running 3D simulation.")
import viennaps3d as vps

vps.Logger.setLogLevel(vps.LogLevel.INTERMEDIATE)

params = vps.ReadConfigFile(args.filename)

geometry = vps.Domain()
vps.MakeTrench(
domain=geometry,
gridDelta=params["gridDelta"],
xExtent=params["xExtent"],
yExtent=params["yExtent"],
trenchWidth=params["trenchWidth"],
trenchDepth=params["maskHeight"],
taperingAngle=0.0,
baseHeight=0.0,
periodicBoundary=True,
makeMask=True,
material=vps.Material.Si,
).apply()

direction = [0.0, 0.0, 0.0]
direction[args.dim - 1] = -1.0
model = vps.DirectionalEtching(
direction=direction,
directionalVelocity=-1.0,
)
vps.Process(geometry, model, params["trenchDepth"]).apply()

# copy top layer to capture deposition
geometry.duplicateTopLevelSet(vps.Material.Polymer)

ibeParams = vps.IBEParameters()
ibeParams.tiltAngle = params["angle"]
ibeParams.exponent = params["exponent"]

ibeParams.meanEnergy = params["meanEnergy"]
ibeParams.sigmaEnergy = params["sigmaEnergy"]
ibeParams.thresholdEnergy = params["thresholdEnergy"]

ibeParams.redepositionRate = params["redepositionRate"]
ibeParams.planeWaferRate = params["planeWaferRate"]

model = vps.IonBeamEtching(
maskMaterials=[vps.Material.Mask],
parameters=ibeParams,
)

direction = [0.0, 0.0, 0.0]
direction[args.dim - 1] = -np.cos(ibeParams.tiltAngle * np.pi / 180.0)
direction[args.dim - 2] = np.sin(ibeParams.tiltAngle * np.pi / 180.0)
model.setPrimaryDirection(direction)

process = vps.Process()
process.setDomain(geometry)
process.setProcessModel(model)
process.setProcessDuration(params["processTime"])
process.setIntegrationScheme(vps.IntegrationScheme.LAX_FRIEDRICHS_2ND_ORDER)

geometry.saveHullMesh("initial")

process.apply()

geometry.saveHullMesh("final")
2 changes: 1 addition & 1 deletion examples/stackEtching/stackEtching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ int main(int argc, char *argv[]) {
viennals::BoundaryConditionEnum::INFINITE_BOUNDARY})
.apply();

extruded->saveVolumeMesh("final_extruded");
extruded->saveHullMesh("final_extruded");
}
6 changes: 2 additions & 4 deletions examples/stackEtching/stackEtching.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
process.setProcessDuration(params["processTime"])
process.setMaxCoverageInitIterations(10)
process.setTimeStepRatio(0.25)
process.setIntegrationScheme(
vps.ls.IntegrationSchemeEnum.LOCAL_LAX_FRIEDRICHS_1ST_ORDER
)
process.setIntegrationScheme(vps.IntegrationScheme.LOCAL_LAX_FRIEDRICHS_1ST_ORDER)

# print initial surface
geometry.saveVolumeMesh("initial")
Expand All @@ -74,4 +72,4 @@

vps.Extrude(geometry, extruded, extrudeExtent, 0, boundaryConds).apply()

extruded.saveVolumeMesh("final_extruded")
extruded.saveHullMesh("final_extruded")
7 changes: 2 additions & 5 deletions examples/trenchDeposition/trenchDeposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ int main(int argc, char *argv[]) {
process.setNumberOfRaysPerPoint(1000);
process.setProcessDuration(params.get("processTime"));

geometry->saveSurfaceMesh("initial.vtp");
geometry->saveHullMesh("initial");

process.apply();

geometry->saveSurfaceMesh("final.vtp");

if constexpr (D == 2)
geometry->saveVolumeMesh("final");
geometry->saveHullMesh("final");
}
7 changes: 2 additions & 5 deletions examples/trenchDeposition/trenchDeposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@
sourceExponent=params["sourcePower"],
)

geometry.saveSurfaceMesh("initial.vtp")
geometry.saveHullMesh("initial")

vps.Process(geometry, model, params["processTime"]).apply()

geometry.saveSurfaceMesh("final.vtp")

if args.dim == 2:
geometry.saveVolumeMesh("final")
geometry.saveHullMesh("final")
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ int main(int argc, char *argv[]) {
process.setDomain(geometry);
process.setProcessModel(model);

geometry->saveSurfaceMesh("initial.vtp");
geometry->saveHullMesh("initial");

process.apply();

geometry->saveSurfaceMesh("final.vtp");

if constexpr (D == 2)
geometry->saveVolumeMesh("final");
geometry->saveHullMesh("final");
}
Loading

0 comments on commit 7702af0

Please sign in to comment.