From 22067ea15aea14b60235645b0f9dc00cb7c7285b Mon Sep 17 00:00:00 2001 From: James McClure Date: Sat, 16 Apr 2016 19:34:03 -0400 Subject: [PATCH] Fixed bugs in lbpm_segmented_pp.cpp --- tests/lbpm_segmented_pp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/lbpm_segmented_pp.cpp b/tests/lbpm_segmented_pp.cpp index 10bc57c1..ceed79ee 100644 --- a/tests/lbpm_segmented_pp.cpp +++ b/tests/lbpm_segmented_pp.cpp @@ -31,8 +31,8 @@ inline double minmod(double &a, double &b){ double value; value = a; - if ( if a*b < 0.0) value=0.0; - else if (fabs(a) > fabs(b) value = b; + if ( a*b < 0.0) value=0.0; + else if (fabs(a) > fabs(b)) value = b; return value; } @@ -66,9 +66,9 @@ inline double Eikonal(DoubleArray &Distance, char *ID, Domain &Dm, int timesteps fillHalo fillData(Dm.Comm, Dm.rank_info,xdim,ydim,zdim,1,1,1,0,1); // Arrays to store the second derivatives - DoubleArray Dxx(Nx,Ny,Nz); - DoubleArray Dyy(Nx,Ny,Nz); - DoubleArray Dzz(Nx,Ny,Nz); + DoubleArray Dxx(Dm.Nx,Dm.Ny,Dm.Nz); + DoubleArray Dyy(Dm.Nx,Dm.Ny,Dm.Nz); + DoubleArray Dzz(Dm.Nx,Dm.Ny,Dm.Nz); int count = 0; while (count < timesteps){ @@ -159,7 +159,7 @@ inline double Eikonal(DoubleArray &Distance, char *ID, Domain &Dm, int timesteps } } - MPI_Allreduce(&LocalVar,&GlobalVar,1,MPI_DOUBLE,MPI_SUM,Dm.comm); + MPI_Allreduce(&LocalVar,&GlobalVar,1,MPI_DOUBLE,MPI_SUM,Dm.Comm); GlobalVar /= (Dm.Nx-2)*(Dm.Ny-2)*(Dm.Nz-2)*Dm.nprocx*Dm.nprocy*Dm.nprocz; count++;