OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spinih.F File Reference
#include "implicit_f.inc"
#include "param_c.inc"
#include "sphcom.inc"
#include "scr17_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spinih (kxsp, ipart, ipartsp, spbuf, pm, ixsp, nod2sp, x, lprtsph, lonfsph, snod2sp, slonfsph, numnod, npart, itab)

Function/Subroutine Documentation

◆ spinih()

subroutine spinih ( integer, dimension(nisp,*) kxsp,
integer, dimension(lipart1,*) ipart,
integer, dimension(*) ipartsp,
spbuf,
pm,
integer, dimension(kvoisph,numsph), intent(inout) ixsp,
integer, dimension(snod2sp), intent(inout) nod2sp,
dimension(3,numnod), intent(in) x,
integer, dimension(2,0:npart), intent(inout) lprtsph,
integer, dimension(slonfsph), intent(inout) lonfsph,
integer, intent(in) snod2sp,
integer, intent(in) slonfsph,
integer, intent(in) numnod,
integer, intent(in) npart,
integer, dimension(*) itab )

Definition at line 32 of file spinih.F.

35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE my_alloc_mod
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------
44C G l o b a l P a r a m e t e r s
45C-----------------------------------------------
46#include "param_c.inc"
47#include "sphcom.inc"
48#include "scr17_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 INTEGER KXSP(NISP,*), IPART(LIPART1,*), IPARTSP(*),ITAB(*)
53 INTEGER ,INTENT(IN) :: SNOD2SP,SLONFSPH,NUMNOD,NPART
54 INTEGER ,INTENT(INOUT) :: IXSP(KVOISPH,NUMSPH),NOD2SP(SNOD2SP),LPRTSPH(2,0:NPART),
55 . LONFSPH(SLONFSPH)
57 . spbuf(nspbuf,*),pm(npropm,*)
58 my_real ,INTENT(IN) :: x(3,numnod)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62 INTEGER N, IPRT, I0, IMAT, PRE_SEARCH, FLG_H, J, NBNOD(NPART), SZ_INTP_DIST
63 my_real, DIMENSION(:), ALLOCATABLE :: max_intp_dist_part ! Max of interparticle distance per part
65 . dist, mp, rho, vol, sq2
66C-----------------------------------------------
68 . get_u_geo,h_scal,vol_tot
70 . xmin(npart),xmax(npart),ymin(npart),ymax(npart),zmin(npart),
71 . zmax(npart),volp_prt(npart)
72C-----------------------------------------------
73 pre_search = 0
74 sq2 = sqrt(two)
75C
76 volp_prt(1:npart)=zero
77 nbnod(1:npart)=0
78 xmin(1:npart)=ep30
79 xmax(1:npart)=-ep30
80 ymin(1:npart)=ep30
81 ymax(1:npart)=-ep30
82 zmin(1:npart)=ep30
83 zmax(1:npart)=-ep30
84C
85 DO n = 1, numsph
86 iprt=ipartsp(n)
87 imat=ipart(1,iprt)
88 i0 =ipart(2,iprt)
89 dist=get_u_geo(6,i0)
90 IF (nint(spbuf(13,n))==1) THEN
91C-- type = 1 - particle with mass input
92 mp = spbuf(12,n)
93 rho=pm(1,imat)
94 vol=mp/rho
95 dist=(sq2*vol)**third
96 ELSEIF (nint(spbuf(13,n))==2) THEN
97C-- type = 2 - particle with volume input
98 vol=spbuf(12,n)
99 dist=(sq2*vol)**third
100 ELSE
101C-- type = 0 - particle without mass/vol input
102 IF(dist==zero) THEN
103 mp =get_u_geo(1,i0)
104 rho=pm(1,imat)
105 vol=mp/rho
106 dist=(sq2*vol)**third
107 END IF
108 ENDIF
109 spbuf(1,n)=dist
110C
111 flg_h=nint(get_u_geo(9,i0))
112 IF (flg_h==3) THEN
113C-- FLG_H=3 - computation of H from interparticle distance - presearch of neigbours needed
114 pre_search = 1
115C-- Approximation of H
116 j=kxsp(3,n)
117 nbnod(iprt)=nbnod(iprt)+1
118 xmin(iprt)= min(xmin(iprt),x(1,j))
119 ymin(iprt)= min(ymin(iprt),x(2,j))
120 zmin(iprt)= min(zmin(iprt),x(3,j))
121 xmax(iprt)= max(xmax(iprt),x(1,j))
122 ymax(iprt)= max(ymax(iprt),x(2,j))
123 zmax(iprt)= max(zmax(iprt),x(3,j))
124 ENDIF
125C
126 END DO
127C
128 IF (pre_search == 1) THEN
129C Rough approxiamtion of H per part - only used for presearch (important for SOL2SPH because MP not defined)
130 DO iprt = 1, npart
131 IF (nbnod(iprt) > 0) THEN
132 vol_tot = abs(xmin(iprt)-xmax(iprt))*abs(ymin(iprt)-ymax(iprt))*abs(zmin(iprt)-zmax(iprt))
133 volp_prt(iprt) = vol_tot/nbnod(iprt)
134 ENDIF
135 END DO
136 DO n=1,numsph
137 iprt=ipartsp(n)
138 i0 =ipart(2,iprt)
139 flg_h=nint(get_u_geo(9,i0))
140 IF (flg_h==3) THEN
141 dist = volp_prt(iprt)**third
142 spbuf(1,n) = min(dist,spbuf(1,n))
143 ENDIF
144 END DO
145C
146 CALL my_alloc(max_intp_dist_part,npart)
147 max_intp_dist_part(1:npart) = zero
148 sz_intp_dist = npart
149c
150C Pre-search of neigbours to define interparticular distance
151 CALL sptri(kxsp ,ixsp ,nod2sp ,x ,spbuf ,
152 . lprtsph ,lonfsph ,ipartsp ,sz_intp_dist,max_intp_dist_part,
153 . pre_search)
154C
155 DO n = 1, numsph
156 iprt=ipartsp(n)
157 i0 =ipart(2,iprt)
158 flg_h=nint(get_u_geo(9,i0))
159C KXSP(9,N) = FLG_H
160 IF (flg_h==3) THEN
161 h_scal=get_u_geo(12,i0)
162 spbuf(1,n)=h_scal*max_intp_dist_part(iprt) ! DIamter of the particle
163 spbuf(14,n)=h_scal*max_intp_dist_part(iprt) ! Diameter of the particle at time zero
164 ENDIF
165 END DO
166C
167 DEALLOCATE(max_intp_dist_part)
168C
169 ENDIF
170C
171 RETURN
#define my_real
Definition cppsort.cpp:32
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
subroutine sptri(kxsp, ixsp, nod2sp, x, spbuf, lprtsph, lonfsph, ipartsp, sz_intp_dist, max_intp_dist_part, pre_search)
Definition sptri.F:51