> On 14 Nov 2016, at 14:59, leejearl <leeje...@126.com> wrote:
> 
> Hi all:
> 
>    I am not sure the using of the function "DMPlexGetAdjacency".
> 
>    My codes are as follows:
> 
>    PetscInt adj, *adjSize=NULL;
> 
>    ierr = DMPlexGetAdjacency(dm, p,  &adj, &adj);


Your calling sequence is wrong:

PetscInt adjSize;
PetscInt *adj = NULL;

ierr = DMPlexGetAdjacency(dm, p, &adjSize, &adj); CHKERRQ(ierr);

adjSize is now the size of the adj array.  You should remember to free it 
afterwards:

/* use adj here *
...

ierr = PetscFree(adj); CHKERRQ(ierr);

Lawrence

Reply via email to