Skip to content

Commit b2229bc

Browse files
feat: surface diffusion and desorption (#228)
* Initial commit for neutral transport with coverage and 1D surface diffusion * set geometry to flat wafer with cylinder mask * Add desorption re-emission for cpu/gpu disk/triangle * add etching to coverage equation * Calculate flux from Maxwellian distribution * remove desorption from Si, leave on mask only * Improve surface diffusion * Add CPU triangle option for transmission calculation * refactor: small fixes in desorption fluxes * fix: typo * feat: graph based surface diffusion implementation * feat: add surface diffusion framework to process framework * refactor: use existings constants * feat: surface diffusion of coverage * feat: surface diffusion in single particle ALD model * refactor: keep surface diffusion setup in ALP * Update max number of relections * refactor: use unmodified CMake setup * refactor: update benchmarks * refactor: start seperating desorption flux from normal flux calculation * refactor: surface flux calculation GPU triangle * perf: post processing update * refactor: desorption for CPU triange engine * refactor: desorption fluxes for disk engines * feat: purge pulse in ALP strategy * feat: test purge pulse in ALD model * feat: python bindings for params * refactor: replace tracing data with point data * feat: split purge pulse in multiple time steps * refactor: ALD parameters * feat: use mesh helper functions, update purge step * refactor: flux process strategy, bump version * chore: bump deps * chore: format * fix: let delocate vendor macOS VTK dylibs * fix: disable VTK rendering on macOS package * fix: RenderMode include scope and dangling reference warning * fix: verbose python build * fix: Windows runtime deps * fix: windows python dll dependency * fix: macOS use local ViennaLS build for bindings --------- Co-authored-by: filipovic <filipovic@iue.tuwien.ac.at>
1 parent d49270f commit b2229bc

70 files changed

Lines changed: 4231 additions & 1452 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,22 @@ jobs:
9696
--config-settings=cmake.define.VCPKG_TARGET_TRIPLET="x64-windows"
9797
.\venv\Scripts\python -c "import viennaps; print(viennaps.__doc__)"
9898
99-
- name: 🐍 Build and check Python Module (Other)
100-
if: ${{ matrix.os != 'windows-latest' }}
99+
- name: 🐍 Build and check Python Module (Linux)
100+
if: ${{ matrix.os == 'ubuntu-latest' }}
101+
run: |
102+
python -m venv venv
103+
CMAKE_ARGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF ./venv/bin/pip install .
104+
./venv/bin/python -c "import viennaps; print(viennaps.__doc__)"
105+
106+
- name: 🐍 Build and check Python Module (macOS)
107+
if: ${{ matrix.os == 'macos-latest' }}
101108
run: |
102109
python -m venv venv
103-
CMAKE_ARGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF ./venv/bin/pip install .
110+
./venv/bin/python -m pip install --upgrade pip
111+
git clone --depth 1 --branch v5.7.3 https://github.com/ViennaTools/ViennaLS.git ViennaLS
112+
CMAKE_ARGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF ./venv/bin/pip install ./ViennaLS
113+
CMAKE_ARGS=-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF ./venv/bin/pip install . --no-deps
114+
SITE_PACKAGES=$(./venv/bin/python -c 'import sysconfig; print(sysconfig.get_paths()["platlib"])')
104115
./venv/bin/python -c "import viennaps; print(viennaps.__doc__)"
105116
106117
- name: 📦 Upload Artifact

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
build-cpu/
23
cmake-build*
34
.vscode
45
.vs

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
22
project(
33
ViennaPS
44
LANGUAGES CXX C
5-
VERSION 4.4.0)
5+
VERSION 4.5.0)
66

77
# --------------------------------------------------------------------------------------------------------
88
# Include guards
@@ -23,6 +23,7 @@ option(VIENNAPS_PRECOMPILE_HEADERS "Enable precompiled headers" OFF)
2323
option(VIENNAPS_STATIC_BUILD "Build ViennaPS as static library" OFF)
2424
option(VIENNAPS_ENABLE_SANITIZER "Enable sanitizers" OFF)
2525
option(VIENNAPS_ENABLE_CLANG_TIDY "Run clang-tidy during build" OFF)
26+
option(VIENNAPS_VTK_RENDERING "Enable VTK rendering support" ON)
2627

