OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sptri.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"
#include "sphcom.inc"
#include "buckr_c.inc"

Go to the source code of this file.

Modules

module  mod_sptri

Functions/Subroutines

subroutine sptri (kxsp, ixsp, nod2sp, x, spbuf, lprtsph, lonfsph, ipartsp, sz_intp_dist, max_intp_dist_part, pre_search)

Variables

integer, dimension(:), allocatable mod_sptri::wreduce

Function/Subroutine Documentation

◆ sptri()

subroutine sptri ( integer, dimension(nisp,*) kxsp,
integer, dimension(kvoisph,*) ixsp,
integer, dimension(*) nod2sp,
x,
spbuf,
integer, dimension(2,0:npart) lprtsph,
integer, dimension(*) lonfsph,
integer, dimension(numsph), intent(in) ipartsp,
integer, intent(in) sz_intp_dist,
dimension(sz_intp_dist), intent(inout) max_intp_dist_part,
integer, intent(in) pre_search )

Definition at line 48 of file sptri.F.

51C-----------------------------------------------
52 USE message_mod
53 USE mod_sptri
54C-----------------------------------------------
55C I m p l i c i t T y p e s
56C-----------------------------------------------
57#include "implicit_f.inc"
58C-----------------------------------------------
59C G l o b a l P a r a m e t e r s
60C-----------------------------------------------
61#include "com04_c.inc"
62#include "sphcom.inc"
63#include "buckr_c.inc"
64C-----------------------------------------------
65C PRE_SEARCH = 0 -> full search of neigbours
66C PRE_SEARCH = 1 -> pre-search of neigbours for computation of max interparticle dist
67C-----------------------------------------------
68C D u m m y A r g u m e n t s
69C-----------------------------------------------
70 INTEGER KXSP(NISP,*), IXSP(KVOISPH,*), NOD2SP(*),
71 . LPRTSPH(2,0:NPART) ,LONFSPH(*)
72 INTEGER ,INTENT(IN) :: IPARTSP(NUMSPH),PRE_SEARCH,SZ_INTP_DIST
74 . spbuf(nspbuf,*), x(3,*)
75 my_real ,INTENT(INOUT) :: max_intp_dist_part(sz_intp_dist)
76C-----------------------------------------------
77C L o c a l V a r i a b l e s
78C-----------------------------------------------
79 INTEGER N,J,K, IREDUCE, NVOIS, IERROR,JVOIS(NUMSPH), JSTOR(NUMSPH), JPERM(NUMSPH)
80 INTEGER NS, WASPACT(NUMSPH), IPRT
81 my_real dvois(numsph), bminma(6), myspatrue,xmax, ymax, zmax
82C-----------------------------------------------
83 nvois = 0
84C-----------------------------------------------
85 ALLOCATE(wreduce(numsph),stat=ierror)
86 IF(ierror/=0) THEN
87 CALL ancmsg(msgid=19,msgtype=msgerror,anmode=aninfo,
88 . c1='(SPH)')
89 CALL arret(2)
90 END IF
91 ireduce=0
92 wreduce(1:numsph)=0
93C-----------------------------------------------
94 IF(nsphio==0)THEN
95 nsphact=0
96 DO n=1,numsph
97 IF(kxsp(2,n)/=0)THEN
98 nsphact=nsphact+1
99 waspact(nsphact)=n
100 ENDIF
101 ENDDO
102 ELSE
103 nsphact=0
104 DO iprt=1,npart
105 DO k=lprtsph(2,iprt-1)+1,lprtsph(1,iprt)
106 nsphact=nsphact+1
107 waspact(nsphact)=lonfsph(k)
108 ENDDO
109 ENDDO
110 END IF
111C
112 DO ns=1,nsphact
113 n=waspact(ns)
114 kxsp(5,n)=0
115 END DO
116C-----------------------------------------------
117 bminma(1) = -ep30
118 bminma(2) = -ep30
119 bminma(3) = -ep30
120 bminma(4) = ep30
121 bminma(5) = ep30
122 bminma(6) = ep30
123C
124 xmin=ep30
125 xmax=-ep30
126 ymin=ep30
127 ymax=-ep30
128 zmin=ep30
129 zmax=-ep30
130C
131C Bucket sort. DBUC + MIN / MAX
132C
133 dbuc=zero
134 DO ns=1,nsphact
135 n=waspact(ns)
136 dbuc=max(dbuc,spbuf(1,n))
137C
138 j=kxsp(3,n)
139 xmin= min(xmin,x(1,j))
140 ymin= min(ymin,x(2,j))
141 zmin= min(zmin,x(3,j))
142 xmax= max(xmax,x(1,j))
143 ymax= max(ymax,x(2,j))
144 zmax= max(zmax,x(3,j))
145 END DO
146C
147 bminma(1) = max(bminma(1),xmax)
148 bminma(2) = max(bminma(2),ymax)
149 bminma(3) = max(bminma(3),zmax)
150 bminma(4) = min(bminma(4),xmin)
151 bminma(5) = min(bminma(5),ymin)
152 bminma(6) = min(bminma(6),zmin)
153C
154 dbuc=dbuc*sqrt(one +spatrue)*onep0001
155 bminma(1) = bminma(1)+dbuc
156 bminma(2) = bminma(2)+dbuc
157 bminma(3) = bminma(3)+dbuc
158 bminma(4) = bminma(4)-dbuc
159 bminma(5) = bminma(5)-dbuc
160 bminma(6) = bminma(6)-dbuc
161C-----------------------------------------------
162 CALL spbuc31(x ,kxsp ,ixsp ,nod2sp,
163 . spbuf ,waspact,jvois,jstor ,jperm ,
164 . dvois ,ireduce,wreduce,bminma,ipartsp ,
165 . sz_intp_dist,max_intp_dist_part,pre_search)
166C-----------------------------------------------
167C re-tri voisins (voisins vrais, voisins dans la zone de securite).
168C
169 IF (pre_search==0) THEN
170 myspatrue=spatrue
171C /---------------/
172C CALL MY_BARRIER
173C /---------------/
174 CALL spclasv(x ,spbuf ,kxsp ,ixsp ,nod2sp ,
175 1 waspact,myspatrue,ireduce,wreduce)
176C /---------------/
177C CALL MY_BARRIER
178C /---------------/
179 IF(myspatrue<spatrue)spatrue=myspatrue
180 ELSE
181 DEALLOCATE(wreduce)
182 ENDIF
183
184 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
integer, dimension(:), allocatable wreduce
Definition sptri.F:31
subroutine spbuc31(x, kxsp, ixsp, nod2sp, spbuf, ma, jvois, jstor, jperm, dvois, ireduce, kreduce, bminma, ipartsp, sz_intp_dist, max_intp_dist_part, pre_search)
Definition spbuc31.F:36
subroutine spclasv(x, spbuf, kxsp, ixsp, nod2sp, waspact, myspatrue, ireduce, kreduce)
Definition spclasv.F:32
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
subroutine arret(nn)
Definition arret.F:87