Menu

#7 Bug in grid.c

1.0
open
None
2016-03-14
2016-03-14
Wenhao Chen
No

A bug occurs in edge marker when several partitions of cells intersect at Type 3 boundary during parallel computing. Under this circumstances, the partition which contains the Type 3 cells as inner cells fails to update their edges as computational edges. To fix the bug, simply replace EdgeMarkers function in grid.c as below:

static void EdgeMarkers(gridT maingrid, gridT *localgrid, int myproc)
{
int n, ne, nf, nc1, nc2;

// for the cells on the local grid
for(n=0;n<(localgrid)->Nc;n++) {
// if the cell is a ghost cell
if(IsBoundaryCell((
localgrid)->mnptr[n],maingrid,myproc)==3) {
// for each face on the ghost cell
for(nf=0;nf<(localgrid)->nfaces[n];nf++) {
// get the edge information
ne = (
localgrid)->face[n(localgrid)->maxfaces+nf];
// if the edge is marked as ghost or computational

    if(!(*localgrid)->mark[ne]){
       nc1 = (*localgrid)->grad[2*ne];
       nc2 = (*localgrid)->grad[2*ne+1];
   if(nc1 == n)
    nc1 = nc2;
   if(nc1!=-1 && IsBoundaryCell((*localgrid)->mnptr[nc1],maingrid,myproc)!=3) 
     (*localgrid)->mark[ne]=5;
   else 
         (*localgrid)->mark[ne]=6;
    }
}
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.