2728
option(VIENNAPS_USE_GPU "Enable GPU support" OFF)
2829

@@ -67,6 +68,10 @@ endif()
6768

6869
if(VIENNAPS_BUILD_PYTHON)
6970
set(CMAKE_PLATFORM_NO_VERSIONED_SONAME ON)
71+
72+
if(APPLE)
73+
set(VIENNAPS_VTK_RENDERING OFF)
74+
endif()
7075
endif()
7176

7277
if(MSVC)
@@ -106,7 +111,7 @@ include("cmake/cpm.cmake")
106111

107112
CPMAddPackage(
108113
NAME ViennaCore
109-
VERSION 2.1.2
114+
VERSION 2.2.1
110115
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore"
111116
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
112117
OPTIONS "VIENNACORE_USE_GPU ${VIENNAPS_USE_GPU}")
@@ -118,17 +123,18 @@ CPMAddPackage(
118123

119124
CPMAddPackage(
120125
NAME ViennaRay
121-
VERSION 4.1.2
126+
VERSION 4.3.1
122127
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay"
123128
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
124129
OPTIONS "VIENNARAY_USE_GPU ${VIENNAPS_USE_GPU}")
125130

126131
CPMAddPackage(
127132
NAME ViennaLS
128-
VERSION 5.7.1
133+
VERSION 5.7.3
129134
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaLS"
130135
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
131-
OPTIONS "VIENNALS_PRECOMPILE_HEADERS ${VIENNAPS_PRECOMPILE_HEADERS}")
136+
OPTIONS "VIENNALS_PRECOMPILE_HEADERS ${VIENNAPS_PRECOMPILE_HEADERS}"
137+
"VIENNALS_VTK_RENDERING ${VIENNAPS_VTK_RENDERING}")
132138

