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 33 of file spinih.F.

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