rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
index_ext.m
1 function einds_ext = index_ext(grid, einds, neigh_steps)
2 %function einds_ext = index_ext(grid, einds, neigh_steps)
3 %
4 % function computing the sorted list of element indicés, which are
5 % given by the neigh_steps number of neighbours of the elements with
6 % indices einds in grid.
7 % e.g. for neigh_steps = 0: einds_ext = einds
8 % e.g. for neigh_steps = 1: einds_ext = einds plus all edge-neighbours
9 % of elements
10 % e.g. for neigh_steps = 2: einds_ext = einds plus all edge-neighbours
11 % of elements plus all edge neighbours of these.
12 
13 % Bernard Haasdonk 18.6.2010
14 
15 mask = zeros(1,grid.nelements);
16 mask(einds) = 1;
17 einds_ext = einds;
18 for n = 1:neigh_steps
19  nbi = grid.NBI(einds_ext,:);
20  i = find(nbi>0);
21  mask(nbi(i)) = n+1;
22  einds_ext = find(mask>0);
23 end;
NBI
NBI(i,j) = element index of j-th neighbour of element i boundary faces are set to -1 or negative valu...
Definition: gridbase.m:102
nelements
number of overall elements (leaf + nonleaf)
Definition: gridbase.m:30