6.2 Old Ghost Numbering

In this older version of the framework, FEM_Get_node and FEM_Get_elem return the total number of nodes and elements, including ghosts. The routines below return the index of the first ghost node or element, where ghosts are numbered after all the real elements. This old ghost numbering scheme does not work well when adding new ghosts, which is why the new ghost numbering scheme describes in Section 5.1 is used in the new API.

Figure 9: Old ghost element and node numbering. FEM_Get_ghost_* returns , FEM_Get_* returns .
Image conn_indexing_old



int FEM_Get_node_ghost(void);
int FEM_Get_elem_ghost(int elemType);

The examples below iterate over the real and ghost elements using the old numbering:

C version:
        int firstGhost,max;
        FEM_Get_node(&max, &ignored);
        firstGhost=FEM_Get_node_ghost();
        for (i=0;i<firstGhost;i++)
                ... i is a real node...
        for (i=firstGhost;i<max;i++)
                ... i is a ghost node ...

Fortran version:
        call FEM_Get_node(max,ignored);
        firstGhost=FEM_Get_node_ghost();
        do i=1,firstGhost-1
                ... i is a real node...
        end do
        do i=firstGhost,max
                ... i is a ghost node...
        end do

January 17, 2008
FEM Homepage
Charm Homepage