|
| 1 | +#include <geometries/psMakePlane.hpp> |
| 2 | +#include <models/psHBrO2Etching.hpp> |
| 3 | +#include <psProcess.hpp> |
| 4 | +#include <psUtil.hpp> |
| 5 | + |
| 6 | +#include <psDomain.hpp> |
| 7 | +#include <psGDSReader.hpp> |
| 8 | +#include <psMaterials.hpp> |
| 9 | + |
| 10 | +using namespace viennaps; |
| 11 | + |
| 12 | +int main(int argc, char **argv) { |
| 13 | + using NumericType = double; |
| 14 | + constexpr int D = 3; |
| 15 | + |
| 16 | + Logger::setLogLevel(LogLevel::ERROR); |
| 17 | + omp_set_num_threads(12); |
| 18 | + |
| 19 | + // Parse the parameters |
| 20 | + util::Parameters params; |
| 21 | + if (argc > 1) { |
| 22 | + params.readConfigFile(argv[1]); |
| 23 | + } else { |
| 24 | + std::cout << "Usage: " << argv[0] << " <config file>" << std::endl; |
| 25 | + return 1; |
| 26 | + } |
| 27 | + |
| 28 | + // set parameter units |
| 29 | + units::Length::setUnit(params.get<std::string>("lengthUnit")); |
| 30 | + units::Time::setUnit(params.get<std::string>("timeUnit")); |
| 31 | + |
| 32 | + constexpr NumericType gridDelta = 0.01 * (1. + 1e-12); |
| 33 | + BoundaryType boundaryConds[D] = {BoundaryType::REFLECTIVE_BOUNDARY, |
| 34 | + BoundaryType::REFLECTIVE_BOUNDARY, |
| 35 | + BoundaryType::INFINITE_BOUNDARY}; |
| 36 | + |
| 37 | + auto mask = |
| 38 | + SmartPointer<GDSGeometry<NumericType, D>>::New(gridDelta, boundaryConds); |
| 39 | + mask->setBoundaryPadding(0.1, 0.1); |
| 40 | + GDSReader<NumericType, D>(mask, params.get<std::string>("gdsFile")).apply(); |
| 41 | + |
| 42 | + // geometry setup |
| 43 | + auto geometry = Domain<NumericType, D>::New(); |
| 44 | + auto maskLS = mask->layerToLevelSet(0, 0.0, 0.18); |
| 45 | + geometry->insertNextLevelSetAsMaterial(maskLS, Material::Mask); |
| 46 | + MakePlane<NumericType, D>(geometry, 0.0, Material::Si, true).apply(); |
| 47 | + |
| 48 | + auto modelParams = HBrO2Etching<NumericType, D>::defaultParameters(); |
| 49 | + modelParams.ionFlux = params.get("ionFlux"); |
| 50 | + modelParams.etchantFlux = params.get("etchantFlux"); |
| 51 | + modelParams.passivationFlux = params.get("oxygenFlux"); |
| 52 | + modelParams.Ions.meanEnergy = params.get("meanEnergy"); |
| 53 | + modelParams.Ions.sigmaEnergy = params.get("sigmaEnergy"); |
| 54 | + modelParams.Ions.exponent = params.get("ionExponent"); |
| 55 | + modelParams.Ions.n_l = 200; |
| 56 | + auto model = SmartPointer<HBrO2Etching<NumericType, D>>::New(modelParams); |
| 57 | + |
| 58 | + // Process setup |
| 59 | + Process<NumericType, D> process; |
| 60 | + process.setDomain(geometry); |
| 61 | + process.setProcessModel(model); |
| 62 | + process.setCoverageDeltaThreshold(1e-4); |
| 63 | + process.setNumberOfRaysPerPoint(static_cast<int>(params.get("raysPerPoint"))); |
| 64 | + process.setProcessDuration(params.get("processTime")); |
| 65 | + process.setIntegrationScheme(util::convertIntegrationScheme( |
| 66 | + params.get<std::string>("integrationScheme"))); |
| 67 | + |
| 68 | + // print initial surface |
| 69 | + geometry->saveSurfaceMesh("DRAM_Initial.vtp"); |
| 70 | + |
| 71 | + const int numSteps = params.get("numSteps"); |
| 72 | + for (int i = 0; i < numSteps; ++i) { |
| 73 | + process.apply(); |
| 74 | + geometry->saveSurfaceMesh("DRAM_Etched_" + std::to_string(i + 1) + ".vtp"); |
| 75 | + } |
| 76 | + |
| 77 | + geometry->saveHullMesh("DRAM_Final"); |
| 78 | + |
| 79 | + return 0; |
| 80 | +} |
0 commit comments