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

Go to the source code of this file.

Functions/Subroutines

subroutine ingrbric_dx (nbric, ibufssg, global_gap, ixs, x, noint, titr, is_gap_computed, pm, ipm, iddlevel, istiff, auto_rho, auto_length, multi_fvm)

Function/Subroutine Documentation

◆ ingrbric_dx()

subroutine ingrbric_dx ( integer, intent(in) nbric,
integer, dimension(*), intent(in) ibufssg,
intent(inout) global_gap,
integer, dimension(nixs,numels), intent(in) ixs,
dimension(3,numnod), intent(in) x,
integer, intent(in) noint,
character(len=nchartitle), intent(in) titr,
logical, intent(inout) is_gap_computed,
dimension(npropm,nummat), intent(in) pm,
integer, dimension(npropmi,nummat), intent(in) ipm,
integer, intent(in) iddlevel,
integer, intent(in) istiff,
intent(inout) auto_rho,
intent(inout) auto_length,
type(multi_fvm_struct), intent(in) multi_fvm )

Definition at line 32 of file ingrbric_dx.F.

36C-----------------------------------------------
37C D e s c r i p t i o n
38C-----------------------------------------------
39C This subroutine is computing mesh size from the brick group which is
40C related to interface type 18. A gap value is then set consequently.
41C
42C A check is also introduced about aspect ratio
43C because
44C - in this case it is not obvious to determine if computed gap is the expected one
45C - it is recommended to use uniform mesh size with colocated scheme : ie law151
46C-----------------------------------------------
47C M o d u l e s
48C-----------------------------------------------
49 USE message_mod
50 USE multi_fvm_mod
52C-----------------------------------------------
53C I m p l i c i t T y p e s
54C-----------------------------------------------
55#include "implicit_f.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com04_c.inc"
60#include "param_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 INTEGER,INTENT(IN) :: NBRIC, NOINT, IDDLEVEL,ISTIFF
65 INTEGER,INTENT(IN) :: IBUFSSG(*), IXS(NIXS,NUMELS), IPM(NPROPMI,NUMMAT)
66 my_real,INTENT(INOUT) :: global_gap
67 my_real,INTENT(IN) :: x(3,numnod)
68 CHARACTER(LEN=NCHARTITLE) ,INTENT(IN) :: TITR
69 LOGICAL, INTENT(INOUT) :: IS_GAP_COMPUTED
70 my_real , INTENT(IN) :: pm(npropm,nummat)
71 my_real, INTENT(INOUT) :: auto_rho, auto_length
72 TYPE(MULTI_FVM_STRUCT), INTENT(IN) :: MULTI_FVM
73C-----------------------------------------------
74C L o c a l V a r a i b l e s
75C-----------------------------------------------
76 INTEGER :: I, J, J2, IEDG, CONNECT1(12), CONNECT2(12),IE,IMAT, ENUM, ILAW
77 my_real :: min_x,min_y,min_z
78 my_real :: max_x,max_y,max_z
79 my_real :: xx,yy,zz
80 my_real :: xx2,yy2,zz2
81 my_real :: dx,dy,dz
82 my_real :: diag, diag_max , max_ratio, len_edge(12), lmax, lmin, ratio2
83 my_real :: rho_max, rho0
84 LOGICAL :: CHECK_ASPECT
85 CHARACTER(LEN=NCHARTITLE) :: MSGTITL
86 CHARACTER*10 :: CHAR_ID
87C-----------------------------------------------
88C S o u r c e L i n e s
89C-----------------------------------------------
90
91 is_gap_computed = .false.
92
93 !-----------------------------------------
94 ! COMPUTE GLOBAL GAP
95 !-----------------------------------------
96 IF(global_gap == zero)THEN
97 !global gap required to estimate a stiffness value (automatic stiffness value when ISTIFF==2)
98 !global gap also required when a constant gap is not input IGAP=0
99 diag_max = em20
100 DO i=1,nbric
101 ie = ibufssg(i)
102 IF(ie==0)EXIT
103 max_x = -ep20
104 max_y = -ep20
105 max_z = -ep20
106 min_x = ep20
107 min_y = ep20
108 min_z = ep20
109 DO j=2,9
110 IF(ixs(j,ibufssg(i))==0)EXIT
111 xx = x(1,ixs(j,ie))
112 yy = x(2,ixs(j,ie))
113 zz = x(3,ixs(j,ie))
114 IF(xx < min_x)min_x=xx
115 IF(yy < min_y)min_y=yy
116 IF(zz < min_z)min_z=zz
117 IF(xx > max_x)max_x=xx
118 IF(yy > max_y)max_y=yy
119 IF(zz > max_z)max_z=zz
120 ENDDO
121 dx = min_x-max_x
122 dy = min_y-max_y
123 dz = min_z-max_z
124 diag = sqrt(dx*dx+dy*dy+dz*dz)
125 diag = sqrt(three)*diag
126 diag = half*diag ! sqrt(3)/2 * DIAG = ~ 1.5*MESH_SIZE
127 IF(diag > diag_max)diag_max=diag
128 END DO
129 global_gap = diag_max
130 auto_length = sqrt(three)*third*diag_max
131 is_gap_computed = .true.
132 ENDIF
133
134 !-----------------------------------------
135 ! DETERMINE GLOBAL DENSITY
136 !-----------------------------------------
137 rho_max = zero
138 IF(istiff == 2)THEN
139 rho_max=zero
140 DO i=1,nbric
141 ie=ibufssg(i)
142 IF(ie == 0)EXIT
143 imat=ixs(1,ie)
144 rho0=pm(89,imat)
145 ilaw=ipm(2,imat)
146 IF(ilaw == 51 .OR. ilaw == 151)THEN
147 rho_max = max(rho_max,pm(91,imat)) ! use rho_max(1:nsubmat) in case of multi material laws
148 ELSE
149 rho_max = max(rho_max, rho0) ! monomaterial case
150 ENDIF
151 END DO
152 ENDIF
153 auto_rho = rho_max
154
155 !-----------------------------------------
156 ! CHECK ASPECT RATIO
157 !-----------------------------------------
158 check_aspect=.false.
159 IF(iddlevel==1 .AND. multi_fvm%IS_USED)check_aspect=.true.
160 IF (check_aspect)THEN
161 !edge connectivity
162 connect1(1:12)=(/1,1,1,2,2,3,3,4,5,5,6,7/)
163 connect2(1:12)=(/2,4,5,3,6,4,7,8,6,8,7,8/)
164 enum=0
165 DO i=1,nbric
166 DO iedg=1,12
167 j=1+connect1(iedg)
168 j2=1+connect2(iedg)
169 xx = x(1,ixs(j,ibufssg(i)))
170 yy = x(2,ixs(j,ibufssg(i)))
171 zz = x(3,ixs(j,ibufssg(i)))
172 xx2 = x(1,ixs(j2,ibufssg(i)))
173 yy2 = x(2,ixs(j2,ibufssg(i)))
174 zz2 = x(3,ixs(j2,ibufssg(i)))
175 dx = xx-xx2
176 dy = yy-yy2
177 dz = zz-zz2
178 len_edge(iedg) = dx*dx + dy*dy + dz*dz
179 ENDDO
180 lmin=minval(len_edge)
181 lmax=maxval(len_edge)
182 ratio2 = lmax/lmin ! ratio of squared values
183 IF(ratio2 > 6.25 .AND. ENUM < 10)then
184 char_id=' '
185 WRITE(char_id,fmt='(I0)')ixs(11,ibufssg(i))
186 msgtitl='CHECK ASPECT RATIO CELL ID ='//char_id
187 CALL ancmsg(msgid=1826, msgtype=msgwarning, anmode=aninfo, i1=noint, c1=titr, c2=msgtitl)
188 enum=enum+1
189 ENDIF
190 IF(ENUM == 10)exit
191 ENDDO
192 ENDIF
193C------------------------------------------------------------
194 RETURN
#define my_real
Definition cppsort.cpp:32
#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