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!|| ngr2usr ../starter/source/system/nintrr.F
34!||--- uses -----------------------------------------------------
35!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
36!|| message_mod ../starter/share/message_module/message_mod.F
37!|| submodel_mod ../starter/share/modules1/submodel_mod.F
38!||====================================================================
39 SUBROUTINE hm_read_merge_node(X,LSUBMODEL,UNITAB,IGRNOD,MERGE_NODE_TAB,
40 . MERGE_NODE_TOL,NMERGE_NODE_CAND,NMERGE_NODE_DEST)
41C-----------------------------------------------
42C M o d u l e s
43C-----------------------------------------------
44 USE unitab_mod
45 USE groupdef_mod
46 USE message_mod
47 USE submodel_mod
50C-----------------------------------------------
51C I m p l i c i t T y p e s
52C-----------------------------------------------
53#include "implicit_f.inc"
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "units_c.inc"
58#include "com04_c.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER MERGE_NODE_TAB(4,*),NMERGE_NODE_CAND,NMERGE_NODE_DEST
64 . x(3,*),merge_node_tol(*)
65 TYPE(unit_type_),INTENT(IN) ::UNITAB
66 TYPE(submodel_data),INTENT(IN)::LSUBMODEL(*)
67 TYPE (GROUP_) ,TARGET, DIMENSION(NGRNOD) :: IGRNOD
68C-----------------------------------------------
69C L o c a l V a r i a b l e s
70C-----------------------------------------------
71 INTEGER I,J,ID,UID,IDN,GR_ID,GR_IDS,MERGE_TYPE,FLAG_FULL_MERGE
72 CHARACTER(LEN=NCHARTITLE) :: TITR
73 INTEGER, DIMENSION(:),ALLOCATABLE :: TAGNOD1,TAGNOD2,TAGNOD_TEMP
74 LOGICAL IS_AVAILABLE
75 my_real tol,xn,xmin,xmax,ymin,ymax,zmin,zmax,dx,dy,dz,tol_def
76C-----------------------------------------------
77C E x t e r n a l F u n c t i o n s
78C-----------------------------------------------
79 INTEGER NGR2USR
80 INTEGER, DIMENSION(:), POINTER :: INGR2USR
81C=======================================================================
82C
83 WRITE(iout,1000)
84C
85 tol_def = zero
86 flag_full_merge = 0
87 ALLOCATE(tagnod1(numnod),tagnod2(numnod),tagnod_temp(numnod))
88 tagnod1(1:numnod) = 0
89 tagnod2(1:numnod) = 0
90C
91C--------------------------------------------------
92C START BROWSING MODEL MERGE
93C--------------------------------------------------
94 is_available = .false.
95 CALL hm_option_start('/MERGE/NODE')
96C--------------------------------------------------
97 DO i=1,nb_merge_node
98C--------------------------------------------------
99C EXTRACT DATAS OF /RBODY/... LINE
100C--------------------------------------------------
101 CALL hm_option_read_key(lsubmodel,
102 . option_id = id,
103 . unit_id = uid,
104 . option_titr = titr)
105C--------------------------------------------------
106C EXTRACT DATAS
107C--------------------------------------------------
108 CALL hm_get_floatv('tol' ,tol ,is_available, lsubmodel, unitab)
109 CALL hm_get_intv ('Type' ,merge_type ,is_available, lsubmodel)
110 CALL hm_get_intv ('grnod_id' ,gr_id ,is_available, lsubmodel)
111C
112 gr_ids = 0
113 IF (gr_id > 0) THEN
114C-- Grnod
115 DO j=1,ngrnod
116 IF (igrnod(j)%ID == gr_id) gr_ids = j
117 ENDDO
118 IF (gr_ids == 0) THEN
119 CALL ancmsg(msgid=53,
120 . msgtype=msgerror,
121 . anmode=aninfo,
122 . c1='IN /MERGE/NODE DEFINITION',
123 . i1=gr_id)
124 ENDIF
125 ENDIF
126C
127 IF ((tol_def == zero).AND.(tol == zero)) THEN
128C-- computation of default tolerance (only one time)
129 xn=numnod
130 xmin = ep20
131 xmax = -ep20
132 ymin = ep20
133 ymax = -ep20
134 zmin = ep20
135 zmax = -ep20
136 DO j = 1,numnod
137 xmin = min(xmin,x(1,j))
138 xmax = max(xmax,x(1,j))
139 ymin = min(ymin,x(2,j))
140 ymax = max(ymax,x(2,j))
141 zmin = min(zmin,x(3,j))
142 zmax = max(zmax,x(3,j))
143 END DO
144 dx = xmax-xmin
145 dy = ymax-ymin
146 dz = zmax-zmin
147 tol_def = em05*(dx+dy+dz)/(three*exp(third*log(xn)))
148 ENDIF
149C
150 IF (gr_ids > 0) THEN
151C-- Grnod id is defined
152 IF (merge_type == 0) merge_type = 1
153 IF (merge_type == 1) THEN
154C-- nodes of the group are candidates and destinations
155 DO j=1,igrnod(gr_ids)%NENTITY
156 tagnod1(igrnod(gr_ids)%ENTITY(j)) = 1
157 tagnod2(igrnod(gr_ids)%ENTITY(j)) = 1
158 ENDDO
159 ELSEIF (merge_type == 2) THEN
160C-- nodes of the group are candidates and nodes outside group are destinations
161 tagnod_temp(1:numnod) = 0
162 DO j=1,igrnod(gr_ids)%NENTITY
163 tagnod1(igrnod(gr_ids)%ENTITY(j)) = 1
164 tagnod_temp(igrnod(gr_ids)%ENTITY(j)) = 1
165 ENDDO
166 DO j=1,numnod
167 IF (tagnod_temp(j)==0) tagnod2(j) = 1
168 ENDDO
169 ENDIF
170 ELSE
171C-- all nodes taken into account
172 IF (flag_full_merge == 0) THEN
173 flag_full_merge = id
174 ELSE
175 CALL ancmsg(msgid=2036,
176 . msgtype=msgerror,
177 . anmode=aninfo_blind_1,
178 . i1=id,i2=flag_full_merge)
179 ENDIF
180 gr_ids=0
181 tagnod1(1:numnod) = 1
182 tagnod2(1:numnod) = 1
183 merge_type = 1
184 ENDIF
185C
186 IF (tol == zero) tol = tol_def
187 nmerge_node_cand = 0
188 nmerge_node_dest = 0
189 DO j=1,numnod
190 IF (tagnod1(j) == 1) nmerge_node_cand = nmerge_node_cand + 1
191 IF (tagnod2(j) == 1) nmerge_node_dest = nmerge_node_dest + 1
192 ENDDO
193 merge_node_tab(1,i) = merge_type
194 merge_node_tab(2,i) = gr_ids
195 merge_node_tab(3,i) = gr_id
196 merge_node_tab(4,i) = id
197 merge_node_tol(i) = tol
198C
199 WRITE(iout,1100) id,trim(titr),tol,merge_type,gr_id
200C
201 ENDDO
202C
203 DEALLOCATE(tagnod1,tagnod2,tagnod_temp)
204C
205C-----------
206 RETURN
207C
2081000 FORMAT(/
209 . ' MERGE/NODE DEFINITIONS '/
210 . ' ---------------------- ')
2111100 FORMAT(/5x,'MERGE NODE ID ',i10,1x,a
212 . /5x,'TOLERANCE. . . . . . . . . . . . . . . . .',1pg20.4
213 . /5x,'MERGING TYPE. . . . . . . . . . . . . . . ',i10
214 . /5x,'GROUP OF NODES. . . . . . . . . . . . . . ',i10)
215 END
216C
#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:272
#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:889