User: rhaas Date: 2014/04/15 02:48 PM
Modified: /trunk/src/ GRHydro_PPM.cc, GRHydro_PPMReconstruct_drv_opt.cc
Log: GRHydro: adjust loop bounds in C++ PPM to match F90 code
some are just affecting data in ghost zones, some are required
File Changes:
Directory: /trunk/src/ ======================
File [modified]: GRHydro_PPM.cc Delta lines: +1 -1 =================================================================== --- trunk/src/GRHydro_PPM.cc 2014-04-15 19:48:44 UTC (rev 609) +++ trunk/src/GRHydro_PPM.cc 2014-04-15 19:48:47 UTC (rev 610) @@ -316,7 +316,7 @@ } } // flattening
- for(int i=2;i<nx-2;i++) { + for(int i=GRHydro_stencil-1;i<nx-GRHydro_stencil+1;i++) { monotonize(rhominus,rho,rhoplus,i); monotonize(epsminus,eps,epsplus,i); monotonize(velxminus,velx,velxplus,i);
File [modified]: GRHydro_PPMReconstruct_drv_opt.cc Delta lines: +8 -6 =================================================================== --- trunk/src/GRHydro_PPMReconstruct_drv_opt.cc 2014-04-15 19:48:44 UTC (rev 609) +++ trunk/src/GRHydro_PPMReconstruct_drv_opt.cc 2014-04-15 19:48:47 UTC (rev 610) @@ -269,9 +269,11 @@ if (flux_direction[0] == 1){ // !$OMP PARALLEL DO PRIVATE(i, j, k)
- for(k = GRHydro_stencil-1; k < nz - GRHydro_stencil; k++) { - for(j = GRHydro_stencil-1; j < ny - GRHydro_stencil; j++) { + for(k = GRHydro_stencil-1; k < nz - GRHydro_stencil + 1; k++) { + for(j = GRHydro_stencil-1; j < ny - GRHydro_stencil + 1; j++) {
+ // TODO: there is no need to slice in the x direction, we can just point into the array + //For reference, the slicing call is: //void oned_slice(int npt,int nstart,int nstride,CCTK_REAL* vec3d,CCTK_REAL* vec1d) nstart=nx*(j+k*ny); @@ -361,8 +363,8 @@
// !$OMP PARALLEL DO PRIVATE(i, j, k) //Make sure to doublecheck the bounds here! - for(k = GRHydro_stencil-1; k < nz - GRHydro_stencil; k++) { - for(j = GRHydro_stencil-1; j < nx - GRHydro_stencil; j++) { + for(k = GRHydro_stencil-1; k < nz - GRHydro_stencil + 1; k++) { + for(j = GRHydro_stencil-1; j < nx - GRHydro_stencil + 1; j++) {
nstart=j+k*nx*ny;
@@ -453,8 +455,8 @@
// !$OMP PARALLEL DO PRIVATE(i, j, k) //Make sure to doublecheck the bounds here! - for(k = GRHydro_stencil-1; k < ny - GRHydro_stencil; k++) { - for(j = GRHydro_stencil-1; j < nx - GRHydro_stencil; j++) { + for(k = GRHydro_stencil-1; k < ny - GRHydro_stencil + 1; k++) { + for(j = GRHydro_stencil-1; j < nx - GRHydro_stencil + 1; j++) {
nstart=j+k*nx;
commits@lists.einsteintoolkit.org