Skip to content

Commit 88ee779

Browse files
authored
fix: CPU triangle tracing bug and boundary interaction (#219)
* feat: add flux engine benchmarks * chore: bump ViennaRay
1 parent 0b53227 commit 88ee779

6 files changed

Lines changed: 232 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ CPMAddPackage(
118118

119119
CPMAddPackage(
120120
NAME ViennaRay
121-
VERSION 4.1.1
121+
VERSION 4.1.2
122122
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay"
123123
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
124124
OPTIONS "VIENNARAY_USE_GPU ${VIENNAPS_USE_GPU}")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
project(fluxEngineBenchmarks LANGUAGES CXX)
2+
3+
viennaps_add_executable(plasmaEtchingBenchmark "plasmaEtching.cpp")
4+
viennaps_add_executable(spDepositionBenchmark "spDeposition.cpp")
5+
viennaps_add_executable(spEtchingBenchmark "spEtching.cpp")
6+
viennaps_add_executable(ibeEtchingBenchmark "ibeEtching.cpp")
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#include <geometries/psMakeTrench.hpp>
2+
#include <models/psIonBeamEtching.hpp>
3+
4+
#include <process/psProcess.hpp>
5+
#include <psUtil.hpp>
6+
7+
using namespace viennaps;
8+
9+
int main(int argc, char *argv[]) {
10+
using NumericType = double;
11+
constexpr int D = 2;
12+
13+
Logger::setLogLevel(LogLevel::WARNING);
14+
15+
auto run = [&](FluxEngineType fluxEngine) {
16+
auto geometry = Domain<NumericType, D>::New(
17+
0.09, 10.0, BoundaryType::REFLECTIVE_BOUNDARY);
18+
MakeTrench<NumericType, D>(geometry, 5.0, 0.0, 0.0, 2.0).apply();
19+
20+
IBEParameters<NumericType> ibeParams;
21+
ibeParams.exponent = 100;
22+
ibeParams.thetaRMin = 89.;
23+
ibeParams.thetaRMax = 90.;
24+
25+
// ibeParams.meanEnergy = 100;
26+
// ibeParams.sigmaEnergy = 10;
27+
// ibeParams.thresholdEnergy = 10;
28+
29+
ibeParams.planeWaferRate = 1.0;
30+
31+
// ibeParams.cos4Yield.isDefined = true;
32+
// ibeParams.cos4Yield.a1 = 1.075;
33+
// ibeParams.cos4Yield.a2 = -1.55;
34+
// ibeParams.cos4Yield.a3 = 0.65;
35+
36+
auto model = SmartPointer<IonBeamEtching<NumericType, D>>::New(
37+
ibeParams, std::vector<Material>{Material::Mask});
38+
39+
AdvectionParameters advectionParams;
40+
advectionParams.spatialScheme =
41+
viennals::SpatialSchemeEnum::LAX_FRIEDRICHS_2ND_ORDER;
42+
43+
Process<NumericType, D> process(geometry, model);
44+
process.setProcessDuration(10);
45+
process.setParameters(advectionParams);
46+
process.setFluxEngineType(fluxEngine);
47+
48+
process.apply();
49+
50+
geometry->saveSurfaceMesh("ibeEtching_" + util::toString(fluxEngine));
51+
};
52+
53+
run(FluxEngineType::GPU_TRIANGLE);
54+
run(FluxEngineType::GPU_DISK);
55+
run(FluxEngineType::CPU_TRIANGLE);
56+
run(FluxEngineType::CPU_DISK);
57+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#include <geometries/psMakeHole.hpp>
2+
#include <models/psSF6O2Etching.hpp>
3+
4+
#include <process/psProcess.hpp>
5+
#include <psUtil.hpp>
6+
7+
using namespace viennaps;
8+
9+
int main(int argc, char *argv[]) {
10+
using NumericType = double;
11+
constexpr int D = 2;
12+
13+
Logger::setLogLevel(LogLevel::WARNING);
14+
// set parameter units
15+
units::Length::setUnit("um");
16+
units::Time::setUnit("min");
17+
18+
auto run = [&](FluxEngineType fluxEngine) {
19+
// geometry setup
20+
auto geometry = Domain<NumericType, D>::New(
21+
0.03, 1.0,
22+
BoundaryType::REFLECTIVE_BOUNDARY); // gridDelta, xExtent, boundary
23+
MakeHole<NumericType, D>(geometry, 0.175,
24+
0.0, // holeDepth
25+
0.0, // holeTaperAngle
26+
1.2, 1.193, HoleShape::QUARTER)
27+
.apply();
28+
29+
// use pre-defined model SF6O2 etching model
30+
auto modelParams = SF6O2Etching<NumericType, D>::defaultParameters();
31+
modelParams.beta_E[static_cast<int>(Material::Si)] = 1.0;
32+
modelParams.beta_E[static_cast<int>(Material::Mask)] = 1.0;
33+
modelParams.beta_P[static_cast<int>(Material::Si)] = 1.0;
34+
modelParams.beta_P[static_cast<int>(Material::Mask)] = 1.0;
35+
36+
modelParams.ionFlux = 1.;
37+
modelParams.etchantFlux = 4.5e3;
38+
modelParams.passivationFlux = 8e2;
39+
modelParams.Ions.meanEnergy = 100;
40+
modelParams.Ions.sigmaEnergy = 10;
41+
modelParams.Ions.exponent = 1000;
42+
modelParams.Passivation.A_ie = 2.0;
43+
modelParams.Substrate.A_ie = 7;
44+
auto model = SmartPointer<SF6O2Etching<NumericType, D>>::New(modelParams);
45+
46+
CoverageParameters coverageParams;
47+
coverageParams.tolerance = 1e-4;
48+
49+
RayTracingParameters rayTracingParams;
50+
rayTracingParams.raysPerPoint = 10000;
51+
52+
Process<NumericType, D> process(geometry, model);
53+
process.setProcessDuration(1.0);
54+
process.setParameters(coverageParams);
55+
process.setFluxEngineType(fluxEngine);
56+
process.setParameters(rayTracingParams);
57+
58+
process.apply();
59+
60+
geometry->saveSurfaceMesh("PlasmaEtching_" + util::toString(fluxEngine));
61+
};
62+
63+
run(FluxEngineType::GPU_TRIANGLE);
64+
run(FluxEngineType::GPU_DISK);
65+
run(FluxEngineType::CPU_TRIANGLE);
66+
run(FluxEngineType::CPU_DISK);
67+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include <geometries/psMakeTrench.hpp>
2+
#include <models/psSingleParticleProcess.hpp>
3+
4+
#include <process/psProcess.hpp>
5+
#include <psUtil.hpp>
6+
7+
using namespace viennaps;
8+
9+
int main(int argc, char *argv[]) {
10+
using NumericType = double;
11+
constexpr int D = 2;
12+
13+
#ifndef NDEBUG
14+
Logger::setLogLevel(LogLevel::INTERMEDIATE);
15+
// omp_set_num_threads(1);
16+
#else
17+
Logger::setLogLevel(LogLevel::WARNING);
18+
#endif
19+
20+
auto run = [&](FluxEngineType fluxEngine) {
21+
auto geometry = Domain<NumericType, D>::New(
22+
0.14, 10, BoundaryType::REFLECTIVE_BOUNDARY);
23+
MakeTrench<NumericType, D>(geometry, 4.0, 20.0, 0.0, 0.0, 0.0, true)
24+
.apply();
25+
26+
geometry->duplicateTopLevelSet(Material::SiO2);
27+
28+
auto model =
29+
SmartPointer<SingleParticleProcess<NumericType, D>>::New(1.0, 0.01);
30+
model->setProcessName(util::toString(fluxEngine));
31+
32+
RayTracingParameters rayTracingParams;
33+
rayTracingParams.raysPerPoint = 10000;
34+
35+
Process<NumericType, D> process(geometry, model);
36+
process.setProcessDuration(5);
37+
process.setParameters(rayTracingParams);
38+
process.setFluxEngineType(fluxEngine);
39+
process.apply();
40+
// auto flux = process.calculateFlux();
41+
// viennals::VTKWriter<NumericType>(
42+
// flux, "flux_" + util::toString(fluxEngine) + ".vtp")
43+
// .apply();
44+
45+
geometry->saveSurfaceMesh("spDeposition_" + util::toString(fluxEngine));
46+
};
47+
48+
run(FluxEngineType::GPU_TRIANGLE);
49+
run(FluxEngineType::GPU_DISK);
50+
run(FluxEngineType::CPU_TRIANGLE);
51+
run(FluxEngineType::CPU_DISK);
52+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#include <geometries/psMakeTrench.hpp>
2+
#include <models/psSingleParticleProcess.hpp>
3+
4+
#include <process/psProcess.hpp>
5+
#include <psUtil.hpp>
6+
7+
using namespace viennaps;
8+
9+
int main(int argc, char *argv[]) {
10+
using NumericType = double;
11+
constexpr int D = 2;
12+
13+
#ifndef NDEBUG
14+
Logger::setLogLevel(LogLevel::INTERMEDIATE);
15+
// omp_set_num_threads(1);
16+
#else
17+
Logger::setLogLevel(LogLevel::WARNING);
18+
#endif
19+
20+
auto run = [&](FluxEngineType fluxEngine) {
21+
auto geometry = Domain<NumericType, D>::New(
22+
0.14, 16, BoundaryType::REFLECTIVE_BOUNDARY);
23+
MakeTrench<NumericType, D>(geometry, 4.0, 0.0, 0.0, 1.0, 0.0, true).apply();
24+
25+
auto model = SmartPointer<SingleParticleProcess<NumericType, D>>::New(
26+
-1.0, 0.05, 10.0, Material::Mask);
27+
model->setProcessName(util::toString(fluxEngine));
28+
29+
RayTracingParameters rayTracingParams;
30+
rayTracingParams.raysPerPoint = 10000;
31+
32+
Process<NumericType, D> process(geometry, model);
33+
process.setProcessDuration(5);
34+
process.setParameters(rayTracingParams);
35+
process.setFluxEngineType(fluxEngine);
36+
process.apply();
37+
// auto flux = process.calculateFlux();
38+
// viennals::VTKWriter<NumericType>(
39+
// flux, "flux_" + util::toString(fluxEngine) + ".vtp")
40+
// .apply();
41+
42+
geometry->saveSurfaceMesh("spEtching_" + util::toString(fluxEngine));
43+
};
44+
45+
run(FluxEngineType::GPU_TRIANGLE);
46+
run(FluxEngineType::GPU_DISK);
47+
run(FluxEngineType::CPU_TRIANGLE);
48+
run(FluxEngineType::CPU_DISK);
49+
}

0 commit comments

Comments
 (0)