Skip to content
Snippets Groups Projects
Commit 8652848d authored by Tomas Sobotik's avatar Tomas Sobotik
Browse files

Minor improvements to scheme

parent a8d4fd6d
No related branches found
No related tags found
No related merge requests found
...@@ -1176,15 +1176,15 @@ void tnlParallelEikonalSolver<SchemeHost, SchemeDevice, Device, double, int>::ru ...@@ -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) for(unsigned int s = blockDim.x*blockDim.y/2; s>0; s>>=1)
{ {
if( l < s ) //if( l < s )
sharedRes[l] = Max(sharedRes[l],sharedRes[l+s]); // sharedRes[l] = Max(sharedRes[l],sharedRes[l+s]);
if(l >= blockDim.x*blockDim.y - s) if(l >= blockDim.x*blockDim.y - s)
sharedTau[l] = Min(sharedTau[l],sharedTau[l-s]); sharedTau[l] = Min(sharedTau[l],sharedTau[l-s]);
__syncthreads(); __syncthreads();
} }
if(l==0) if(l==0)
{ {
maxResidue=sharedRes[l]; //maxResidue=sharedRes[l];
currentTau=sharedTau[blockDim.x*blockDim.y - 1]; currentTau=sharedTau[blockDim.x*blockDim.y - 1];
/*if( this -> cflCondition * maxResidue != 0.0) /*if( this -> cflCondition * maxResidue != 0.0)
currentTau = Min(this -> cflCondition / maxResidue, currentTau);*/ currentTau = Min(this -> cflCondition / maxResidue, currentTau);*/
......
...@@ -323,35 +323,44 @@ Real parallelGodunovEikonalScheme< tnlGrid< 2, MeshReal, Device, MeshIndex >, Re ...@@ -323,35 +323,44 @@ Real parallelGodunovEikonalScheme< tnlGrid< 2, MeshReal, Device, MeshIndex >, Re
//RealType acc = hx*hy*hx*hy; //RealType acc = hx*hy*hx*hy;
RealType nabla, xb, xf, yb, yf, signui; RealType nabla, signui;
signui = sign(u[cellIndex],epsilon); signui = sign(u[cellIndex],epsilon);
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
//printf("%d : %d ;;;; %d : %d , %f \n",threadIdx.x, mesh.getDimensions().x() , threadIdx.y,mesh.getDimensions().y(), epsilon ); //printf("%d : %d ;;;; %d : %d , %f \n",threadIdx.x, mesh.getDimensions().x() , threadIdx.y,mesh.getDimensions().y(), epsilon );
#endif #endif
RealType xb = u[cellIndex];
RealType xf = -u[cellIndex];
RealType yb = u[cellIndex];
RealType yf = -u[cellIndex];
if(coordinates.x() == mesh.getDimensions().x() - 1) 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 else
xf = ((u[mesh.template getCellNextToCell<1,0>( cellIndex )] - u[cellIndex])/hx); xf += u[mesh.template getCellNextToCell<1,0>( cellIndex )];
if(coordinates.x() == 0) if(coordinates.x() == 0)
xb = ((u[cellIndex] - u[mesh.template getCellNextToCell<1,0>( cellIndex )])/hx); xb -= u[mesh.template getCellNextToCell<1,0>( cellIndex )];
else 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) 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 else
yf = ((u[mesh.template getCellNextToCell<0,1>( cellIndex )] - u[cellIndex])/hy); yf += u[mesh.template getCellNextToCell<0,1>( cellIndex )];
if(coordinates.y() == 0) if(coordinates.y() == 0)
yb = ((u[cellIndex] - u[mesh.template getCellNextToCell<0,1>( cellIndex )])/hy); yb -= u[mesh.template getCellNextToCell<0,1>( cellIndex )];
else 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) if(signui > 0.0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment