Skip to content
Snippets Groups Projects
Commit 53cb64f4 authored by Célestin Marot's avatar Célestin Marot
Browse files

much faster work-around

parent 22036aab
No related branches found
No related tags found
No related merge requests found
......@@ -517,6 +517,8 @@ static inline HXTStatus walking2Cavity(HXTMesh* mesh, HXTPartition* partition, u
// we should pass in orient3d mode here :p
unsigned index = 4;
unsigned outside = 0;
unsigned wantToGoInOtherPartition = 0;
unsigned randomU = hxtReproducibleLCG(&seed);
for (unsigned j=0; j<4; j++)
{
......@@ -534,6 +536,7 @@ static inline HXTStatus walking2Cavity(HXTMesh* mesh, HXTPartition* partition, u
// vtaCoord[0], vtaCoord[1], vtaCoord[2]);
// }
outside = 1;
uint32_t node = mesh->tetrahedra.node[curNeigh[i]];
if(node==HXT_GHOST_VERTEX) {
......@@ -541,11 +544,14 @@ static inline HXTStatus walking2Cavity(HXTMesh* mesh, HXTPartition* partition, u
return HXT_STATUS_OK;
}
if(vertexOutOfPartition(vertices, node, rel, partition->startDist))
return HXT_STATUS_CONFLICT;
index=i;
break;
if(vertexOutOfPartition(vertices, node, rel, partition->startDist)){
if(wantToGoInOtherPartition++ > 1000)
return HXT_STATUS_CONFLICT;
}
else {
index=i;
break;
}
}
}
}
......@@ -555,10 +561,13 @@ static inline HXTStatus walking2Cavity(HXTMesh* mesh, HXTPartition* partition, u
const double* __restrict__ b = vertices[curNode[1]].coord;
const double* __restrict__ c = vertices[curNode[2]].coord;
const double* __restrict__ d = vertices[curNode[3]].coord;
if( (orient3d(a,b,c,vtaCoord)>=0) +
(orient3d(a,b,vtaCoord,d)>=0) +
(orient3d(a,vtaCoord,c,d)>=0) +
(orient3d(vtaCoord,b,c,d)>=0)>2 ){
if(outside) {
return HXT_STATUS_CONFLICT;
}
else if( (orient3d(a,b,c,vtaCoord)>=0) +
(orient3d(a,b,vtaCoord,d)>=0) +
(orient3d(a,vtaCoord,c,d)>=0) +
(orient3d(vtaCoord,b,c,d)>=0)>2 ){
*curTet = nextTet;
return HXT_STATUS_DOUBLE_PT;
}
......@@ -566,12 +575,6 @@ static inline HXTStatus walking2Cavity(HXTMesh* mesh, HXTPartition* partition, u
return HXT_STATUS_OK;
}
#ifdef DEBUG
nstep++;
if(nstep > mesh->tetrahedra.num)
return HXT_ERROR_MSG(HXT_STATUS_ERROR, "walk stuck in an infinite loop");
#endif
enteringFace = curNeigh[index]&3;
nextTet = curNeigh[index]/4;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment