OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
inter_cell_color.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "com04_c.inc"
#include "task_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine inter_cell_color (x, igap, nrtm, stf, tzinf, curv_max, gapmin, gapmax, gap_m, irect, gap, bgapsmx, drad, nb_index_cell, size_index_cell, index_cell, needed, main_coarse_grid, dgapload)

Function/Subroutine Documentation

◆ inter_cell_color()

subroutine inter_cell_color ( x,
integer igap,
integer nrtm,
stf,
tzinf,
curv_max,
gapmin,
gapmax,
gap_m,
integer, dimension(4,nrtm) irect,
gap,
bgapsmx,
drad,
integer, intent(inout) nb_index_cell,
integer, intent(in) size_index_cell,
integer, dimension(size_index_cell), intent(inout) index_cell,
logical, intent(in) needed,
integer, dimension(nb_box_coarse_grid,nb_box_coarse_grid,nb_box_coarse_grid), intent(inout) main_coarse_grid,
intent(in) dgapload )

Definition at line 31 of file inter_cell_color.F.

36!$COMMENT
37! INTER_CELL_COLOR description :
38! color the fine cell & coarse cell with main nodes
39!
40! INTER_CELL_COLOR organization :
41! loop over the active MAIN surface and :
42! * computation of fine grid index IX/IY/IZ
43! * color the fine grid IX/IY/IZ
44! * if the interface is a large interface : computation of coarse grid index and coloration of coarse grid
45!$ENDCOMMENT
46C-----------------------------------------------
47C M o d u l e s
48C-----------------------------------------------
51C-----------------------------------------------
52C I m p l i c i t T y p e s
53C-----------------------------------------------
54#include "implicit_f.inc"
55#include "comlock.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com04_c.inc"
60#include "task_c.inc"
61C-----------------------------------------------
62C D u m m y A r g u m e n t s
63C-----------------------------------------------
64 LOGICAL, INTENT(in) :: NEEDED
65 INTEGER :: IGAP, NRTM, IRECT(4,NRTM)
66 my_real :: x(3,numnod),stf(nrtm), gap_m(nrtm), bgapsmx,drad
67 my_real :: tzinf,gapmin,gapmax,gap,curv_max(nrtm)
68 INTEGER, INTENT(inout) :: NB_INDEX_CELL
69 INTEGER, INTENT(in) :: SIZE_INDEX_CELL
70 INTEGER, DIMENSION(SIZE_INDEX_CELL),INTENT(inout) :: INDEX_CELL
71 INTEGER, DIMENSION(NB_BOX_COARSE_GRID,NB_BOX_COARSE_GRID,NB_BOX_COARSE_GRID), INTENT(inout) :: MAIN_COARSE_GRID
72 my_real , INTENT(IN) :: dgapload
73C-----------------------------------------------
74C L o c a l V a r i a b l e s
75C-----------------------------------------------
76 INTEGER LOC_PROC,
77 . NBX,NBY,NBZ,NE,M1,M2,M3,M4,
78 . IX1,IY1,IZ1,IX2,IY2,IZ2,IX,IY,IZ
80 . aaa, marge,
81 . xmaxb,ymaxb,zmaxb,xminb,yminb,zminb,
82 . xmine,ymine,zmine,xmaxe,ymaxe,zmaxe,
83 . xx1,xx2,xx3,xx4,yy1,yy2,yy3,yy4,zz1,zz2,zz3,zz4
84 INTEGER :: IX_COARSE,IY_COARSE,IZ_COARSE
85 my_real :: VALUE,real_value
86C-----------------------------------------------
87C S o u r c e L i n e s
88C-----------------------------------------------
89 loc_proc = ispmd + 1
90 marge = tzinf-max(gap+dgapload,drad)
91
92 nbx = nb_cell_x
93 nby = nb_cell_y
94 nbz = nb_cell_z
95
96 xmaxb = box_limit(1)
97 ymaxb = box_limit(2)
98 zmaxb = box_limit(3)
99 xminb = box_limit(4)
100 yminb = box_limit(5)
101 zminb = box_limit(6)
102 ! ------------------------------
103 ! loop over the main surface
104 DO ne=1,nrtm
105 ! skip the deleted surfaces
106 IF(stf(ne) == zero)cycle
107
108 IF(igap == 0)THEN
109 aaa = tzinf+curv_max(ne)
110 ELSE
111 aaa = marge+curv_max(ne)+
112 . max(min(gapmax,max(gapmin,bgapsmx+gap_m(ne)))+dgapload,drad)
113 ENDIF
114 ! nodes of the surface
115 m1 = irect(1,ne)
116 m2 = irect(2,ne)
117 m3 = irect(3,ne)
118 m4 = irect(4,ne)
119 xx1=x(1,m1)
120 xx2=x(1,m2)
121 xx3=x(1,m3)
122 xx4=x(1,m4)
123 xmaxe=max(xx1,xx2,xx3,xx4)
124 xmine=min(xx1,xx2,xx3,xx4)
125
126 yy1=x(2,m1)
127 yy2=x(2,m2)
128 yy3=x(2,m3)
129 yy4=x(2,m4)
130 ymaxe=max(yy1,yy2,yy3,yy4)
131 ymine=min(yy1,yy2,yy3,yy4)
132
133 zz1=x(3,m1)
134 zz2=x(3,m2)
135 zz3=x(3,m3)
136 zz4=x(3,m4)
137 zmaxe=max(zz1,zz2,zz3,zz4)
138 zmine=min(zz1,zz2,zz3,zz4)
139
140 ! cell index computation
141 ix1=int(nbx*(xmine-aaa-xminb)/(xmaxb-xminb))
142 iy1=int(nby*(ymine-aaa-yminb)/(ymaxb-yminb))
143 iz1=int(nbz*(zmine-aaa-zminb)/(zmaxb-zminb))
144
145 ix1=max(1,min(nbx,ix1))
146 iy1=max(1,min(nby,iy1))
147 iz1=max(1,min(nbz,iz1))
148
149 ix2=int(nbx*(xmaxe+aaa-xminb)/(xmaxb-xminb))
150 iy2=int(nby*(ymaxe+aaa-yminb)/(ymaxb-yminb))
151 iz2=int(nbz*(zmaxe+aaa-zminb)/(zmaxb-zminb))
152
153 ix2=max(1,min(nbx,ix2))
154 iy2=max(1,min(nby,iy2))
155 iz2=max(1,min(nbz,iz2))
156
157 real_value = float(nb_box_coarse_grid)
158
159 ! loop over the cell and cell coloration
160 DO iz = iz1, iz2
161 VALUE = real_value*float(iz)/float(nb_cell_z)
162 iz_coarse = min(int(VALUE),nb_box_coarse_grid)
163 iz_coarse = max(iz_coarse,1)
164 DO iy = iy1, iy2
165 VALUE = real_value*float(iy)/float(nb_cell_y)
166 iy_coarse = min(int(VALUE),nb_box_coarse_grid)
167 iy_coarse = max(iy_coarse,1)
168 DO ix = ix1, ix2
169 VALUE = real_value*float(ix)/float(nb_cell_x)
170 ix_coarse = min(int(VALUE),nb_box_coarse_grid)
171 ix_coarse = max(ix_coarse,1)
172 IF(cell_bool(ix,iy,iz)) THEN
173 nb_index_cell = nb_index_cell + 1
174 index_cell(nb_index_cell) = ix + 1000*iy +1000**2 * iz
175 cell_bool(ix,iy,iz) = .false.
176 IF(needed) main_coarse_grid(ix_coarse,iy_coarse,iz_coarse) = 1
177 ENDIF
178 END DO
179 END DO
180 END DO
181 ENDDO
182 ! ------------------------------
183C
184 RETURN
#define my_real
Definition cppsort.cpp:32
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21
logical, dimension(:,:,:), allocatable cell_bool
integer, parameter nb_box_coarse_grid