22 type(hecmwst_local_mesh),
intent(in) :: hecmesh
23 type(hecmwst_result_data),
intent(inout) :: fstrresult
24 real(kind=kreal),
intent(in) :: elem_vol(:)
25 real(kind=kreal),
intent(in) :: elem_asp(:)
27 integer(kind=kint) :: n_ncomp, n_ecomp, n_nitem, n_eitem
28 integer(kind=kint) :: i, j, ie, ig, js, je, idx, isect, cid
29 integer(kind=kint) :: n_ngrp, n_egrp, n_sgrp
30 integer(kind=kint) :: ic, isurf, ic_type, stype, nn, j0, k
31 integer(kind=kint) :: snode(20)
33 n_ngrp = hecmesh%node_group%n_grp
34 n_egrp = hecmesh%elem_group%n_grp
35 n_sgrp = hecmesh%surf_group%n_grp
38 n_ncomp = n_ngrp + n_sgrp
39 n_nitem = n_ngrp + n_sgrp
42 n_ecomp = n_egrp + n_sgrp + 4
46 fstrresult%ng_component = 0
47 fstrresult%nn_component = n_ncomp
48 fstrresult%ne_component = n_ecomp
51 allocate(fstrresult%ng_dof(0))
52 allocate(fstrresult%global_label(0))
53 allocate(fstrresult%global_val_item(0))
56 allocate(fstrresult%nn_dof(n_ncomp))
57 allocate(fstrresult%node_label(n_ncomp))
58 allocate(fstrresult%node_val_item(n_nitem * hecmesh%n_node))
60 fstrresult%node_val_item = 0.0d0
63 allocate(fstrresult%ne_dof(n_ecomp))
64 allocate(fstrresult%elem_label(n_ecomp))
65 allocate(fstrresult%elem_val_item(n_eitem * hecmesh%n_elem))
67 fstrresult%elem_val_item = 0.0d0
71 fstrresult%node_label(ig) =
'NGRP_' // trim(hecmesh%node_group%grp_name(ig))
72 js = hecmesh%node_group%grp_index(ig-1)
73 je = hecmesh%node_group%grp_index(ig)
75 idx = hecmesh%node_group%grp_item(j)
76 if(idx >= 1 .and. idx <= hecmesh%n_node)
then
77 fstrresult%node_val_item(n_nitem*(idx-1) + ig) = 1.0d0
84 fstrresult%node_label(n_ngrp + ig) =
'SGRP_' // trim(hecmesh%surf_group%grp_name(ig))
85 js = hecmesh%surf_group%grp_index(ig-1)
86 je = hecmesh%surf_group%grp_index(ig)
88 ic = hecmesh%surf_group%grp_item(2*j-1)
89 isurf = hecmesh%surf_group%grp_item(2*j)
90 if(ic < 1 .or. ic > hecmesh%n_elem) cycle
91 ic_type = hecmesh%elem_type(ic)
94 j0 = hecmesh%elem_node_index(ic-1)
96 idx = hecmesh%elem_node_item(j0 + snode(k))
97 if(idx >= 1 .and. idx <= hecmesh%n_node)
then
98 fstrresult%node_val_item(n_nitem*(idx-1) + n_ngrp + ig) = 1.0d0
106 fstrresult%elem_label(ig) =
'EGRP_' // trim(hecmesh%elem_group%grp_name(ig))
107 js = hecmesh%elem_group%grp_index(ig-1)
108 je = hecmesh%elem_group%grp_index(ig)
110 idx = hecmesh%elem_group%grp_item(j)
111 if(idx >= 1 .and. idx <= hecmesh%n_elem)
then
112 fstrresult%elem_val_item(n_eitem*(idx-1) + ig) = 1.0d0
119 fstrresult%elem_label(n_egrp + ig) =
'SGRP_FACE_' // trim(hecmesh%surf_group%grp_name(ig))
120 js = hecmesh%surf_group%grp_index(ig-1)
121 je = hecmesh%surf_group%grp_index(ig)
123 idx = hecmesh%surf_group%grp_item(2*j-1)
124 if(idx >= 1 .and. idx <= hecmesh%n_elem)
then
125 fstrresult%elem_val_item(n_eitem*(idx-1) + n_egrp + ig) = &
126 dble(hecmesh%surf_group%grp_item(2*j))
132 i = n_egrp + n_sgrp + 1
133 fstrresult%elem_label(i) =
'MATERIAL_ID'
134 do ie = 1, hecmesh%n_elem
135 isect = hecmesh%section_ID(ie)
136 if(isect >= 1 .and. isect <= hecmesh%section%n_sect)
then
137 cid = hecmesh%section%sect_mat_ID_item(isect)
138 fstrresult%elem_val_item(n_eitem*(ie-1) + i) = dble(cid)
143 i = n_egrp + n_sgrp + 2
144 fstrresult%elem_label(i) =
'SECTION_ID'
145 do ie = 1, hecmesh%n_elem
146 fstrresult%elem_val_item(n_eitem*(ie-1) + i) = dble(hecmesh%section_ID(ie))
150 i = n_egrp + n_sgrp + 3
151 fstrresult%elem_label(i) =
'VOLUME'
152 do ie = 1, hecmesh%n_elem
153 fstrresult%elem_val_item(n_eitem*(ie-1) + i) = elem_vol(ie)
157 i = n_egrp + n_sgrp + 4
158 fstrresult%elem_label(i) =
'ASPECT_RATIO'
159 do ie = 1, hecmesh%n_elem
160 fstrresult%elem_val_item(n_eitem*(ie-1) + i) = elem_asp(ie)
172 type(hecmwst_local_mesh),
intent(in) :: hecmesh
173 real(kind=kreal),
intent(in) :: elem_vol(:)
174 real(kind=kreal),
intent(in) :: elem_asp(:)
176 integer(kind=kint) :: ig, j, js, je, idx, ie, isect, cid
177 integer(kind=kint) :: n_ngrp, n_egrp, n_sgrp
178 integer(kind=kint) :: ic, isurf, ic_type, stype, nn, j0, k
179 integer(kind=kint) :: snode(20)
180 character(len=HECMW_HEADER_LEN) :: header
181 character(len=HECMW_MSG_LEN) :: comment
182 character(len=HECMW_NAME_LEN) :: label, nameid, addfname
183 real(kind=kreal),
allocatable :: work_n(:), work_e(:)
185 allocate(work_n(hecmesh%n_node))
186 allocate(work_e(hecmesh%n_elem))
188 header =
'*fstrresult'
189 comment =
'elemcheck_result'
192 n_ngrp = hecmesh%node_group%n_grp
193 n_egrp = hecmesh%elem_group%n_grp
194 n_sgrp = hecmesh%surf_group%n_grp
199 js = hecmesh%node_group%grp_index(ig-1)
200 je = hecmesh%node_group%grp_index(ig)
202 idx = hecmesh%node_group%grp_item(j)
203 if(idx >= 1 .and. idx <= hecmesh%n_node) work_n(idx) = 1.0d0
205 label =
'NGRP_' // trim(hecmesh%node_group%grp_name(ig))
212 js = hecmesh%surf_group%grp_index(ig-1)
213 je = hecmesh%surf_group%grp_index(ig)
215 ic = hecmesh%surf_group%grp_item(2*j-1)
216 isurf = hecmesh%surf_group%grp_item(2*j)
217 if(ic < 1 .or. ic > hecmesh%n_elem) cycle
218 ic_type = hecmesh%elem_type(ic)
221 j0 = hecmesh%elem_node_index(ic-1)
223 idx = hecmesh%elem_node_item(j0 + snode(k))
224 if(idx >= 1 .and. idx <= hecmesh%n_node) work_n(idx) = 1.0d0
227 label =
'SGRP_' // trim(hecmesh%surf_group%grp_name(ig))
234 js = hecmesh%elem_group%grp_index(ig-1)
235 je = hecmesh%elem_group%grp_index(ig)
237 idx = hecmesh%elem_group%grp_item(j)
238 if(idx >= 1 .and. idx <= hecmesh%n_elem) work_e(idx) = 1.0d0
240 label =
'EGRP_' // trim(hecmesh%elem_group%grp_name(ig))
247 js = hecmesh%surf_group%grp_index(ig-1)
248 je = hecmesh%surf_group%grp_index(ig)
250 idx = hecmesh%surf_group%grp_item(2*j-1)
251 if(idx >= 1 .and. idx <= hecmesh%n_elem)
then
252 work_e(idx) = dble(hecmesh%surf_group%grp_item(2*j))
255 label =
'SGRP_FACE_' // trim(hecmesh%surf_group%grp_name(ig))
260 do ie = 1, hecmesh%n_elem
261 isect = hecmesh%section_ID(ie)
262 if(isect >= 1 .and. isect <= hecmesh%section%n_sect)
then
263 cid = hecmesh%section%sect_mat_ID_item(isect)
264 work_e(ie) = dble(cid)
272 do ie = 1, hecmesh%n_elem
273 work_e(ie) = dble(hecmesh%section_ID(ie))
285 addfname =
'_precheck'
This module encapsulate the basic functions of all elements provide by this software.
integer(kind=kind(2)) function getnumberofnodes(etype)
Obtain number of nodes of the element.
subroutine getsubface(intype, innumber, outtype, nodes)
Find the definition of surface of the element.
subroutine, public hecmw_result_write_by_addfname(name_ID, addfname)
subroutine, public hecmw_result_add(dtype, n_dof, label, data)
subroutine, public hecmw_result_finalize()
subroutine, public hecmw_result_init(hecMESH, i_step, header, comment)
integer(kind=kint), parameter, public hecmw_result_dtype_node
integer(kind=kint), parameter, public hecmw_result_dtype_elem
This module defines common data and basic structures for analysis.
This module constructs result data for ELEMCHECK visualization/result output.
subroutine, public precheck_make_result(hecMESH, fstrRESULT, elem_vol, elem_asp)
Build hecmwST_result_data for visualization via hecmw_visualize.
subroutine, public precheck_write_result(hecMESH, elem_vol, elem_asp)
Write check results to result file via hecmw_result_add/write interface.