diff --git a/examples/hamilton-jacobi-parallel/tnlParallelEikonalSolver_impl.h b/examples/hamilton-jacobi-parallel/tnlParallelEikonalSolver_impl.h index 11272d8ecbfc592e863057e957aeb97784f52e56..8e12f82ceb7d2df74c205baad797826fc4878dbd 100644 --- a/examples/hamilton-jacobi-parallel/tnlParallelEikonalSolver_impl.h +++ b/examples/hamilton-jacobi-parallel/tnlParallelEikonalSolver_impl.h @@ -1176,15 +1176,15 @@ void tnlParallelEikonalSolver<SchemeHost, SchemeDevice, Device, double, int>::ru for(unsigned int s = blockDim.x*blockDim.y/2; s>0; s>>=1) { - if( l < s ) - sharedRes[l] = Max(sharedRes[l],sharedRes[l+s]); + //if( l < s ) + // sharedRes[l] = Max(sharedRes[l],sharedRes[l+s]); if(l >= blockDim.x*blockDim.y - s) sharedTau[l] = Min(sharedTau[l],sharedTau[l-s]); __syncthreads(); } if(l==0) { - maxResidue=sharedRes[l]; + //maxResidue=sharedRes[l]; currentTau=sharedTau[blockDim.x*blockDim.y - 1]; /*if( this -> cflCondition * maxResidue != 0.0) currentTau = Min(this -> cflCondition / maxResidue, currentTau);*/ diff --git a/src/operators/godunov-eikonal/parallelGodunovEikonal2D_impl.h b/src/operators/godunov-eikonal/parallelGodunovEikonal2D_impl.h index 31d6ca7982d1afce85468e7e2c45600cc577c0de..a5b23b9f1bbe1b8ebf3cf422b83b9c183bd5f45f 100644 --- a/src/operators/godunov-eikonal/parallelGodunovEikonal2D_impl.h +++ b/src/operators/godunov-eikonal/parallelGodunovEikonal2D_impl.h @@ -323,35 +323,44 @@ Real parallelGodunovEikonalScheme< tnlGrid< 2, MeshReal, Device, MeshIndex >, Re //RealType acc = hx*hy*hx*hy; - RealType nabla, xb, xf, yb, yf, signui; + RealType nabla, signui; signui = sign(u[cellIndex],epsilon); + #ifdef HAVE_CUDA //printf("%d : %d ;;;; %d : %d , %f \n",threadIdx.x, mesh.getDimensions().x() , threadIdx.y,mesh.getDimensions().y(), epsilon ); #endif + RealType xb = u[cellIndex]; + RealType xf = -u[cellIndex]; + RealType yb = u[cellIndex]; + RealType yf = -u[cellIndex]; if(coordinates.x() == mesh.getDimensions().x() - 1) - xf = ((u[mesh.template getCellNextToCell<-1,0>( cellIndex )] - u[cellIndex])/hx); + xf += u[mesh.template getCellNextToCell<-1,0>( cellIndex )]; else - xf = ((u[mesh.template getCellNextToCell<1,0>( cellIndex )] - u[cellIndex])/hx); + xf += u[mesh.template getCellNextToCell<1,0>( cellIndex )]; if(coordinates.x() == 0) - xb = ((u[cellIndex] - u[mesh.template getCellNextToCell<1,0>( cellIndex )])/hx); + xb -= u[mesh.template getCellNextToCell<1,0>( cellIndex )]; else - xb = ((u[cellIndex] - u[mesh.template getCellNextToCell<-1,0>( cellIndex )])/hx); + xb -= u[mesh.template getCellNextToCell<-1,0>( cellIndex )]; if(coordinates.y() == mesh.getDimensions().y() - 1) - yf = ((u[mesh.template getCellNextToCell<0,-1>( cellIndex )] - u[cellIndex])/hy); + yf += u[mesh.template getCellNextToCell<0,-1>( cellIndex )]; else - yf = ((u[mesh.template getCellNextToCell<0,1>( cellIndex )] - u[cellIndex])/hy); + yf += u[mesh.template getCellNextToCell<0,1>( cellIndex )]; if(coordinates.y() == 0) - yb = ((u[cellIndex] - u[mesh.template getCellNextToCell<0,1>( cellIndex )])/hy); + yb -= u[mesh.template getCellNextToCell<0,1>( cellIndex )]; else - yb = ((u[cellIndex] - u[mesh.template getCellNextToCell<0,-1>( cellIndex )])/hy); + yb -= u[mesh.template getCellNextToCell<0,-1>( cellIndex )]; + xb /= hx; + xf /= hx; + yb /= hy; + yf /= hy; if(signui > 0.0) {