[petsc-users] Vector including ghost pattern

Denner, Fabian f.denner09 at imperial.ac.uk
Fri Jul 16 10:31:09 CDT 2010

Hi everybody,

I have the following problem with the handling of a 3D mesh with mixed element types. I aim to build vectors containing the ghost pattern for the mesh of a parallel CFD simulation. Inspired by the example "dm/ao/examples/tutorials/ex2.c" the connectivity information, represented by the element neighbors, is stored in two arrays - one array ja[] containing the neighbor element indices and the other array ia[] (of length n+1) containing the "start" index for each element in array ja[] (compare example below or adjacency graph in "dm/ao/examples/tutorials/ex2.c"). The neighbors of my local elements, elements assigned to the present process, and the neighbors of my ghost elements are stored in different pairs of arrays.

Element indices: index[0 1 2 3 4 5 6 7 .... n]
Neighbour element indices: ja[3 5 6 11 57 311 41 0 5 67 ..... 532 106]
"Start"-position of neighour indices in array ja[]: ia[0 3 7 11 13 .... 1503]

The issue appears when I try to cast the arrays in a vector with ghost pattern. When I create a vector with VecCreateGhost, deliver my global neighbor arrays and update my ghost pattern, the data will be lost, since the number of neighbors varies for each element. Subsequently, I can't loop over my ghost neighbors anymore. Is there any different handling of connectivity/adjacency information or is there an opportunity to "prepare" the data in an alternative way?

Best regards,
Fabian Denner

More information about the petsc-users mailing list