• No results found

Let e be a non-Dirichlet edge of the element i which is about to be migrate from subdomain nid (say) of type 1 to another subdomain j (say) of type 2. Then the function EdgeChange() shown in Figure 4.10 makes the necessary changes which are related with this migration.

1. fCheck all the neighboursg Repeat the following steps for k = 0 to p - 1.

(a) if(k == nid) continue,

(b) if(k == j) mk = m else mk = Shared(), (c) if(mk == 0) continue,

(d) Remove the mkthvertex from its neighbouring row which corresponds to

subdomain k,

(e) Send a message to the subdomain k which will also remove the mkth

vertex from its neighbouring row which corresponds to subdomain nid, (f) transfer[nid][v] = transfer[nid][v] - 1,

(g) if(transfer[nid][v] == 1) break. 2. fRemove v fromnidg

(a) transfer[nid][v] = - transfer[nid][0], (b) transfer[nid][0] = v.

3. fUpdate no. of boundary verticesgnomyintf =nomyintf - 1.

Figure 4.7: The function Changenbhd().

'

&

$

1. fto check if it is a newly shared vertexg if(transfer[nid][v] == 1)nomyintf =

nomyintf + 1.

2. fnid is a new neighbour at v to jg transfer[j][0] = transfer[j][0] + 1.

3. finsert v in the neighbouring list which corresponds to the neighbourjgtrans-

fer[j][transfer[j][0]] = v.

4. fpack the ID (the integer nid) and the multiplicity of v (the integer trans-

fer[nid][v]) for the neighbourjg

5. finitialise the variable k1g k1 = 2.

6. fCheck all the neighbours ofnid other thanjgRepeat the following steps for

k = 0 to p - 1.

(a) if(k1 >transfer[nid][v]) break, (b) if(k == j or k == nid) continue,

(c) mk =Shared(),

(d) if(mk == 0) continue,

(e) fpack the ID (the integer k) of the subdomain k for the subdomain jg,

(f) fstore the information for the type 3 processor k so that it will be able

to update his neighbouring list which corresponds to the subdomainjg,

(g) fincrement the variable k1g k1 = k1 + 1.

7. fIncrement the multiplicity of vg transfer[nid][v] = transfer[nid][v] + 1.

Figure 4.8: The functionChangenbhd2().

1. fcheck if v is shared amongnid and some other subdomaing

if(transfer[nid][v] > 1) nomyintf =nomyintf - 1.

2. fpack the integer transfer[nid][v] - 1 for the subdomain j which will use this

to make the insertions in his corresponding neighbouring listsg.

3. fcheck all the neighboursg Repeat the following steps for k = 0 to p - 1.

(a) if(transfer[nid][v] == 1) break, (b) if(k == nid or k ==j) continue,

(c) mk =Shared(),

(d) if(mk == 0) continue,

(e) fstore the information so that nid will delete latter on v from its neigh-

bouring list which corresponds to the subdomain kg,

(f) fsend the information to the subdomain k so that it will delete latter on

the counter part of v from its neighbouring list which corresponds to the subdomain nidg,

(g) fpack the ID (the integer k) of the subdomain k for the subdomain jg.

4. fRemove v fromnidg

(a) transfer[nid][v] = - transfer[nid][0], (b) transfer[nid][0] = v.

Figure 4.9: The functionChangenbhd3().

1. Pack the ID of the subdomain with which e is shared (in case e is an internal edge pack the integer -1 (which means e is an internal edge)) for subdomain

j.

2. If e is not shared between any two subdomains then do the following:

(a) Pack the necessary information for the subdomain jso that it will create and establish the necessary edge data which corresponds to the edge e, (b) Include e into the neighbouring list which corresponds to subdomain j

and pack the necessary information for the subdomain jso that it will do the same for the the neighbouring list which corresponds to subdomain

nid,

(c) Pack the number of edges on the edge e and their coordinates for the subdomain j.

3. If e is shared between the subdomains nid and j then do the following: (a) Pack the relative sharing position of the edge e with the subdomain jfor

the subdomain j,

(b) Store the informations for the subdomainnidso that it will removee from the subdomainnidand also from the neighbouring list which corresponds to subdomain j,

(c) Pack the informations for the subdomain j so that it will remove the counter part of e from the neighbouring list which corresponds to sub- domain nid,

(d) Update the counter for the number of vertices of type 2.

4. If e is shared between the subdomains nid and k (6= j) then do the following:

(a) Pack the necessary information for the subdomain jso that it will create and establish the necessary edge data which corresponds to the edge e, (b) Store the information so that e will be removed from the subdomainnid

and also from the neighbouring list which corresponds to subdomain k and also send the necessary information to the subdomain k so that it will also remove the counter part of e from the neighbouring list which corresponds to subdomain nid and include it in the neighbouring list which corresponds to the subdomain j,

(c) Pack the number of edges on the edge e and their coordinates for the subdomain j,

(d) Store the information for the subdomain jso that it will insert the newly created edge into the neighbouring list which corresponds to the subdo- main k,

(e) Update the counter for the number of vertices of type 2. Figure 4.10: The function EdgeChange().

1. Pack the integer representing the number of vertices and their coordinates for the subdomainj.

2. Update the counter for the number of vertices of type 4. 3. Remove the Dirichlet edge e from the subdomain nid.

Figure 4.11: The function DirichEdgeChange().

& %