#include #include #ifdef USE_GRID CPS_START_NAMESPACE bool FgridBase::grid_initted=false; //------------------------------------------------------------------ /*! \param five The 5-dimensional field. \param four The 4-dimensional field. \param s_u The global 5th direction (s) coordinate where the upper two components (right chirality) of the 5-dim. field take the values of those of the 4-dim. field. \param s_l The global 5th direction (s) coordinate where the lower two components (left chirality) of the 5-dim. field take the values of those of the 4-dim. field. \post The 5-dim field is zero everywhere except where the global 5th direction coordinate (s) is \a s_l or \a s_u, where it takes the values explained above. */ //------------------------------------------------------------------ void FgridBase::Ffour2five(Vector *five, Vector *four, int s_u, int s_l, int Ncb) { int x; int i; Float *field_4D; Float *field_5D; char *fname = "Ffour2five(V*,V*,i,i)"; VRB.Func(cname,fname); //------------------------------------------------------------------ // Initializations //------------------------------------------------------------------ size_t f_size = GJP.VolNodeSites() * FsiteSize()*Ncb/2; if(GJP.Gparity()) f_size*=2; int ls = GJP.SnodeSites(); int vol_4d = GJP.VolNodeSites()*Ncb/2; int ls_stride = 24 * vol_4d; if(GJP.Gparity()) ls_stride*=2; int s_u_local = s_u % GJP.SnodeSites(); int s_l_local = s_l % GJP.SnodeSites(); int s_u_node = s_u / GJP.SnodeSites(); int s_l_node = s_l / GJP.SnodeSites(); //------------------------------------------------------------------ // Set *five using the 4D field *four. //------------------------------------------------------------------ // Set all components of the 5D field to zero. //--------------------------------------------------------------- field_5D = (Float *) five; for(i=0; i 1) { Float sum; field_4D = (Float *) four; for(i=0; i