16 type (hecmwST_local_mesh),
intent(in) :: hecMESH
17 type (hecmwST_matrix),
intent(in) :: hecMAT
19 integer(kint) :: i, cid
24 do i = 1, hecmesh%section%n_sect
25 if(hecmesh%section%sect_type(i) == 4) cycle
26 cid = hecmesh%section%sect_mat_ID_item(i)
28 if(fstrsolid%materials(cid)%variables(m_density) == 0.0d0)
then
29 write(*,*)
"*** error: density is not assigned or set to zero"
30 call hecmw_abort(hecmw_comm_get_comm())
38 write(
imsg,*)
" **** STAGE Precheck **"
41 write(
idbg,*)
"fstr_precheck_elem: OK"
53 type (hecmwST_local_mesh) :: hecMESH
54 integer(kind=kint) :: mid, ihead
55 real(kind=kreal) :: thick
57 ihead = hecmesh%section%sect_R_index(mid-1)
58 thick = hecmesh%section%sect_R_item(ihead+1)
72 type (hecmwST_local_mesh) :: hecMESH
73 type (hecmwST_matrix ) :: hecMAT
74 integer(kind=kint) :: soltype
78 write(
imsg,*)
' **** STAGE PreCheck **'
82 write(
idbg,*)
'fstr_precheck_elem: OK'
102 type (hecmwST_matrix) :: hecMAT
103 type (hecmwST_local_mesh) :: hecMESH
104 type (fstr_solid) :: fstrSOLID
107 integer(kind=kint) :: nelem, mid, j, isect, nline, tline, icel, iiS
108 integer(kind=kint) :: ndof2, nelem_wo_mpc
109 integer(kind=kint) :: ie, ia, jelem, ic_type, nn, jS, jE, itype
110 integer(kind=kint) :: nodLOCAL(20),NTOTsum(1)
111 integer(kind=kint) :: nonzero
112 real(kind=kreal) :: ntdof2
113 real(kind=kreal) :: al, almin, almax, aa, thick, vol, avvol
114 real(kind=kreal) :: tvol, tvmax, tvmin, tlmax, tlmin, asp, aspmax
115 real(kind=kreal) :: xx(20),yy(20),zz(20)
116 real(kind=kreal) :: totsum(1),totmax(3),totmin(2)
131 write(
ilog,
"(a)")
'### Mesh Summary ###'
132 write(
ilog,
"(a,i12)")
' Num of node:',hecmesh%n_node
133 write(* ,
"(a,i12)")
' Num of node:',hecmesh%n_node
134 write(
ilog,
"(a,i12)")
' Num of DOF :',hecmesh%n_node*hecmesh%n_dof
135 write(* ,
"(a,i12)")
' Num of DOF :',hecmesh%n_node*hecmesh%n_dof
136 ndof2 = hecmesh%n_dof**2
137 ntdof2 = dble(hecmesh%n_node*hecmesh%n_dof)**2
138 write(
ilog,
"(a,i12)")
' Num of elem:',hecmesh%n_elem
139 write(* ,
"(a,i12)")
' Num of elem:',hecmesh%n_elem
141 do itype = 1, hecmesh%n_elem_type
142 js = hecmesh%elem_type_index(itype-1)
143 je = hecmesh%elem_type_index(itype )
144 ic_type = hecmesh%elem_type_item(itype)
145 if(.not. (hecmw_is_etype_link(ic_type) .or. hecmw_is_etype_patch(ic_type))) &
146 nelem_wo_mpc = nelem_wo_mpc + je-js
148 write(
ilog,
"(a,i12)")
' ** w/o MPC/Patch:',nelem_wo_mpc
149 write(* ,
"(a,i12)")
' ** w/o MPC/Patch:',nelem_wo_mpc
150 do itype = 1, hecmesh%n_elem_type
151 js = hecmesh%elem_type_index(itype-1)
152 je = hecmesh%elem_type_index(itype )
153 ic_type = hecmesh%elem_type_item(itype)
154 write(
ilog,
"(a,i4,a,i12)")
' Num of ',ic_type,
':',je-js
155 write(* ,
"(a,i4,a,i12)")
' Num of ',ic_type,
':',je-js
157 nonzero = ndof2*(hecmat%NP + hecmat%NPU + hecmat%NPL)
158 write(
ilog,
"(a,i12)")
' Num of NZ :',nonzero
159 write(* ,
"(a,i12)")
' Num of NZ :',nonzero
160 write(
ilog,
"(a,1pe12.5,a)")
' Sparsity :',100.0d0*dble(nonzero)/dble(ntdof2),
"[%]"
161 write(* ,
"(a,1pe12.5,a)")
' Sparsity :',100.0d0*dble(nonzero)/dble(ntdof2),
"[%]"
166 if( hecmesh%n_dof .eq. 3 )
then
167 do ie = 1, hecmesh%n_elem
168 ia = hecmesh%elem_ID(ie*2)
169 if( ia.ne.hecmesh%my_rank ) cycle
171 jelem = hecmesh%global_elem_ID(ie)
173 ic_type = hecmesh%elem_type(ie)
175 if (.not. (hecmw_is_etype_rod(ic_type) .or. hecmw_is_etype_solid(ic_type) &
176 & .or. hecmw_is_etype_beam(ic_type) .or. hecmw_is_etype_shell(ic_type)))
then
177 write(
ilog,*) jelem,
' This Element cannot be checked. Type=',ic_type
180 nn = hecmw_get_max_node(ic_type)
182 js = hecmesh%elem_node_index(ie-1)
183 je = hecmesh%elem_node_index(ie)
186 nodlocal(j) = hecmesh%elem_node_item (js+j)
187 xx(j) = hecmesh%node(3*nodlocal(j)-2)
188 yy(j) = hecmesh%node(3*nodlocal(j)-1)
189 zz(j) = hecmesh%node(3*nodlocal(j) )
192 if ( ic_type.eq.111 )
then
193 isect = hecmesh%section_ID(ie)
194 mid = hecmesh%section%sect_mat_ID_item(isect)
196 al = sqrt( (xx(2)-xx(1))**2+(yy(2)-yy(1))**2+(zz(2)-zz(1))**2 )
202 elseif( ic_type.eq.341 )
then
203 call pre_341 ( xx,yy,zz,vol,almax,almin )
204 elseif( ic_type.eq.351 )
then
205 call pre_351 ( xx,yy,zz,vol,almax,almin )
206 elseif( ic_type.eq.361 )
then
207 call pre_361 ( xx,yy,zz,vol,almax,almin )
208 elseif( ic_type.eq.342 )
then
209 call pre_342 ( xx,yy,zz,vol,almax,almin )
210 elseif( ic_type.eq.352 )
then
211 call pre_352 ( xx,yy,zz,vol,almax,almin )
212 elseif( ic_type.eq.362 )
then
213 call pre_362 ( xx,yy,zz,vol,almax,almin )
214 elseif( ic_type.eq.641 )
then
216 elseif( ic_type.eq.761 )
then
218 elseif( ic_type.eq.781 )
then
222 if( vol.le.0.0 )
then
223 write(
ilog,*)
' %%% ERROR %%% Volume of Element no.=',jelem,
' is zero or negative.'
227 if( vol.gt.tvmax ) tvmax = vol
228 if( vol.lt.tvmin ) tvmin = vol
229 if( almax.gt.tlmax ) tlmax = almax
230 if( almin.lt.tlmin ) tlmin = almin
232 if( asp.gt.aspmax ) aspmax = asp
234 write(
ilog,*)
' %%% WARNING %%% Aspect ratio of Element no.=',jelem,
' exceeds 50.'
235 write(
ilog,*)
' Maximum length =',almax
236 write(
ilog,*)
' Minimum length =',almin
242 elseif( hecmesh%n_dof .eq. 2 )
then
243 do ie = 1, hecmesh%n_elem
244 ia = hecmesh%elem_ID(ie*2)
245 if( ia.ne.hecmesh%my_rank ) cycle
247 jelem = hecmesh%global_elem_ID(ie)
249 ic_type = hecmesh%elem_type(ie)
251 if (.not. (hecmw_is_etype_rod(ic_type) .or. hecmw_is_etype_surface(ic_type)))
then
252 write(
ilog,*) jelem,
' This Element cannot be checked. Type=',ic_type
255 nn = hecmw_get_max_node(ic_type)
257 js = hecmesh%elem_node_index(ie-1)
259 nodlocal(j) = hecmesh%elem_node_item (js+j)
260 xx(j) = hecmesh%node(3*nodlocal(j)-2)
261 yy(j) = hecmesh%node(3*nodlocal(j)-1)
264 isect = hecmesh%section_ID(ie)
265 mid = hecmesh%section%sect_mat_ID_item(isect)
268 if ( ic_type.eq.111 )
then
269 al = sqrt( (xx(2)-xx(1))**2+(yy(2)-yy(1))**2 )
271 if( al.gt.tlmax ) tlmax = al
272 if( al.lt.tlmin ) tlmin = al
274 elseif( ic_type.eq.231 )
then
275 call pre_231 ( xx,yy,aa,vol,almax,almin )
276 elseif( ic_type.eq.241 )
then
277 call pre_241 ( xx,yy,aa,vol,almax,almin )
278 elseif( ic_type.eq.232 )
then
279 call pre_232 ( xx,yy,aa,vol,almax,almin )
280 elseif( ic_type.eq.242 )
then
281 call pre_242 ( xx,yy,aa,vol,almax,almin )
286 if( vol.le.0.0 )
then
287 write(
ilog,*)
' %%% ERROR %%% Volume of Element no.=',jelem,
' is zero or negative.'
291 if( vol.gt.tvmax ) tvmax = vol
292 if( vol.lt.tvmin ) tvmin = vol
293 if( almax.gt.tlmax ) tlmax = almax
294 if( almin.lt.tlmin ) tlmin = almin
296 if( asp.gt.aspmax ) aspmax = asp
298 write(
ilog,*)
' %%% WARNING %%% Aspect ratio of Element no.=',jelem,
' exceeds 50.'
299 write(
ilog,*)
' Maximum length =',almax
300 write(
ilog,*)
' Minimum length =',almin
306 elseif( hecmesh%n_dof .eq. 6 )
then
307 do ie = 1, hecmesh%n_elem
308 ia = hecmesh%elem_ID(ie*2)
309 if( ia.ne.hecmesh%my_rank ) cycle
311 jelem = hecmesh%global_elem_ID(ie)
313 ic_type = hecmesh%elem_type(ie)
315 if (.not. (hecmw_is_etype_beam(ic_type) .or. hecmw_is_etype_shell(ic_type)))
then
316 write(
ilog,*) jelem,
' This Element cannot be checked. Type=',ic_type
319 nn = hecmw_get_max_node(ic_type)
321 js = hecmesh%elem_node_index(ie-1)
323 nodlocal(j) = hecmesh%elem_node_item (js+j)
324 xx(j) = hecmesh%node(3*nodlocal(j)-2)
325 yy(j) = hecmesh%node(3*nodlocal(j)-1)
326 zz(j) = hecmesh%node(3*nodlocal(j) )
329 isect = hecmesh%section_ID(ie)
330 mid = hecmesh%section%sect_mat_ID_item(isect)
333 if ( ic_type.eq.111 )
then
334 al = sqrt( (xx(2)-xx(1))**2+(yy(2)-yy(1))**2+(zz(2)-zz(1))**2 )
338 if( al.gt.tlmax ) tlmax = al
339 if( al.lt.tlmin ) tlmin = al
341 elseif( ic_type.eq.731 )
then
342 call pre_731 ( xx,yy,zz,aa,vol,almax,almin )
343 elseif( ic_type.eq.741 )
then
344 call pre_741 ( xx,yy,zz,aa,vol,almax,almin )
347 if( vol.le.0.0 )
then
348 write(
ilog,*)
' %%% ERROR %%% Volume of Element no.=',jelem,
' is zero or negative.'
352 if( vol.gt.tvmax ) tvmax = vol
353 if( vol.lt.tvmin ) tvmin = vol
354 if( almax.gt.tlmax ) tlmax = almax
355 if( almin.lt.tlmin ) tlmin = almin
357 if( asp.gt.aspmax ) aspmax = asp
359 write(
ilog,*)
' %%% WARNING %%% Aspect ratio of Element no.=',jelem,
' exceeds 50.'
360 write(
ilog,*)
' Maximum length =',almax
361 write(
ilog,*)
' Minimum length =',almin
367 write(
ilog,*)
'### Sub Summary ###'
368 write(
ilog,*)
' Total Volumes in this region = ',tvol
369 write(
ilog,*)
' Average Volume of elements = ',avvol
370 write(
ilog,*)
' Maximum Volume of elements = ',tvmax
371 write(
ilog,*)
' Minimum Volume of elements = ',tvmin
372 write(
ilog,*)
' Maximum length of element edges = ',tlmax
373 write(
ilog,*)
' Minimum length of element edges = ',tlmin
375 write(
ilog,*)
' Maximum aspect ratio in this region = ',aspmax
377 call hecmw_allreduce_r(hecmesh,totsum,1,hecmw_sum)
379 call hecmw_allreduce_i(hecmesh,ntotsum,1,hecmw_sum)
383 call hecmw_allreduce_r(hecmesh,totmax,3,hecmw_max)
386 call hecmw_allreduce_r(hecmesh,totmin,2,hecmw_min)
387 if( hecmesh%my_rank .eq. 0 )
then
388 avvol = totsum(1) / ntotsum(1)
389 write(
ilog,*)
'### Global Summary ###'
390 write(
ilog,*)
' TOTAL VOLUME = ',totsum(1)
391 write(*,*)
' TOTAL VOLUME = ',totsum(1)
392 write(
ilog,*)
' AVERAGE VOLUME OF ELEMENTS = ',avvol
393 write(*,*)
' AVERAGE VOLUME OF ELEMENTS = ',avvol
394 write(
ilog,*)
' MAXIMUM VOLUME OF ELEMENTS = ',totmax(1)
395 write(*,*)
' MAXIMUM VOLUME OF ELEMENTS = ',totmax(1)
396 write(
ilog,*)
' MINIMUM VOLUME OF ELEMENTS = ',totmin(1)
397 write(*,*)
' MINIMUM VOLUME OF ELEMENTS = ',totmin(1)
398 write(
ilog,*)
' MAXIMUM LENGTH OF ELEMENT EDGES = ',totmax(2)
399 write(*,*)
' MAXIMUM LENGTH OF ELEMENT EDGES = ',totmax(2)
400 write(
ilog,*)
' MINIMUM LENGTH OF ELEMENT EDGES = ',totmin(2)
401 write(*,*)
' MINIMUM LENGTH OF ELEMENT EDGES = ',totmin(2)
402 write(
ilog,*)
' MAXIMUM ASPECT RATIO = ',totmax(3)
403 write(*,*)
' MAXIMUM ASPECT RATIO = ',totmax(3)
411 type (hecmwST_local_mesh) :: hecMESH
412 type (hecmwST_matrix) :: hecMAT
414 integer(kind=kint) :: i, j, in, jS, jE, ftype, n, ndof, nnz, fio
415 real(kind=
kreal) :: rnum, dens, cond
416 character :: fileid*3
418 fio = 70 + hecmesh%my_rank
419 write(fileid,
"(i3.3)")hecmesh%my_rank
427 nnz = 9*n + 9*2*hecmat%indexL(n)
428 dens = 100*dble(nnz)/dble(9*n*n)
429 rnum = (7.21d0+0.01*dlog10(dble(hecmat%N)))*10.0d0/dble(hecmat%N)
433 open(fio,file=
'nonzero.dat.'//fileid, status=
'replace')
436 js= hecmat%indexL(i-1) + 1
437 je= hecmat%indexL(i )
438 write(fio,
"(i0,a,i0)")i,
" ",i
441 write(fio,
"(i0,a,i0)")i,
" ",in
442 write(fio,
"(i0,a,i0)")in,
" ",i
447 open(fio,file=
'nonzero.plt.'//fileid, status=
'replace')
449 write(fio,
"(a)")
'set terminal png size 1500,1500'
451 write(fio,
"(a)")
'set terminal postscript eps enhanced color solid "TimesNewRomanPSMT" 20'
454 write(fio,
"(a)")
'unset key'
455 write(fio,
"(a)")
'unset xtics'
456 write(fio,
"(a)")
'unset ytics'
457 write(fio,
"(a)")
'set size ratio 1.0'
458 write(fio,
"(a)")
'set border lw 1.0'
459 write(fio,
"(a,i0,a)")
'set xrange[0.5:',n,
'.5]'
460 write(fio,
"(a,i0,a)")
'set yrange[0.5:',n,
'.5] reverse '
463 write(fio,
"(a)")
'set out "image.'//fileid//
'.png"'
465 write(fio,
"(a)")
'set out "image.'//fileid//
'.eps"'
466 write(fio,
"(a)" )
'set label 1 "Name" at graph 1.1,0.9'
467 write(fio,
"(a)")
'set label 2 "N" at graph 1.1,0.85'
468 write(fio,
"(a)")
'set label 3 "Non-Zero Elem." at graph 1.1,0.8'
469 write(fio,
"(a)")
'set label 4 "Density [%]" at graph 1.1,0.75'
470 write(fio,
"(a)")
'set label 9 "Condition Num." at graph 1.1,0.7'
471 write(fio,
"(a)" )
'set label 5 ": matrix" at graph 1.4,0.9'
472 write(fio,
"(a,i0,a)")
'set label 6 ": ',ndof,
'" at graph 1.4,0.85'
473 write(fio,
"(a,i0,a)")
'set label 7 ": ',nnz,
'" at graph 1.4,0.8'
474 write(fio,
"(a,1pe9.2,a)")
'set label 8 ": ',dens,
'" at graph 1.4,0.75'
475 write(fio,
"(a,1pe9.2,a)")
'set label 10 ": ',cond,
'" at graph 1.4,0.7'
478 write(fio,
"(a,f12.5,a)")
'plot "nonzero.dat.'//fileid//
'" pointtype 5 pointsize ',rnum,
' linecolor rgb "#F96566"'
482 write(*,*)
' ### Command recommendation'
483 write(*,*)
' gnuplot -persist "nonzero.plt"'