OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_merge_node.F File Reference
#include "implicit_f.inc"
#include "units_c.inc"
#include "com04_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine hm_read_merge_node (x, lsubmodel, unitab, igrnod, merge_node_tab, merge_node_tol, nmerge_node_cand, nmerge_node_dest)

Function/Subroutine Documentation

◆ hm_read_merge_node()

subroutine hm_read_merge_node ( x,
type(submodel_data), dimension(*), intent(in) lsubmodel,
type(unit_type_), intent(in) unitab,
type (group_), dimension(ngrnod), target igrnod,
integer, dimension(4,*) merge_node_tab,
merge_node_tol,
integer nmerge_node_cand,
integer nmerge_node_dest )

Definition at line 38 of file hm_read_merge_node.F.

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)
#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 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
initmumps id
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