[Commits] [svn:einsteintoolkit] GRHydro/trunk/src/ (Rev. 615)
rhaas at tapir.caltech.edu
rhaas at tapir.caltech.edu
Tue Apr 15 14:48:59 CDT 2014
User: rhaas
Date: 2014/04/15 02:48 PM
Modified:
/trunk/src/
GRHydro_PPMReconstruct_drv_opt.cc
Log:
GRHydro: support array padding in optimized C++ PPM
File Changes:
Directory: /trunk/src/
======================
File [modified]: GRHydro_PPMReconstruct_drv_opt.cc
Delta lines: +11 -24
===================================================================
--- trunk/src/GRHydro_PPMReconstruct_drv_opt.cc 2014-04-15 19:48:56 UTC (rev 614)
+++ trunk/src/GRHydro_PPMReconstruct_drv_opt.cc 2014-04-15 19:48:59 UTC (rev 615)
@@ -65,13 +65,12 @@
Bprim=Bvec;
}
- int nx=cctk_lsh[0];
- int ny=cctk_lsh[1];
- int nz=cctk_lsh[2];
- int nxy=nx*ny;
- int nxyz=nxy*nz;
+ const int nx=cctk_ash[0];
+ const int ny=cctk_ash[1];
+ const int nz=cctk_ash[2];
+ const int nxy=nx*ny;
+ const int nxyz=nxy*nz;
- //Is there a more efficient way?
int nmax_xyz=MAX(nx,MAX(ny,nz));
int type_bitsx,type_bitsy,type_bitsz;
@@ -306,11 +305,7 @@
CCTK_WARN(0, "Someone needs to figure out which variables to pass for Avec");
}
- //This needs to be fixed into a loop for the the template version!
- //WE'll need booleans arguments corresponding to the following
- //ppm1d_cxx<do_temp,do_ye,do_mhd,clean_divergence,ppm_detect>
-
- ppm1d_cxx_func(nx,CCTK_DELTA_SPACE(0),
+ ppm1d_cxx_func(cctk_lsh[0],CCTK_DELTA_SPACE(0),
&rho1d[0],&velx1d[0],&vely1d[0],&velz1d[0],&eps1d[0],&press1d[0],&temp1d[0],
&ye1d[0],&Bvcx1d[0],&Bvcy1d[0],&Bvcz1d[0],&psidc1d[0],
&rho1d_minus[0],&velx1d_minus[0],&vely1d_minus[0],&velz1d_minus[0],&eps1d_minus[0],&temp1d_minus[0],
@@ -354,7 +349,7 @@
}
}
for (i=0; i<nx; i++) {
- SpaceMask_SetStateBits(space_mask, i+j*nx+k*nx*ny, type_bitsx, not_trivialx);
+ SpaceMask_SetStateBits(space_mask, CCTK_GFINDEX3D(cctkGH, i,j,k), type_bitsx, not_trivialx);
}
}
}
@@ -396,12 +391,8 @@
CCTK_WARN(0, "Someone needs to figure out which variables to pass for Avec");
}
- //This needs to be fixed into a loop for the the template version!
- //WE'll need booleans arguments corresponding to the following
- //ppm1d_cxx<do_temp,do_ye,do_mhd,clean_divergence,ppm_detect>
-
ppm1d_cxx_func
- (ny,CCTK_DELTA_SPACE(1),
+ (cctk_lsh[1],CCTK_DELTA_SPACE(1),
&rho1d[0],&vely1d[0],&velz1d[0],&velx1d[0],&eps1d[0],&press1d[0],&temp1d[0],
&ye1d[0],&Bvcy1d[0],&Bvcz1d[0],&Bvcx1d[0],&psidc1d[0],
&rho1d_minus[0],&vely1d_minus[0],&velz1d_minus[0],&velx1d_minus[0],&eps1d_minus[0],&temp1d_minus[0],
@@ -445,7 +436,7 @@
}
}
for (i=0; i<ny; i++) {
- SpaceMask_SetStateBits(space_mask, j+i*nx+k*nx*ny, type_bitsy, not_trivialy);
+ SpaceMask_SetStateBits(space_mask, CCTK_GFINDEX3D(cctkGH, j,i,k), type_bitsy, not_trivialy);
}
}
@@ -488,12 +479,8 @@
CCTK_WARN(0, "Someone needs to figure out which variables to pass for Avec");
}
- //This needs to be fixed into a loop for the the template version!
- //WE'll need booleans arguments corresponding to the following
- //ppm1d_cxx<do_temp,do_ye,do_mhd,clean_divergence,ppm_detect>
-
ppm1d_cxx_func
- (nz,CCTK_DELTA_SPACE(2),
+ (cctk_lsh[2],CCTK_DELTA_SPACE(2),
&rho1d[0],&velz1d[0],&velx1d[0],&vely1d[0],&eps1d[0],&press1d[0],&temp1d[0],
&ye1d[0],&Bvcz1d[0],&Bvcx1d[0],&Bvcy1d[0],&psidc1d[0],
&rho1d_minus[0],&velz1d_minus[0],&velx1d_minus[0],&vely1d_minus[0],&eps1d_minus[0],&temp1d_minus[0],
@@ -537,7 +524,7 @@
}
}
for (i=0; i<nz; i++) {
- SpaceMask_SetStateBits(space_mask, j+k*nx+i*nx*ny, type_bitsz, not_trivialz);
+ SpaceMask_SetStateBits(space_mask, CCTK_GFINDEX3D(cctkGH, j,k,i), type_bitsz, not_trivialz);
}
}
More information about the Commits
mailing list