133139
CPMAddPackage(
134140
NAME ViennaCS

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ We recommend using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to consum
130130

131131
* Installation with CPM
132132
```cmake
133-
CPMAddPackage("gh:viennatools/viennaps@4.4.0")
133+
CPMAddPackage("gh:viennatools/viennaps@4.5.0")
134134
```
135135

136136
* With a local installation
@@ -155,7 +155,7 @@ cmake -B build -DVIENNALS_PRECOMPILE_HEADERS=ON
155155

156156
If ViennaPS was built with shared libraries and you use ViennaPS in your project (see above), CMake will automatically link them to your project.
157157

158-
## GPU Acceleration (Experimental)
158+
## GPU Acceleration
159159

160160
As of version 3.4.0, ViennaPS supports GPU acceleration for the ray tracing part of the library. This feature is still experimental. Details on how to enable GPU functionality can be found in the [documentation](https://viennatools.github.io/ViennaPS/inst/gpu.html).
161161

@@ -286,4 +286,4 @@ http://www.iue.tuwien.ac.at/
286286
Versions < 4.3.0 were released under MIT License. Starting with version 4.3.0, the project is licensed under GPL-3.0 License. For more details, please refer to the [LICENSE](./LICENSE) file in the base directory of the repository.
287287

288288
Some third-party libraries used by ViennaPS are under their own permissive licenses (BSD, Apache-2.0).
289-
See [`THIRD_PARTY_LICENSES.md`](./THIRD_PARTY_LICENSES.md) for details.
289+
See [`THIRD_PARTY_LICENSES.md`](./THIRD_PARTY_LICENSES.md) for details.

examples/atomicLayerDeposition/atomicLayerDeposition.cpp

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
// #include "constants.hpp"
1010
#include "geometry.hpp"
1111

12-
namespace ps = viennaps;
12+
using namespace viennaps;
1313

1414
template <typename T, int D> class MeasureProfile {
1515
using ResultType = std::pair<std::vector<T>, std::vector<T>>;
1616

17-
ps::SmartPointer<ps::Domain<T, D>> domain_;
17+
SmartPointer<Domain<T, D>> domain_;
1818
T cutoffHeight_;
1919

2020
public:
21-
MeasureProfile(ps::SmartPointer<ps::Domain<T, D>> &domain, T cutoffHeight)
21+
MeasureProfile(SmartPointer<Domain<T, D>> &domain, T cutoffHeight)
2222
: cutoffHeight_(cutoffHeight) {
23-
domain_ = ps::SmartPointer<ps::Domain<T, D>>::New();
23+
domain_ = SmartPointer<Domain<T, D>>::New();
2424
domain_->deepCopy(domain);
2525
}
2626

2727
ResultType get() {
28-
ps::Planarize<T, D>(domain_, cutoffHeight_).apply();
28+
Planarize<T, D>(domain_, cutoffHeight_).apply();
2929
auto mesh = viennals::Mesh<T>::New();
30-
ps::ToDiskMesh<T, D>(domain_, mesh).apply();
30+
ToDiskMesh<T, D>(domain_, mesh).apply();
3131

3232
std::vector<T> height, position;
3333
height.reserve(mesh->nodes.size());
@@ -57,7 +57,7 @@ int main(int argc, char **argv) {
5757
omp_set_num_threads(16);
5858

5959
// Parse the parameters
60-
ps::util::Parameters params;
60+
util::Parameters params;
6161
if (argc > 1) {
6262
params.readConfigFile(argv[1]);
6363
} else {
@@ -70,34 +70,49 @@ int main(int argc, char **argv) {
7070
}
7171
}
7272

73-
auto domain = ps::SmartPointer<ps::Domain<NumericType, D>>::New();
73+
auto domain = SmartPointer<Domain<NumericType, D>>::New();
7474
makeT(domain, params.get("gridDelta"), params.get("openingDepth"),
7575
params.get("openingWidth"), params.get("gapLength"),
76-
params.get("gapHeight"), params.get("xPad"), ps::Material::Si,
76+
params.get("gapHeight"), params.get("xPad"), Material::Si,
7777
params.get("gapWidth"));
7878

7979
domain->saveVolumeMesh("SingleParticleALD_initial");
8080

81-
domain->duplicateTopLevelSet(ps::Material::Al2O3);
81+
domain->duplicateTopLevelSet(Material::Al2O3);
8282

83-
auto gasMFP = ps::constants::gasMeanFreePath(params.get("pressure"),
84-
params.get("temperature"),
85-
params.get("diameter"));
83+
auto gasMFP = constants::gasMeanFreePath(params.get("pressure"),
84+
params.get("temperature"),
85+
params.get("diameter"));
8686
std::cout << "Mean free path: " << gasMFP << " um" << std::endl;
8787

88-
auto model = ps::SmartPointer<ps::SingleParticleALD<NumericType, D>>::New(
89-
params.get("stickingProbability"), params.get("numCycles"),
90-
params.get("growthPerCycle"), params.get("totalCycles"),
91-
params.get("coverageTimeStep"), params.get("evFlux"),
92-
params.get("inFlux"), params.get("s0"), gasMFP);
88+
const NumericType gpc = params.get<int>("totalCycles") /
89+
params.get<int>("numCycles") *
90+
params.get("growthPerCycle");
9391

94-
ps::AtomicLayerProcessParameters alpParams;
92+
SingleParticleALDParams alpModelParams;
93+
alpModelParams.stickingProbability = params.get("stickingProbability");
94+
alpModelParams.gasMeanFreePath = gasMFP;
95+
alpModelParams.growthPerCycle = gpc;
96+
alpModelParams.evaporationFlux = params.get("evFlux");
97+
alpModelParams.incomingFlux = params.get("inFlux");
98+
alpModelParams.s0 = params.get("s0");
99+
alpModelParams.coverageDiffusionCoefficient =
100+
params.get("coverageDiffusionCoefficient");
101+
102+
auto model =
103+
SmartPointer<SingleParticleALD<NumericType, D>>::New(alpModelParams);
104+
105+
AtomicLayerProcessParameters alpParams;
95106
alpParams.numCycles = params.get<unsigned>("numCycles");
96107
alpParams.pulseTime = params.get("pulseTime");
97108
alpParams.coverageTimeStep = params.get("coverageTimeStep");
98109

99-
ps::Process<NumericType, D> ALP(domain, model);
110+
RayTracingParameters rayTracingParams;
111+
rayTracingParams.raysPerPoint = params.get<unsigned>("numRaysPerPoint");
112+
113+
Process<NumericType, D> ALP(domain, model);
100114
ALP.setParameters(alpParams);
115+
ALP.setParameters(rayTracingParams);
101116
ALP.apply();
102117

103118
MeasureProfile<NumericType, D>(domain, params.get("gapHeight") / 2.)

examples/atomicLayerDeposition/atomicLayerDeposition.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,25 @@
4545

4646
geometry.saveSurfaceMesh("SingleParticleALD_initial")
4747

48-
model = ps.SingleParticleProcess(rate=1.0, stickingProbability=1e-4)
49-
5048
geometry.duplicateTopLevelSet(ps.Material.Al2O3)
5149

5250
gasMFP = ps.constants.gasMeanFreePath(
5351
params["pressure"], params["temperature"], params["diameter"]
5452
)
5553
print("Mean free path: ", gasMFP, " um")
5654

57-
model = ps.SingleParticleALD(
58-
stickingProbability=params["stickingProbability"],
59-
numCycles=int(params["numCycles"]),
60-
growthPerCycle=params["growthPerCycle"],
61-
totalCycles=int(params["totalCycles"]),
62-
coverageTimeStep=params["coverageTimeStep"],
63-
evFlux=params["evFlux"],
64-
inFlux=params["inFlux"],
65-
s0=params["s0"],
66-
gasMFP=gasMFP,
67-
)
55+
gpc = params["totalCycles"] / params["numCycles"] * params["growthPerCycle"]
56+
57+
params = ps.SingleParticleALDParams()
58+
params.stickingProbability = params["stickingProbability"]
59+
params.gasMeanFreePath = gasMFP
60+
params.growthPerCycle = gpc
61+
params.evaporationFlux = params["evFlux"]
62+
params.incomingFlux = params["inFlux"]
63+
params.s0 = params["s0"]
64+
params.coverageDiffusionCoefficient = params["coverageDiffusionCoefficient"]
65+
66+
model = ps.SingleParticleALD(params)
6867

6968
alpParams = ps.AtomicLayerProcessParameters()
7069
alpParams.pulseTime = params["pulseTime"]

examples/atomicLayerDeposition/config.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ topSpace = 0.
1212

1313
# Cycles
1414
pulseTime = 0.1
15+
purgePulseTime = 0.05
1516
coverageTimeStep=0.01
1617
growthPerCycle = 0.000112
1718
numCycles=10
@@ -26,7 +27,7 @@ mass = 28.02
2627
# Atomistic
2728
inFlux = 2e6 # 1e19
2829
stickingProbability = 5e-5
29-
evFlux = 0 # 6.5 # 1e19
30+
evFlux = 2.5 # 1e19
3031
s0 = 3.36
3132

3233
# Simulation

examples/customParticleDistribution/customParticleDistribution.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,18 @@ class CustomDistributionParticle final
142142
void surfaceCollision(NumericType rayWeight, const Vec3D<NumericType> &rayDir,
143143
const Vec3D<NumericType> &geomNormal,
144144
const unsigned int primID, const int,
145-
viennaray::TracingData<NumericType> &localData,
146-
const viennaray::TracingData<NumericType> *,
147-
RNG &) override {
148-
localData.getVectorData(0)[primID] +=
149-
std::max(std::sqrt(energy_) - std::sqrt(thresholdEnergy_), 0.);
145+
PointData<NumericType> &localData,
146+
const PointData<NumericType> *, RNG &) override {
147+
localData.addToScalarData(
148+
0, primID,
149+
std::max(std::sqrt(energy_) - std::sqrt(thresholdEnergy_), 0.));
150150
}
151151

152152
std::pair<NumericType, Vec3D<NumericType>>
153153
surfaceReflection(NumericType rayWeight, const Vec3D<NumericType> &rayDir,
154154
const Vec3D<NumericType> &geomNormal,
155155
const unsigned int primID, const int materialId,
156-
const viennaray::TracingData<NumericType> *globalData,
156+
const PointData<NumericType> *globalData,
157157
RNG &rngState) override {
158158

159159
NumericType incAngle = std::acos(-DotProduct(rayDir, geomNormal));
@@ -199,7 +199,7 @@ template <typename NumericType>
199199
class CustomSurfaceModel : public SurfaceModel<NumericType> {
200200
public:
201201
SmartPointer<std::vector<NumericType>>
202-
calculateVelocities(SmartPointer<viennals::PointData<NumericType>> fluxes,
202+
calculateVelocities(SmartPointer<PointData<NumericType>> fluxes,
203203
const std::vector<Vec3D<NumericType>> &coordinates,
204204
const std::vector<NumericType> &materialIds) override {
205205
auto velocity =

examples/exampleProcess/particles.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ class Particle
1414
const viennaray::Vec3D<NumericType> &rayDir,
1515
const viennaray::Vec3D<NumericType> &geomNormal,
1616
const unsigned int primID, const int materialId,
17-
viennaray::TracingData<NumericType> &localData,
18-
const viennaray::TracingData<NumericType> *globalData,
17+
viennaray::PointData<NumericType> &localData,
18+
const viennaray::PointData<NumericType> *globalData,
1919
viennaray::RNG &rngState) final {
2020
// collect data for this hit
21-
localData.getVectorData(0)[primID] += rayWeight;
21+
localData.addToScalarData(0, primID, rayWeight);
2222
}
2323
std::pair<NumericType, viennaray::Vec3D<NumericType>>
2424
surfaceReflection(NumericType rayWeight,
2525
const viennaray::Vec3D<NumericType> &rayDir,
2626
const viennaray::Vec3D<NumericType> &geomNormal,
2727
const unsigned int primId, const int materialId,
28-
const viennaray::TracingData<NumericType> *globalData,
28+
const viennaray::PointData<NumericType> *globalData,
2929
viennaray::RNG &rngState) final {
3030
auto direction =
3131
viennaray::ReflectionDiffuse<NumericType, D>(geomNormal, rngState);

examples/exampleProcess/surfaceModel.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SurfaceModel : public viennaps::SurfaceModel<NumericType> {
1111
void initializeCoverages(unsigned numGeometryPoints) override {
1212
std::vector<NumericType> someCoverages(numGeometryPoints, 0);
1313

14-
coverages = viennals::PointData<NumericType>::New();
14+
coverages = viennaps::PointData<NumericType>::New();
1515
coverages->insertNextScalarData(someCoverages, "coverages");
1616
}
1717

@@ -22,7 +22,7 @@ class SurfaceModel : public viennaps::SurfaceModel<NumericType> {
2222
}
2323

2424
viennaps::SmartPointer<std::vector<NumericType>> calculateVelocities(
25-
viennaps::SmartPointer<viennals::PointData<NumericType>> rates,
25+
viennaps::SmartPointer<viennaps::PointData<NumericType>> rates,
2626
const std::vector<viennaps::Vec3D<NumericType>> &coordinates,
2727
const std::vector<NumericType> &materialIds) override {
2828
// use coverages and rates here to calculate the velocity here
@@ -31,7 +31,7 @@ class SurfaceModel : public viennaps::SurfaceModel<NumericType> {
3131
}
3232

3333
void updateCoverages(
34-
viennaps::SmartPointer<viennals::PointData<NumericType>> rates,
34+
viennaps::SmartPointer<viennaps::PointData<NumericType>> rates,
3535
const std::vector<NumericType> &materialIds) override {
3636
// update coverages
3737
}

0 commit comments

Comments
 (0)