[petsc-users] Vector including ghost pattern

Barry Smith bsmith at mcs.anl.gov
Fri Jul 16 10:56:53 CDT 2010


On Jul 16, 2010, at 10:31 AM, Denner, Fabian wrote:

> 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.

   Hmm, VecCreateGhost() doesn't say anything about the number of neighbors or elements. You are free to set any number of ghost points associated with things. So it is up to you to assign the appropriate ghost points etc.

   Perhaps if you are a bit more explicit in your question we could answer it better?

   Barry

> 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