16 type (hecmwST_local_mesh) :: hecMESH
17 type (hecmwST_local_mesh) :: hecMESHnew
19 integer(kind=kint),
pointer :: WORKaI(:)
20 real(kind=
kreal),
pointer :: workar(:)
24 if (hecmesh%my_rank.eq.3)
write (*,
'(/,a)')
'#final mesh (n_node, nn_int, n_elem, ne_int)'
25 call mpi_barrier (hecmesh%MPI_COMM, ierr)
27 write (*,
'(a,i5,4i8)')
'PE#', hecmesh%my_rank, &
28 & hecmesh%n_node, hecmesh%nn_internal, &
29 & hecmesh%n_elem, hecmesh%ne_internal
33 hecmeshnew%hecmw_n_file= 0
34 hecmeshnew%header = hecmesh%header
35 hecmeshnew%hecmw_flag_adapt = hecmesh%hecmw_flag_adapt
36 hecmeshnew%hecmw_flag_initcon = hecmesh%hecmw_flag_initcon
37 hecmeshnew%hecmw_flag_parttype = hecmesh%hecmw_flag_parttype
38 hecmeshnew%hecmw_flag_partdepth= hecmesh%hecmw_flag_partdepth
39 hecmeshnew%hecmw_flag_version = hecmesh%hecmw_flag_version
40 hecmeshnew%zero_temp = hecmesh%zero_temp
41 hecmeshnew%gridfile = hecmesh%gridfile
42 hecmeshnew%hecmw_n_file = hecmesh%hecmw_n_file
46 hecmeshnew%n_node = hecmesh%n_node
47 hecmeshnew%nn_internal= hecmesh%nn_internal
49 hecmeshnew%n_dof_grp = 1
51 allocate (hecmeshnew%node (3*hecmeshnew%n_node))
52 allocate (hecmeshnew%node_ID(2*hecmeshnew%n_node))
53 allocate (hecmeshnew%global_node_ID(hecmeshnew%n_node))
54 hecmeshnew%global_node_ID= 1
56 do i= 1, hecmeshnew%n_node
57 in= hecmesh%adapt_OLDtoNEW_node(i)
58 hecmeshnew%node(3*in-2)= hecmesh%node(3*i-2)
59 hecmeshnew%node(3*in-1)= hecmesh%node(3*i-1)
60 hecmeshnew%node(3*in )= hecmesh%node(3*i )
62 hecmeshnew%node_ID(2*in-1)= hecmesh%node_ID(2*i-1)
63 hecmeshnew%node_ID(2*in )= hecmesh%node_ID(2*i )
66 deallocate (hecmesh%node_ID, hecmesh%node, hecmesh%global_node_ID)
68 allocate (hecmeshnew%node_dof_index(0:hecmeshnew%n_dof_grp))
69 hecmeshnew%node_dof_index(0)= 0
70 hecmeshnew%node_dof_index(1)= hecmeshnew%n_node
71 allocate (hecmeshnew%node_dof_item(1))
72 hecmeshnew%node_dof_item(1) = 3
76 hecmeshnew%n_elem = hecmesh%n_elem
77 hecmeshnew%ne_internal= hecmesh%ne_internal
78 hecmeshnew%n_elem_type= hecmesh%n_elem_type
80 hecmeshnew%n_elem_mat_ID= hecmesh%n_elem
82 allocate (hecmeshnew%elem_type_index(0:hecmeshnew%n_elem_type))
83 hecmeshnew%elem_type_index= hecmesh%elem_type_index
84 allocate (hecmeshnew%elem_type_item(hecmeshnew%n_elem_type))
86 hecmeshnew%elem_type_item = hecmesh%elem_type_item
87 deallocate (hecmesh%elem_type_index, hecmesh%elem_type_item)
89 allocate (hecmeshnew%elem_type (hecmeshnew%n_elem))
90 allocate (hecmeshnew%section_ID (hecmeshnew%n_elem))
91 allocate (hecmeshnew%elem_mat_ID_item (hecmeshnew%n_elem))
93 do i= 1, hecmeshnew%n_elem
94 in= hecmesh%adapt_OLDtoNEW_elem(i)
95 hecmeshnew%elem_type (in)= hecmesh%elem_type (i)
96 hecmeshnew%section_ID (in)= hecmesh%section_ID (i)
97 hecmeshnew%elem_mat_ID_item(in)= hecmesh%elem_mat_ID_item(i)
100 allocate (hecmeshnew%elem_mat_ID_index (0:hecmeshnew%n_elem))
101 hecmeshnew%elem_mat_ID_index= 0
102 do i= 1, hecmeshnew%n_elem
103 hecmeshnew%elem_mat_ID_index(i)= i
106 deallocate (hecmesh%elem_type, hecmesh%section_ID)
107 deallocate (hecmesh%elem_mat_ID_index)
108 deallocate (hecmesh%elem_mat_ID_item )
110 nnn= hecmesh%elem_node_index(hecmesh%n_elem)
111 allocate (hecmeshnew%elem_node_index(0:hecmeshnew%n_elem))
112 allocate (hecmeshnew%elem_node_item (nnn))
113 hecmeshnew%elem_node_index= 0
114 hecmeshnew%elem_node_item = 0
115 do i= 1, hecmeshnew%n_elem
116 in= hecmesh%adapt_OLDtoNEW_elem(i)
117 hecmeshnew%elem_node_index(in)= hecmesh%elem_node_index(i) - hecmesh%elem_node_index(i-1)
120 do i= 1, hecmeshnew%n_elem
121 hecmeshnew%elem_node_index(i)= hecmeshnew%elem_node_index(i-1) + hecmeshnew%elem_node_index(i)
124 do i= 1, hecmeshnew%n_elem
125 in = hecmesh%adapt_OLDtoNEW_elem(i)
126 is = hecmesh%elem_node_index(i-1)
127 ie = hecmesh%elem_node_index(i )
128 is0= hecmeshnew%elem_node_index(in-1)
131 nodk= hecmesh%adapt_OLDtoNEW_node(hecmesh%elem_node_item(k))
132 hecmeshnew%elem_node_item(kk)= nodk
135 deallocate (hecmesh%elem_node_index, hecmesh%elem_node_item)
137 allocate (hecmeshnew%elem_ID(2*hecmeshnew%n_elem))
138 do i= 1, hecmeshnew%n_elem
139 in = hecmesh%adapt_OLDtoNEW_elem(i)
140 hecmeshnew%elem_ID(2*in-1)= hecmesh%elem_ID(2*i-1)
141 hecmeshnew%elem_ID(2*in )= hecmesh%elem_ID(2*i )
143 deallocate (hecmesh%elem_ID)
144 allocate (hecmeshnew%global_elem_ID(hecmeshnew%n_elem))
145 hecmeshnew%global_elem_ID= 1
146 deallocate (hecmesh%global_elem_ID)
147 allocate (hecmeshnew%elem_internal_list(hecmeshnew%ne_internal))
148 do i= 1, hecmesh%ne_internal
149 icel= hecmesh%elem_internal_list (i)
150 in = hecmesh%adapt_OLDtoNEW_elem(icel)
151 hecmeshnew%elem_internal_list(i)= in
153 deallocate (hecmesh%elem_internal_list)
157 hecmeshnew%my_rank = hecmesh%my_rank
158 hecmeshnew%zero = hecmesh%zero
159 hecmeshnew%PETOT = hecmesh%PETOT
160 hecmeshnew%PEsmpTOT= hecmesh%PEsmpTOT
162 hecmeshnew%errnof = hecmesh%errnof
164 call mpi_comm_dup (hecmesh%MPI_COMM, hecmeshnew%MPI_COMM, ierr)
166 hecmeshnew%n_subdomain = hecmesh%n_subdomain
167 hecmeshnew%n_neighbor_pe= hecmesh%n_neighbor_pe
169 allocate (hecmeshnew%neighbor_pe(hecmeshnew%n_neighbor_pe))
170 hecmeshnew%neighbor_pe= hecmesh%neighbor_pe
172 nn1= hecmesh%adapt_import_new_index(hecmesh%n_neighbor_pe)
173 nn2= hecmesh%adapt_export_new_index(hecmesh%n_neighbor_pe)
175 allocate (hecmeshnew%import_index(0:hecmeshnew%n_neighbor_pe), hecmeshnew%import_item(nn1))
176 allocate (hecmeshnew%export_index(0:hecmeshnew%n_neighbor_pe), hecmeshnew%export_item(nn2))
178 hecmeshnew%import_index= 0
179 hecmeshnew%export_index= 0
181 do i= 1, hecmeshnew%n_neighbor_pe
182 hecmeshnew%import_index(i)= hecmesh%adapt_import_new_index(i)
183 hecmeshnew%export_index(i)= hecmesh%adapt_export_new_index(i)
187 hecmeshnew%import_item(i) = hecmesh%adapt_import_new_item(i)
191 hecmeshnew%export_item(i) = hecmesh%adapt_export_new_item(i)
194 allocate (hecmeshnew%shared_index(0:hecmeshnew%n_neighbor_pe))
195 hecmeshnew%shared_index= 0
199 hecmeshnew%coarse_grid_level= hecmesh%coarse_grid_level
200 hecmeshnew%n_adapt = hecmesh%n_adapt
202 allocate (hecmeshnew%when_i_was_refined_node(hecmeshnew%n_node))
203 allocate (hecmeshnew%when_i_was_refined_elem(hecmeshnew%n_elem))
204 allocate (hecmeshnew%adapt_parent_type(hecmeshnew%n_elem))
205 allocate (hecmeshnew%adapt_type (hecmeshnew%n_elem))
206 allocate (hecmeshnew%adapt_level (hecmeshnew%n_elem))
207 allocate (hecmeshnew%adapt_parent (hecmeshnew%n_elem*2))
208 allocate (hecmeshnew%adapt_children_index (0: hecmeshnew%n_elem))
209 allocate (hecmeshnew%adapt_children_item (16*hecmeshnew%n_elem))
211 do i= 1, hecmeshnew%n_node
212 in= hecmesh%adapt_OLDtoNEW_node(i)
213 hecmeshnew%when_i_was_refined_node(in)= hecmesh%when_i_was_refined_node(i)
216 hecmeshnew%adapt_children_index= 0
217 hecmeshnew%adapt_children_item = 0
218 do i= 1, hecmeshnew%n_elem
219 in= hecmesh%adapt_OLDtoNEW_elem(i)
220 hecmeshnew%when_i_was_refined_elem(in)= hecmesh%when_i_was_refined_elem(i)
221 hecmeshnew%adapt_parent_type(in)= hecmesh%adapt_parent_type(i)
222 hecmeshnew%adapt_type (in)= hecmesh%adapt_type (i)
223 hecmeshnew%adapt_level (in)= hecmesh%adapt_level (i)
225 hecmeshnew%adapt_parent(2*in-1)= hecmesh%adapt_parent(2*i-1)
226 hecmeshnew%adapt_parent(2*in )= hecmesh%adapt_parent(2*i )
228 hecmeshnew%adapt_children_index(i)= hecmeshnew%adapt_children_index(i-1) + 8
233 hecmeshnew%adapt_children_item(isnew+kk)= hecmesh%adapt_children_item(isorg+kk)
237 deallocate (hecmesh%when_i_was_refined_node)
238 deallocate (hecmesh%when_i_was_refined_elem)
239 deallocate (hecmesh%adapt_type, hecmesh%adapt_parent_type, hecmesh%adapt_parent, hecmesh%adapt_level)
240 deallocate (hecmesh%adapt_children_index, hecmesh%adapt_children_item)
244 hecmeshnew%section%n_sect= hecmesh%section%n_sect
246 allocate (hecmeshnew%section%sect_type(hecmeshnew%section%n_sect))
247 allocate (hecmeshnew%section%sect_opt (hecmeshnew%section%n_sect))
248 hecmeshnew%section%sect_type= hecmesh%section%sect_type
249 hecmeshnew%section%sect_opt = hecmesh%section%sect_opt
251 nnn= hecmesh%section%sect_mat_ID_index(hecmesh%section%n_sect)
252 allocate (hecmeshnew%section%sect_mat_ID_index(0:hecmeshnew%section%n_sect))
253 allocate (hecmeshnew%section%sect_mat_ID_item (nnn))
254 hecmeshnew%section%sect_mat_ID_index= hecmesh%section%sect_mat_ID_index
255 hecmeshnew%section%sect_mat_ID_item = hecmesh%section%sect_mat_ID_item
257 allocate (hecmeshnew%section%sect_I_index(0:hecmeshnew%section%n_sect))
258 allocate (hecmeshnew%section%sect_R_index(0:hecmeshnew%section%n_sect))
259 hecmeshnew%section%sect_I_index= 0
260 hecmeshnew%section%sect_R_index= 0
264 hecmeshnew%material%n_mat = hecmesh%material%n_mat
265 hecmeshnew%material%n_mat_item = hecmesh%material%n_mat_item
266 hecmeshnew%material%n_mat_subitem= hecmesh%material%n_mat_subitem
267 hecmeshnew%material%n_mat_table = hecmesh%material%n_mat_table
269 n_mat = hecmeshnew%material%n_mat
270 n_item = hecmeshnew%material%n_mat_item
271 n_subitem= hecmeshnew%material%n_mat_subitem
272 nnn = hecmesh%material%mat_table_index(n_subitem)
274 allocate (hecmeshnew%material%mat_name(n_mat))
275 hecmeshnew%material%mat_name= hecmesh%material%mat_name
277 allocate (hecmeshnew%material%mat_item_index (0:n_mat))
278 allocate (hecmeshnew%material%mat_subitem_index(0:n_item))
279 allocate (hecmeshnew%material%mat_table_index (0:n_subitem))
280 hecmeshnew%material%mat_item_index = hecmesh%material%mat_item_index
281 hecmeshnew%material%mat_subitem_index= hecmesh%material%mat_subitem_index
282 hecmeshnew%material%mat_table_index = hecmesh%material%mat_table_index
284 allocate (hecmeshnew%material%mat_val(nnn), hecmeshnew%material%mat_temp(nnn))
285 hecmeshnew%material%mat_val = hecmesh%material%mat_val
286 hecmeshnew%material%mat_temp= hecmesh%material%mat_temp
290 hecmeshnew%mpc%n_mpc= hecmesh%mpc%n_mpc
291 if (hecmesh%mpc%n_mpc.ne.0)
then
292 nnn= hecmesh%mpc%mpc_index(hecmesh%mpc%n_mpc)
293 allocate (hecmeshnew%mpc%mpc_index(0:hecmeshnew%mpc%n_mpc))
294 allocate (hecmeshnew%mpc%mpc_item (nnn))
295 allocate (hecmeshnew%mpc%mpc_dof (nnn))
296 allocate (hecmeshnew%mpc%mpc_val (nnn))
297 hecmeshnew%mpc%mpc_index= hecmesh%mpc%mpc_index
298 hecmeshnew%mpc%mpc_item = hecmesh%mpc%mpc_item
299 hecmeshnew%mpc%mpc_dof = hecmesh%mpc%mpc_dof
300 hecmeshnew%mpc%mpc_val = hecmesh%mpc%mpc_val
303 hecmeshnew%amp%n_amp= 0
304 if (hecmesh%amp%n_amp.ne.0)
then
305 nnn= hecmesh%amp%amp_index(hecmesh%amp%n_amp)
306 allocate (hecmeshnew%amp%amp_type_definition(hecmeshnew%amp%n_amp))
307 allocate (hecmeshnew%amp%amp_type_time (hecmeshnew%amp%n_amp))
308 allocate (hecmeshnew%amp%amp_type_value (hecmeshnew%amp%n_amp))
309 allocate (hecmeshnew%amp%amp_index(0:hecmeshnew%amp%n_amp))
310 allocate (hecmeshnew%amp%amp_val (nnn))
311 allocate (hecmeshnew%amp%amp_table(nnn))
312 hecmeshnew%amp%amp_type_definition= hecmesh%amp%amp_type_definition
313 hecmeshnew%amp%amp_type_time = hecmesh%amp%amp_type_time
314 hecmeshnew%amp%amp_type_value = hecmesh%amp%amp_type_value
315 hecmeshnew%amp%amp_index = hecmesh%amp%amp_index
316 hecmeshnew%amp%amp_val = hecmesh%amp%amp_val
317 hecmeshnew%amp%amp_table = hecmesh%amp%amp_table
322 n_grp = hecmesh%node_group%n_grp
325 n_array= hecmesh%node_group%grp_index(n_grp)
326 hecmeshnew%node_group%n_grp= hecmesh%node_group%n_grp
328 allocate (hecmeshnew%node_group%grp_name ( n_grp))
329 allocate (hecmeshnew%node_group%grp_index(0:n_grp))
330 allocate (hecmeshnew%node_group%grp_item (n_array))
332 hecmeshnew%node_group%grp_name = hecmesh%node_group%grp_name
333 hecmeshnew%node_group%grp_index= hecmesh%node_group%grp_index
336 in0= hecmesh%node_group%grp_item(i)
337 hecmeshnew%node_group%grp_item(i)= hecmesh%adapt_OLDtoNEW_node(in0)
343 n_grp = hecmesh%elem_group%n_grp
346 n_array= hecmesh%elem_group%grp_index(n_grp)
347 hecmeshnew%elem_group%n_grp= hecmesh%elem_group%n_grp
349 allocate (hecmeshnew%elem_group%grp_name ( n_grp))
350 allocate (hecmeshnew%elem_group%grp_index(0:n_grp))
351 allocate (hecmeshnew%elem_group%grp_item (n_array))
353 hecmeshnew%elem_group%grp_name = hecmesh%elem_group%grp_name
354 hecmeshnew%elem_group%grp_index= hecmesh%elem_group%grp_index
357 in0= hecmesh%elem_group%grp_item(i)
358 hecmeshnew%elem_group%grp_item(i)= hecmesh%adapt_OLDtoNEW_elem(in0)
364 n_grp = hecmesh%surf_group%n_grp
367 n_array= hecmesh%surf_group%grp_index(n_grp)
368 hecmeshnew%surf_group%n_grp= hecmesh%surf_group%n_grp
370 allocate (hecmeshnew%surf_group%grp_name ( n_grp))
371 allocate (hecmeshnew%surf_group%grp_index(0:n_grp))
372 allocate (hecmeshnew%surf_group%grp_item (2*n_array))
374 hecmeshnew%surf_group%grp_name = hecmesh%surf_group%grp_name
375 hecmeshnew%surf_group%grp_index= hecmesh%surf_group%grp_index
378 in0 = hecmesh%surf_group%grp_item(2*i-1)
379 isuf= hecmesh%surf_group%grp_item(2*i )
380 hecmeshnew%surf_group%grp_item(2*i-1)= hecmesh%adapt_OLDtoNEW_elem(in0)
381 hecmeshnew%surf_group%grp_item(2*i )= isuf