nearly finished gui code. adaptions / bugfixes.
[physik/nlsop.git] / nlsop_client.c
index 6467827..6ac9c92 100644 (file)
 #define MAKE_AMORPH(N) *(N)|=AMORPH
 #define MAKE_CRYST(N) *(N)&=~AMORPH
 
 #define MAKE_AMORPH(N) *(N)|=AMORPH
 #define MAKE_CRYST(N) *(N)&=~AMORPH
 
-#define NLSOP_CLIENT 'c'
-#define NLSOP_NJOB 'N'
-#define NLSOP_CJOB 'C'
-
 /* globals */
 
 char p_file[MAX_CHARS];
 /* globals */
 
 char p_file[MAX_CHARS];
@@ -205,31 +201,29 @@ int distrib_c(d3_lattice *d3_l,info *my_info,int step,u32 rj_m,u32 *rj_g)
        }
       }
      }
        }
       }
      }
-     if(my_info->z_diff)
+     /* diff in z direction */
+     if(k!=0)
      {
      {
-      if(k!=0)
+      off=i+j*d3_l->max_x+(k-1)*d3_l->max_x*d3_l->max_y;
+      carry=0;
+      if(!*(d3_l->status+off)&AMORPH) carry=(int)(my_info->dr_ac*(*(d3_l->extra+off)));
+      if(carry!=0)
       {
       {
-       off=i+j*d3_l->max_x+(k-1)*d3_l->max_x*d3_l->max_y;
-       carry=0;
-       if(!*(d3_l->status+off)&AMORPH) carry=(int)(my_info->dr_ac*(*(d3_l->extra+off)));
-       if(carry!=0)
-       {
-        *(d3_l->extra+off)-=carry;
-        *(d3_l->extra+offset)+=carry;
-       }
+       *(d3_l->extra+off)-=carry;
+       *(d3_l->extra+offset)+=carry;
       }
       }
-      if(k!=d3_l->max_z-1)
+     }
+     if(k!=d3_l->max_z-1)
+     {
+      off=i+j*d3_l->max_x+(k+1)*d3_l->max_x*d3_l->max_y;
+      carry=0;
+      if(!*(d3_l->status+off)&AMORPH) carry=(int)(my_info->dr_ac*(*(d3_l->extra+off)));
+      if(carry!=0)
       {
       {
-       off=i+j*d3_l->max_x+(k+1)*d3_l->max_x*d3_l->max_y;
-       carry=0;
-       if(!*(d3_l->status+off)&AMORPH) carry=(int)(my_info->dr_ac*(*(d3_l->extra+off)));
-       if(carry!=0)
-       {
-        *(d3_l->extra+off)-=carry;
-        *(d3_l->extra+offset)+=carry;
-       }
+       *(d3_l->extra+off)-=carry;
+       *(d3_l->extra+offset)+=carry;
       }
       }
-     }  
+     }
     }
    } /* for z */
   } /* for y */
     }
    } /* for z */
   } /* for y */
@@ -417,13 +411,11 @@ int get_data_and_calc(t_event *event,void *allineed) {
   u32 *nel_z;
   u32 x_c,y_c,z_c;
   int i,j;
   u32 *nel_z;
   u32 x_c,y_c,z_c;
   int i,j;
-  int resave;
   int c_step;
   unsigned char data[256];
 
   t_net *net;
 
   int c_step;
   unsigned char data[256];
 
   t_net *net;
 
-  resave=RESAVE;
   c_step=0;
   ne_max=0;
   ip_max=0;
   c_step=0;
   ne_max=0;
   ip_max=0;
@@ -516,12 +508,12 @@ int get_data_and_calc(t_event *event,void *allineed) {
       process_cell(&d3_l,x_c,y_c,z_c,&my_info,nel_z[z_c]);
     }
     distrib_c(&d3_l,&my_info,i,ip_max,c_profile);
       process_cell(&d3_l,x_c,y_c,z_c,&my_info,nel_z[z_c]);
     }
     distrib_c(&d3_l,&my_info,i,ip_max,c_profile);
-    if(i%resave==0 && i!=0) {
+    i++;
+    if(i%my_info.save_rate==0) {
       dc=DC_OK;
       send_data(0);
       dc=DC_QUIT;
     }
       dc=DC_OK;
       send_data(0);
       dc=DC_QUIT;
     }
-    i++;
     if(i%my_info.s_rate==0) sputter(&d3_l);
   }
 
     if(i%my_info.s_rate==0) sputter(&d3_l);
   }