17 implicit real*8 (a-h,o-z)
18 integer(kind=kint),
dimension(: ),
allocatable :: IW1, IW2, IW3
19 integer(kind=kint),
dimension(:,:),
allocatable :: IUPD
22 if (hecmesh%node_group%n_grp.ne.0)
then
23 if (hecmesh%node_group%grp_index(hecmesh%node_group%n_grp).ne.0)
then
29 allocate (iupd(hecmesh%n_adapt_node_cur, &
30 & hecmesh%node_group%n_grp))
31 allocate (iw1(hecmesh%n_adapt_node_cur))
32 allocate (iw2(hecmesh%node_group%n_grp))
38 do ig= 1, hecmesh%node_group%n_grp
41 do k= hecmesh%node_group%grp_index(ig-1)+1, &
42 & hecmesh%node_group%grp_index(ig)
43 nod = hecmesh%node_group%grp_item(k)
50 do ie= 1, hecmesh%n_adapt_edge
51 nod1= hecmesh%adapt_edge_node(2*ie-1)
52 nod2= hecmesh%adapt_edge_node(2*ie )
54 if (iw1(nod1).eq.1 .and. iw1(nod2).eq.1 .and. &
55 & hecmesh%adapt_iemb(ie ).ne.0)
then
56 nod3 = hecmesh%adapt_IWK(ie)
67 nnn1= hecmesh%node_group%grp_index(hecmesh%node_group%n_grp)
68 deallocate (hecmesh%node_group%grp_item)
69 allocate (hecmesh%node_group%grp_item(icou))
71 hecmesh%node_group%grp_index= 0
72 do ig= 1, hecmesh%node_group%n_grp
73 hecmesh%node_group%grp_index(ig)= &
74 & hecmesh%node_group%grp_index(ig-1) + iw2(ig)
76 do ig= 1, hecmesh%node_group%n_grp
78 kk= hecmesh%node_group%grp_index(ig-1) + k
79 hecmesh%node_group%grp_item(kk)= iupd(k,ig)
83 nnn2= hecmesh%node_group%grp_index(hecmesh%node_group%n_grp)
86 deallocate (iupd, iw1, iw2)
91 if (hecmesh%elem_group%n_grp.ne.0)
then
92 if (hecmesh%elem_group%grp_index(hecmesh%elem_group%n_grp).ne.0)
then
98 allocate (iupd(hecmesh%n_elem, &
99 & hecmesh%elem_group%n_grp))
100 allocate (iw1(hecmesh%n_elem))
101 allocate (iw2(hecmesh%elem_group%n_grp))
107 do ig= 1, hecmesh%elem_group%n_grp
110 do k= hecmesh%elem_group%grp_index(ig-1)+1, &
111 & hecmesh%elem_group%grp_index(ig)
112 icel = hecmesh%elem_group%grp_item(k)
119 do icel= 1, hecmesh%n_elem
120 if (hecmesh%adapt_type(icel).ne.0.and.iw1(icel).eq.1)
then
121 is= hecmesh%adapt_children_index(icel-1) + 1
122 ie= hecmesh%adapt_children_index(icel)
123 ics= hecmesh%adapt_children_local(is)
125 if (hecmesh%when_i_was_refined_elem(ics).eq. &
126 & hecmesh%n_adapt)
then
128 if (hecmesh%adapt_children_item(2*k-1).ne.0)
then
129 iclocal= hecmesh%adapt_children_local(k)
133 iupd(icou0,ig)= iclocal
144 nnn1= hecmesh%elem_group%grp_index(hecmesh%elem_group%n_grp)
145 deallocate (hecmesh%elem_group%grp_item)
146 allocate (hecmesh%elem_group%grp_item(icou))
148 hecmesh%elem_group%grp_index= 0
149 do ig= 1, hecmesh%elem_group%n_grp
150 hecmesh%elem_group%grp_index(ig)= &
151 & hecmesh%elem_group%grp_index(ig-1) + iw2(ig)
153 do ig= 1, hecmesh%elem_group%n_grp
155 kk= hecmesh%elem_group%grp_index(ig-1) + k
156 hecmesh%elem_group%grp_item(kk)= iupd(k,ig)
159 nnn2= hecmesh%elem_group%grp_index(hecmesh%elem_group%n_grp)
162 deallocate (iupd, iw1, iw2)
167 if (hecmesh%surf_group%n_grp.ne.0)
then
168 if (hecmesh%surf_group%grp_index(hecmesh%surf_group%n_grp).ne.0)
then
174 allocate (iupd(2*hecmesh%n_node, &
175 & hecmesh%surf_group%n_grp))
176 allocate (iw1(2*hecmesh%n_elem))
177 allocate (iw2(hecmesh%surf_group%n_grp))
178 allocate (iw3(hecmesh%n_node))
184 do ig= 1, hecmesh%surf_group%n_grp
188 do k= hecmesh%surf_group%grp_index(ig-1)+1, &
189 & hecmesh%surf_group%grp_index(ig)
190 icel = hecmesh%surf_group%grp_item(2*k-1)
191 isuf = hecmesh%surf_group%grp_item(2*k )
195 iupd(2*icou0-1,ig)= icel
196 iupd(2*icou0 ,ig)= isuf
197 ip_type= hecmesh%elem_type(icel)
198 if (ip_type.eq.351)
then
199 isp= hecmesh%elem_node_index(icel-1)
200 np1= hecmesh%elem_node_item (isp+1)
201 np2= hecmesh%elem_node_item (isp+2)
202 np3= hecmesh%elem_node_item (isp+3)
203 np4= hecmesh%elem_node_item (isp+4)
204 np5= hecmesh%elem_node_item (isp+5)
205 np6= hecmesh%elem_node_item (isp+6)
212 else if (isuf.eq.2)
then
217 else if (isuf.eq.3)
then
222 else if (isuf.eq.4)
then
226 else if (isuf.eq.5)
then
233 if (ip_type.eq.341)
then
234 isp= hecmesh%elem_node_index(icel-1)
235 np1= hecmesh%elem_node_item (isp+1)
236 np2= hecmesh%elem_node_item (isp+2)
237 np3= hecmesh%elem_node_item (isp+3)
238 np4= hecmesh%elem_node_item (isp+4)
243 else if (isuf.eq.2)
then
247 else if (isuf.eq.3)
then
251 else if (isuf.eq.4)
then
260 do ie= 1, hecmesh%n_adapt_edge
261 nod1= hecmesh%adapt_edge_node(2*ie-1)
262 nod2= hecmesh%adapt_edge_node(2*ie )
264 if (iw3(nod1).eq.1 .and. iw3(nod2).eq.1 .and. &
265 & hecmesh%adapt_iemb(ie).ne.0)
then
266 nod3 = hecmesh%adapt_IWK(ie)
271 do kkk= hecmesh%surf_group%grp_index(ig-1)+1, &
272 & hecmesh%surf_group%grp_index(ig)
273 icel= hecmesh%surf_group%grp_item(2*kkk-1)
274 if (hecmesh%adapt_type(icel).ne.0.and.iw1(icel).ne.0)
then
275 ip_type= hecmesh%elem_type(icel)
276 is= hecmesh%adapt_children_index(icel-1) + 1
277 ie= hecmesh%adapt_children_index(icel)
278 ics= hecmesh%adapt_children_local(is)
280 if (hecmesh%when_i_was_refined_elem(ics).eq. &
281 & hecmesh%n_adapt)
then
283 if (hecmesh%adapt_children_item(2*k-1).ne.0)
then
284 iclocal= hecmesh%adapt_children_local(k)
285 if (ip_type.eq.351)
then
286 isc= hecmesh%elem_node_index(iclocal-1)
287 nc1= hecmesh%elem_node_item (isc+1)
288 nc2= hecmesh%elem_node_item (isc+2)
289 nc3= hecmesh%elem_node_item (isc+3)
290 nc4= hecmesh%elem_node_item (isc+4)
291 nc5= hecmesh%elem_node_item (isc+5)
292 nc6= hecmesh%elem_node_item (isc+6)
294 nsuf1= iw3(nc2) + iw3(nc3) + iw3(nc5) + iw3(nc6)
295 nsuf2= iw3(nc1) + iw3(nc3) + iw3(nc4) + iw3(nc6)
296 nsuf3= iw3(nc1) + iw3(nc2) + iw3(nc4) + iw3(nc5)
297 nsuf4= iw3(nc1) + iw3(nc2) + iw3(nc3)
298 nsuf5= iw3(nc4) + iw3(nc5) + iw3(nc6)
304 iupd(2*icou0-1,ig)= iclocal
312 iupd(2*icou0-1,ig)= iclocal
320 iupd(2*icou0-1,ig)= iclocal
328 iupd(2*icou0-1,ig)= iclocal
336 iupd(2*icou0-1,ig)= iclocal
341 if (ip_type.eq.341)
then
342 isc= hecmesh%elem_node_index(iclocal-1)
343 nc1= hecmesh%elem_node_item (isc+1)
344 nc2= hecmesh%elem_node_item (isc+2)
345 nc3= hecmesh%elem_node_item (isc+3)
346 nc4= hecmesh%elem_node_item (isc+4)
348 nsuf1= iw3(nc2) + iw3(nc3) + iw3(nc4)
349 nsuf2= iw3(nc1) + iw3(nc3) + iw3(nc4)
350 nsuf3= iw3(nc1) + iw3(nc2) + iw3(nc4)
351 nsuf4= iw3(nc1) + iw3(nc2) + iw3(nc3)
357 iupd(2*icou0-1,ig)= iclocal
365 iupd(2*icou0-1,ig)= iclocal
373 iupd(2*icou0-1,ig)= iclocal
381 iupd(2*icou0-1,ig)= iclocal
396 nnn1= hecmesh%surf_group%grp_index(hecmesh%surf_group%n_grp)
397 deallocate (hecmesh%surf_group%grp_item)
398 allocate (hecmesh%surf_group%grp_item(2*icou))
400 hecmesh%surf_group%grp_index= 0
401 do ig= 1, hecmesh%surf_group%n_grp
402 hecmesh%surf_group%grp_index(ig)= &
403 & hecmesh%surf_group%grp_index(ig-1) + iw2(ig)
405 do ig= 1, hecmesh%surf_group%n_grp
407 kk= hecmesh%surf_group%grp_index(ig-1) + k
408 hecmesh%surf_group%grp_item(2*kk-1)= iupd(2*k-1,ig)
409 hecmesh%surf_group%grp_item(2*kk )= iupd(2*k ,ig)
412 nnn2= hecmesh%surf_group%grp_index(hecmesh%surf_group%n_grp)
415 deallocate (iupd, iw1, iw2, iw3)