88using namespace viennaps ;
99constexpr int D = 2 ;
1010using NumericType = double ;
11+ const std::string name = " boschProcessSimulate_" ;
1112
12- void etch (SmartPointer<Domain<NumericType, D>> domain,
13- util::Parameters ¶ms ) {
13+ void etch (SmartPointer<Domain<NumericType, D>> domain, util::Parameters ¶ms,
14+ int &n ) {
1415 std::cout << " - Etching - " << std::endl;
1516 auto etchModel = SmartPointer<MultiParticleProcess<NumericType, D>>::New ();
1617 etchModel->addNeutralParticle (params.get (" neutralStickingProbability" ));
@@ -29,10 +30,11 @@ void etch(SmartPointer<Domain<NumericType, D>> domain,
2930 return rate;
3031 });
3132 Process<NumericType, D>(domain, etchModel, params.get (" etchTime" )).apply ();
33+ domain->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
3234}
3335
3436void punchThrough (SmartPointer<Domain<NumericType, D>> domain,
35- util::Parameters ¶ms) {
37+ util::Parameters ¶ms, int &n ) {
3638 std::cout << " - Punching through - " << std::endl;
3739 NumericType depositionThickness = params.get (" depositionThickness" );
3840
@@ -41,22 +43,25 @@ void punchThrough(SmartPointer<Domain<NumericType, D>> domain,
4143 -depositionThickness, 1 . /* sticking */ , params.get (" ionSourceExponent" ),
4244 Material::Mask);
4345 Process<NumericType, D>(domain, depoRemoval, 1 .).apply ();
46+ domain->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
4447}
4548
4649void deposit (SmartPointer<Domain<NumericType, D>> domain,
47- util::Parameters ¶ms) {
50+ util::Parameters ¶ms, int &n ) {
4851 std::cout << " - Deposition - " << std::endl;
4952 NumericType depositionThickness = params.get (" depositionThickness" );
5053 NumericType depositionSticking = params.get (" depositionStickingProbability" );
5154 domain->duplicateTopLevelSet (Material::Polymer);
5255 auto model = SmartPointer<SingleParticleProcess<NumericType, D>>::New (
5356 depositionThickness, depositionSticking);
5457 Process<NumericType, D>(domain, model, 1 .).apply ();
58+ domain->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
5559}
5660
57- void ash (SmartPointer<Domain<NumericType, D>> domain) {
61+ void ash (SmartPointer<Domain<NumericType, D>> domain, int &n ) {
5862 domain->removeTopLevelSet ();
5963 domain->removeStrayPoints ();
64+ domain->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
6065}
6166
6267int main (int argc, char **argv) {
@@ -87,25 +92,18 @@ int main(int argc, char **argv) {
8792 params.get (" maskHeight" ))
8893 .apply ();
8994
90- const NumericType depositionThickness = params.get (" depositionThickness" );
9195 const int numCycles = params.get <int >(" numCycles" );
92- const std::string name = " boschProcessSimulate_" ;
9396
9497 int n = 0 ;
9598 geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
96- etch (geometry, params);
97- geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
99+ etch (geometry, params, n);
98100
99101 for (int i = 0 ; i < numCycles; ++i) {
100102 std::cout << " Cycle " << i + 1 << std::endl;
101- deposit (geometry, params);
102- geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
103- punchThrough (geometry, params);
104- geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
105- etch (geometry, params);
106- geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
107- ash (geometry);
108- geometry->saveSurfaceMesh (name + std::to_string (n++) + " .vtp" );
103+ deposit (geometry, params, n);
104+ punchThrough (geometry, params, n);
105+ etch (geometry, params, n);
106+ ash (geometry, n);
109107 }
110108
111109 geometry->saveVolumeMesh (name + " final" );
0 commit comments