Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

mdp_topologies.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 // //////////////////////////////////////////////////////
00014 // Basic topologies:
00015 // //////////////////////////////////////////////////////
00016 
00017 void torus_topology(int mu, 
00018                     int *x_dw, 
00019                     int *x, 
00020                     int *x_up, 
00021                     int ndim, 
00022                     int *nx) {
00023   for(int nu=0; nu<ndim; nu++) if(nu==mu) {
00024     x_dw[mu]=(x[mu]-1+nx[mu]) % nx[mu];
00025     x_up[mu]=(x[mu]+1) % nx[mu];
00026   } else x_up[nu]=x_dw[nu]=x[nu];
00027 }
00028 
00029 void box_topology(int mu, 
00030                   int *x_dw, 
00031                   int *x, 
00032                   int *x_up, 
00033                   int ndim, 
00034                   int *nx) { 
00035   torus_topology(mu,x_dw,x,x_up,ndim,nx);
00036   if(x[mu]==0)        x_dw[mu]=x[mu];
00037   if(x[mu]==nx[mu]-1) x_up[mu]=x[mu];
00038 } 
00039 
00040 void moebious_topolgy(int mu, 
00041                       int *x_dw, 
00042                       int *x, 
00043                       int *x_up, 
00044                       int ndim, 
00045                       int *nx) {
00046   torus_topology(mu,x_dw,x,x_up,ndim,nx);
00047   if(mu==0) {
00048     if(x[0]==0)       x_dw[1]=nx[1]-x[1]-1;
00049     if(x[0]==nx[0]-1) x_up[1]=nx[1]-x[1]-1;
00050   }
00051 }

Generated on Sun Feb 27 15:12:21 2005 by  doxygen 1.4.1