optimized defaults, added sputter condition
[physik/nlsop.git] / nlsop.c
diff --git a/nlsop.c b/nlsop.c
index b8c9e28..146c4ee 100644 (file)
--- a/nlsop.c
+++ b/nlsop.c
@@ -1140,7 +1140,7 @@ int main(int argc,char **argv)
  d3_lattice d3_l;
  info my_info;
  unsigned char mode;
//double c_ratio;
+ double c_ratio;
 #ifdef USE_DFB_API
  int max_extra;
 #endif
@@ -1148,6 +1148,7 @@ int main(int argc,char **argv)
  u32 *n_e_loss;
  u32 ne_max,ip_max;
  u32 nel_z;
+ unsigned char do_sputter;
 
  d3_l.max_x=_X;
  d3_l.max_y=_Y;
@@ -1182,6 +1183,7 @@ int main(int argc,char **argv)
  sai=0;
  sacl=0;
  eacl=0;
+ do_sputter=1;
 
 #ifdef MORE_PRINTF
  printf("reading argv ...");
@@ -1407,16 +1409,14 @@ int main(int argc,char **argv)
   if(c_profile[d3_l.max_z-1]!=0)
   {
    printf("max_z (%d) too small - sputtering not possible\n",d3_l.max_z);
- #ifndef DEBUG_RAND
-   return -1;
- #endif
+   do_sputter=0;
   }
   /* calculate ratio of c_simwindow / c_total */
-  //if(get_c_ratio(&c_ratio,p_file,&my_info,&d3_l)!=1)
-  //{
-  // puts("failed calculating ratio");
-  // return -1;
-  //}
+  if(!do_sputter)
+  {
+   get_c_ratio(&c_ratio,p_file,&my_info,&d3_l);
+   printf("calculated c ratio: %f\n",c_ratio);
+  }
 
   /* sputtering realy possible ?*/
   if(n_e_loss[d3_l.max_z-1]!=0)
@@ -1487,7 +1487,7 @@ int main(int argc,char **argv)
 #endif
    }
    i++;
-   if(i%my_info.s_rate==0) sputter(&d3_l);
+   if((do_sputter)&(i%my_info.s_rate==0)) sputter(&d3_l);
   }
  }