diff --git a/Python/pyWrap.cpp b/Python/pyWrap.cpp index 27c5dc2c..15e82261 100644 --- a/Python/pyWrap.cpp +++ b/Python/pyWrap.cpp @@ -409,20 +409,28 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { }); // psProcess - pybind11::class_, psSmartPointer>>(module, - "Process") + pybind11::class_>(module, "Process") // constructors - .def(pybind11::init(&psSmartPointer>::New<>)) - + .def(pybind11::init()) + .def(pybind11::init(), pybind11::arg("domain")) + .def( + pybind11::init>, T>(), + pybind11::arg("domain"), pybind11::arg("model"), + pybind11::arg("duration")) // methods + .def("apply", &psProcess::apply, "Run the process.") .def("setDomain", &psProcess::setDomain, "Set the process domain.") + .def("setProcessModel", + &psProcess::setProcessModel>, + "Set the process model. This has to be a pre-configured process " + "model.") .def("setProcessDuration", &psProcess::setProcessDuration, "Set the process duration.") .def("setSourceDirection", &psProcess::setSourceDirection, "Set source direction of the process.") .def("setNumberOfRaysPerPoint", &psProcess::setNumberOfRaysPerPoint, "Set the number of rays to traced for each particle in the process. " - "The number is per point in the process geometry") + "The number is per point in the process geometry.") .def("setMaxCoverageInitIterations", &psProcess::setMaxCoverageInitIterations, "Set the number of iterations to initialize the coverages.") @@ -430,19 +438,24 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) { "Sets the minimum time between printing intermediate results during " "the process. If this is set to a non-positive value, no " "intermediate results are printed.") - .def("setProcessModel", - &psProcess::setProcessModel>, - "Set the process model.") - .def("apply", &psProcess::apply, "Run the process.") .def("setIntegrationScheme", &psProcess::setIntegrationScheme, "Set the integration scheme for solving the level-set equation. " - "Should be used out of the ones specified in " + "Possible integration schemes are specified in " "lsIntegrationSchemeEnum.") .def("setTimeStepRatio", &psProcess::setTimeStepRatio, "Set the CFL condition to use during advection. The CFL condition " "sets the maximum distance a surface can be moved during one " "advection step. It MUST be below 0.5 to guarantee numerical " - "stability. Defaults to 0.4999."); + "stability. Defaults to 0.4999.") + .def("enableFluxSmoothing", &psProcess::enableFluxSmoothing, + "Enable flux smoothing. The flux at each surface point, calculated " + "by the ray tracer, is averaged over the surface point neighbors.") + .def("disableFluxSmoothing", &psProcess::disableFluxSmoothing, + "Disable flux smoothing") + .def("getProcessDuration", &psProcess::getProcessDuration, + "Returns the duration of the recently run process. This duration " + "can sometimes slightly vary from the set process duration, due to " + "the maximum time step according to the CFL condition."); // psAdvectionCallback pybind11::class_, diff --git a/README.md b/README.md index c324ef4a..7806ec9a 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Below the results after 1, 2, and 3 seconds of etching are shown. -By changing the dimension of the hole etching example (_D = 2_), we can easily simulate the profile of a trench etching process with the same plasma chemistry. Here we can, for example, vary the mask tapering angle to observe increased microtrenching, as shown below. +By changing the dimension of the hole etching example (_D = 2_), we can easily simulate the profile of a trench etching process with the same plasma chemistry. Here we can, for example, vary the mask tapering angle to observe increased micro-trenching, as shown below.
@@ -157,7 +157,7 @@ If you want to contribute to ViennaPS, make sure to follow the [LLVM Coding guid ## Authors -Current contributors: Tobias Reiter, Julius Piso, Josip Bobinac, Xaver Klemenschits +Current contributors: Tobias Reiter, Julius Piso Contact us via: viennatools@iue.tuwien.ac.at diff --git a/app/Application.hpp b/app/Application.hpp index 901f0178..d4de15a4 100644 --- a/app/Application.hpp +++ b/app/Application.hpp @@ -118,7 +118,8 @@ template class Application { psProcess process; process.setDomain(processGeometry); process.setProcessModel(model); - process.setSmoothFlux(processParams->smoothFlux); + if (processParams->smoothFlux) + process.enableFluxSmoothing(); process.setNumberOfRaysPerPoint(processParams->raysPerPoint); process.setProcessDuration(processParams->processTime); process.setIntegrationScheme(params->integrationScheme); @@ -139,7 +140,8 @@ template class Application { psProcess process; process.setDomain(processGeometry); process.setProcessModel(model); - process.setSmoothFlux(processParams->smoothFlux); + if (processParams->smoothFlux) + process.enableFluxSmoothing(); process.setNumberOfRaysPerPoint(processParams->raysPerPoint); process.setProcessDuration(processParams->processTime); process.setIntegrationScheme(params->integrationScheme); @@ -159,7 +161,8 @@ template class Application { process.setDomain(processGeometry); process.setProcessModel(model); process.setMaxCoverageInitIterations(10); - process.setSmoothFlux(processParams->smoothFlux); + if (processParams->smoothFlux) + process.enableFluxSmoothing(); process.setNumberOfRaysPerPoint(processParams->raysPerPoint); process.setProcessDuration(processParams->processTime); process.setIntegrationScheme(params->integrationScheme); @@ -179,7 +182,8 @@ template class Application { process.setDomain(processGeometry); process.setProcessModel(model); process.setMaxCoverageInitIterations(10); - process.setSmoothFlux(processParams->smoothFlux); + if (processParams->smoothFlux) + process.enableFluxSmoothing(); process.setNumberOfRaysPerPoint(processParams->raysPerPoint); process.setProcessDuration(processParams->processTime); process.setIntegrationScheme(params->integrationScheme); diff --git a/app/ApplicationParameters.hpp b/app/ApplicationParameters.hpp index 09f7c211..73c9b65f 100644 --- a/app/ApplicationParameters.hpp +++ b/app/ApplicationParameters.hpp @@ -74,7 +74,7 @@ struct ApplicationParameters { NumericType processTime = 1; int raysPerPoint = 3000; NumericType etchStopDepth = std::numeric_limits::lowest(); - NumericType smoothFlux = 1.; + int smoothFlux = 1.; // Plasma etching // fluxes in in (1e15 atoms/cm³) NumericType etchantFlux = 1.8e3; diff --git a/include/psProcess.hpp b/include/psProcess.hpp index 04eaa9df..4316c10c 100644 --- a/include/psProcess.hpp +++ b/include/psProcess.hpp @@ -37,42 +37,60 @@ template class psProcess { passedProcessModel); } + // Set the process model. This can be either a pre-configured process model or + // a custom process model. A custom process model must interface the + // psProcessModel class. template void setProcessModel(psSmartPointer passedProcessModel) { model = std::dynamic_pointer_cast>( passedProcessModel); } + // Set the process domain. void setDomain(psSmartPointer> passedDomain) { domain = passedDomain; } - /// Set the source direction, where the rays should be traced from. + // Set the source direction, where the rays should be traced from. void setSourceDirection(const rayTraceDirection passedDirection) { sourceDirection = passedDirection; } + // Set the duration of the process. void setProcessDuration(NumericType passedDuration) { processDuration = passedDuration; } + // Returns the duration of the recently run process. This duration can + // sometimes slightly vary from the set process duration, due to the maximum + // time step according to the CFL condition. NumericType getProcessDuration() const { return processTime; } + // Set the number of rays to traced for each particle in the process. + // The number is per point in the process geometry. void setNumberOfRaysPerPoint(long numRays) { raysPerPoint = numRays; } + // Set the number of iterations to initialize the coverages. void setMaxCoverageInitIterations(size_t maxIt) { maxIterations = maxIt; } - void setSmoothFlux(bool pSmoothFlux) { smoothFlux = pSmoothFlux; } + /// Enable flux smoothing. The flux at each surface point, calculated + /// by the ray tracer, is averaged over the surface point neighbors. + void enableFluxSmoothing() { smoothFlux = true; } + // Disable flux smoothing. + void disableFluxSmoothing() { smoothFlux = false; } + + // Set the integration scheme for solving the level-set equation. + // Possible integration schemes are specified in lsIntegrationSchemeEnum. void setIntegrationScheme(const lsIntegrationSchemeEnum passedIntegrationScheme) { integrationScheme = passedIntegrationScheme; } - /// Set the CFL condition to use during advection. - /// The CFL condition sets the maximum distance a surface can - /// be moved during one advection step. It MUST be below 0.5 - /// to guarantee numerical stability. Defaults to 0.4999. + // Set the CFL condition to use during advection. + // The CFL condition sets the maximum distance a surface can + // be moved during one advection step. It MUST be below 0.5 + // to guarantee numerical stability. Defaults to 0.4999. void setTimeStepRatio(const double &cfl) { timeStepRatio = cfl; } // Sets the minimum time between printing intermediate results during the @@ -82,6 +100,7 @@ template class psProcess { printTime = passedTime; } + // Run the process. void apply() { /* ---------- Process Setup --------- */ if (!model) {