aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2014-04-15 19:48:47 +0000
committerrhaas <rhaas@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2014-04-15 19:48:47 +0000
commit265d03d0aab057f5305949dc2ebcc058a982860e (patch)
tree2c5ad8292702af6e34e96fb76c02afed753b3f23
parente704df2771e72ccdf9046967bb95545ddd735e67 (diff)
GRHydro: adjust loop bounds in C++ PPM to match F90 code
some are just affecting data in ghost zones, some are required git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@610 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
-rw-r--r--src/GRHydro_PPM.cc2
-rw-r--r--src/GRHydro_PPMReconstruct_drv_opt.cc14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/GRHydro_PPM.cc b/src/GRHydro_PPM.cc
index fe6c265..1c575db 100644
--- a/src/GRHydro_PPM.cc
+++ b/src/GRHydro_PPM.cc
@@ -316,7 +316,7 @@ void GRHydro_ppm1d_cxx(const int nx,
}
} // 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);
diff --git a/src/GRHydro_PPMReconstruct_drv_opt.cc b/src/GRHydro_PPMReconstruct_drv_opt.cc
index 7ed18de..7629019 100644
--- a/src/GRHydro_PPMReconstruct_drv_opt.cc
+++ b/src/GRHydro_PPMReconstruct_drv_opt.cc
@@ -269,9 +269,11 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res
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 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res
// !$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 @@ void CCTK_FNAME(GRHydro_PPMReconstruct_drv_opt)(cGH const * const restrict & res
// !$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;