OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_merge_node.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| hm_read_merge_node ../starter/source/elements/reader/hm_read_merge_node.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_floatv ../starter/source/devtools/hm_reader/hm_get_floatv.F
30!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
31!|| hm_option_read_key ../starter/source/devtools/hm_reader/hm_option_read_key.F
32!|| hm_option_start ../starter/source/devtools/hm_reader/hm_option_start.F
33!||--- uses -----------------------------------------------------
34!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.f
35!|| message_mod ../starter/share/message_module/message_mod.F
36!|| submodel_mod ../starter/share/modules1/submodel_mod.F
37!||====================================================================
38 SUBROUTINE hm_read_merge_node(X,LSUBMODEL,UNITAB,IGRNOD,MERGE_NODE_TAB,
39 . MERGE_NODE_TOL,NMERGE_NODE_CAND,NMERGE_NODE_DEST)
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
43 USE unitab_mod
44 USE groupdef_mod
45 USE message_mod
46 USE submodel_mod
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "units_c.inc"
57#include "com04_c.inc"
58C-----------------------------------------------
59C D u m m y A r g u m e n t s
60C-----------------------------------------------
61 INTEGER MERGE_NODE_TAB(4,*),NMERGE_NODE_CAND,NMERGE_NODE_DEST
63 . x(3,*),merge_node_tol(*)
64 TYPE(unit_type_),INTENT(IN) ::UNITAB
65 TYPE(submodel_data),INTENT(IN)::LSUBMODEL(*)
66 TYPE (GROUP_) ,TARGET, DIMENSION(NGRNOD) :: IGRNOD
67C-----------------------------------------------
68C L o c a l V a r i a b l e s
69C-----------------------------------------------
70 INTEGER :: I,J,ID,UID,GR_ID,GR_IDS,MERGE_TYPE,FLAG_FULL_MERGE
71 CHARACTER(LEN=NCHARTITLE) :: TITR
72 INTEGER, DIMENSION(:),ALLOCATABLE :: TAGNOD1,TAGNOD2,TAGNOD_TEMP
73 LOGICAL :: IS_AVAILABLE
74 my_real :: tol,xn,xmin,xmax,ymin,ymax,zmin,zmax,dx,dy,dz,tol_def
75C=======================================================================
76C
77 WRITE(iout,1000)
78C
79 tol_def = zero
80 flag_full_merge = 0
81 ALLOCATE(tagnod1(numnod),tagnod2(numnod),tagnod_temp(numnod))
82 tagnod1(1:numnod) = 0
83 tagnod2(1:numnod) = 0
84C
85C--------------------------------------------------
86C START BROWSING MODEL MERGE
87C--------------------------------------------------
88 is_available = .false.
89 CALL hm_option_start('/MERGE/NODE')
90C--------------------------------------------------
91 DO i=1,nb_merge_node
92C--------------------------------------------------
93C EXTRACT DATAS OF /RBODY/... LINE
94C--------------------------------------------------
95 CALL hm_option_read_key(lsubmodel,
96 . option_id = id,
97 . unit_id = uid,
98 . option_titr = titr)
99C--------------------------------------------------
100C EXTRACT DATAS
101C--------------------------------------------------
102 CALL hm_get_floatv('tol' ,tol ,is_available, lsubmodel, unitab)
103 CALL hm_get_intv ('Type' ,merge_type ,is_available, lsubmodel)
104 CALL hm_get_intv ('grnod_id' ,gr_id ,is_available, lsubmodel)
105C
106 gr_ids = 0
107 IF (gr_id > 0) THEN
108C-- Grnod
109 DO j=1,ngrnod
110 IF (igrnod(j)%ID == gr_id) gr_ids = j
111 ENDDO
112 IF (gr_ids == 0) THEN
113 CALL ancmsg(msgid=53,
114 . msgtype=msgerror,
115 . anmode=aninfo,
116 . c1='IN /MERGE/NODE DEFINITION',
117 . i1=gr_id)
118 ENDIF
119 ENDIF
120C
121 IF ((tol_def == zero).AND.(tol == zero)) THEN
122C-- computation of default tolerance (only one time)
123 xn=numnod
124 xmin = ep20
125 xmax = -ep20
126 ymin = ep20
127 ymax = -ep20
128 zmin = ep20
129 zmax = -ep20
130 DO j = 1,numnod
131 xmin = min(xmin,x(1,j))
132 xmax = max(xmax,x(1,j))
133 ymin = min(ymin,x(2,j))
134 ymax = max(ymax,x(2,j))
135 zmin = min(zmin,x(3,j))
136 zmax = max(zmax,x(3,j))
137 END DO
138 dx = xmax-xmin
139 dy = ymax-ymin
140 dz = zmax-zmin
141 tol_def = em05*(dx+dy+dz)/(three*exp(third*log(xn)))
142 ENDIF
143C
144 IF (gr_ids > 0) THEN
145C-- Grnod id is defined
146 IF (merge_type == 0) merge_type = 1
147 IF (merge_type == 1) THEN
148C-- nodes of the group are candidates and destinations
149 DO j=1,igrnod(gr_ids)%NENTITY
150 tagnod1(igrnod(gr_ids)%ENTITY(j)) = 1
151 tagnod2(igrnod(gr_ids)%ENTITY(j)) = 1
152 ENDDO
153 ELSEIF (merge_type == 2) THEN
154C-- nodes of the group are candidates and nodes outside group are destinations
155 tagnod_temp(1:numnod) = 0
156 DO j=1,igrnod(gr_ids)%NENTITY
157 tagnod1(igrnod(gr_ids)%ENTITY(j)) = 1
158 tagnod_temp(igrnod(gr_ids)%ENTITY(j)) = 1
159 ENDDO
160 DO j=1,numnod
161 IF (tagnod_temp(j)==0) tagnod2(j) = 1
162 ENDDO
163 ENDIF
164 ELSE
165C-- all nodes taken into account
166 IF (flag_full_merge == 0) THEN
167 flag_full_merge = id
168 ELSE
169 CALL ancmsg(msgid=2036,
170 . msgtype=msgerror,
171 . anmode=aninfo_blind_1,
172 . i1=id,i2=flag_full_merge)
173 ENDIF
174 gr_ids=0
175 tagnod1(1:numnod) = 1
176 tagnod2(1:numnod) = 1
177 merge_type = 1
178 ENDIF
179C
180 IF (tol == zero) tol = tol_def
181 nmerge_node_cand = 0
182 nmerge_node_dest = 0
183 DO j=1,numnod
184 IF (tagnod1(j) == 1) nmerge_node_cand = nmerge_node_cand + 1
185 IF (tagnod2(j) == 1) nmerge_node_dest = nmerge_node_dest + 1
186 ENDDO
187 merge_node_tab(1,i) = merge_type
188 merge_node_tab(2,i) = gr_ids
189 merge_node_tab(3,i) = gr_id
190 merge_node_tab(4,i) = id
191 merge_node_tol(i) = tol
192C
193 WRITE(iout,1100) id,trim(titr),tol,merge_type,gr_id
194C
195 ENDDO
196C
197 DEALLOCATE(tagnod1,tagnod2,tagnod_temp)
198C
199C-----------
200 RETURN
201C
2021000 FORMAT(/
203 . ' MERGE/NODE DEFINITIONS '/
204 . ' ---------------------- ')
2051100 FORMAT(/5x,'MERGE NODE ID ',i10,1x,a
206 . /5x,'TOLERANCE. . . . . . . . . . . . . . . . .',1pg20.4
207 . /5x,'MERGING TYPE. . . . . . . . . . . . . . . ',i10
208 . /5x,'GROUP OF NODES. . . . . . . . . . . . . . ',i10)
209 END
210C
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_floatv(name, rval, is_available, lsubmodel, unitab)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_start(entity_type)
subroutine hm_read_merge_node(x, lsubmodel, unitab, igrnod, merge_node_tab, merge_node_tol, nmerge_node_cand, nmerge_node_dest)
subroutine ymax(idn, fac, npc, pld, stiffmin, stiffmax, stiffini, stiffavg)
Definition law100_upd.F:274
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
integer, parameter nchartitle
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:895
program starter
Definition starter.F:39